Click here to Skip to main content
14,427,367 members
Rate this:
Please Sign up or sign in to vote.
See more:
Crystal Report Open from Resources folder, i have tried.

This error on last line

System.ComponentModel.Win32Exception: 'No application is associated with the specified file for this operation'

What I have tried:

Dim CrytsalReportFile = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData + "\Embedded.rpt"
Dim EmbeddedBytes As Byte() = My.Resources.Embedded

My.Computer.FileSystem.WriteAllBytes(CrytsalReportFile, EmbeddedBytes, False)
Process.Start(CrytsalReportFile)
Posted
Updated 9-Jan-20 8:59am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

The error message is perfectly clear - there is no application installed on the computer where your application is running which can open an .rpt file.

And it's unlikely that you'd want to open the file anyway. That would simply open the Crystal Reports designer, whereas you probably want to bind the report to some data and display the output.

To do that, you'll need to write some code. Google has lots of examples to help you. Eg:
How to Load and Display Crystal Reports in VB.NET[^]
   
Comments
Computechsoft 10-Jan-20 1:31am
   
I now I can't want to open the file anyway but I want embedded resources therefore i
was asking from resources folder.
Computechsoft 13-Jan-20 9:46am
   
I want to using this file from resources folder
Dim EmbeddedBytes As Byte() = My.Resources.Embedded

****************
I have seen your example code
How to Load and Display Crystal Reports in VB.NET[^]

Dim objForm As New frmViewReport
objForm.ViewReport("C:\test.rtp", , "@parameter1=test¶mter2=10")
objForm.show()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100