MrMustafa
MrMustafa

Reputation: 305

How to Load embedded Crystal Report after Deployment

I am developing a WinForms C# application using Visual Studio 2019 that uses Crystal Reports.

I am using the following code to load the report, it uses the path of crystal report file:

ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Application.StartupPath + "\\CrystalReport1.rpt");

After the deployment this produces an error that the File is not found in the specified path

The Crystal report file is actually embedded,

how can I access the embedded report after deployment?

Upvotes: 0

Views: 430

Answers (1)

Wei Chen Chen
Wei Chen Chen

Reputation: 88

Be sure the file is set to

Build Action >> Content; Copy to Output Directory >> Copy always

Upvotes: 1

Related Questions