Click here to Skip to main content
15,887,398 members
Please Sign up or sign in to vote.
1.00/5 (1 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 7:59am

1 solution

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[^]
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900