0

I am developing a system and I need to produce reports. I am using Crystal Report and my language is C#. The problem is, when I execute the program, it gives me an error like what you see in the picture below but there is no error in code. What is the solution for these?

My code in windows form application:

private void MedReceipt_Load(object sender, EventArgs e)
{           
            ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load("C:\\Users\\Joseph\\Documents\\Visual Studio 2010\\Projects\\PRMS-Capstone\\PRMS-Capstone\\Receipt1.rpt");
            reportMedReceipt.ReportSource = cryRpt;
            reportMedReceipt.Refresh();
}
doobop
  • 4,465
  • 2
  • 28
  • 39
  • 1
    Did you connect your CR to Database? CR need to login to DB. What connection you use? ODBC? – Vijunav Vastivch Aug 15 '16 at 01:09
  • How? I am beginner in using CR. Can you email me at my gmail? Thank you. – Joseph Alborida Aug 15 '16 at 07:27
  • If you look at the design view of your report, on the right hand side there is a section called 'Field Explorer', right click on 'Database Fields' and select your DB. If you cannot see it, check your net util for ODBC connections.That is, assuming ODBC is your connection. If that sounds foreign to you, I'd suggest starting with some basic DB tutorials to understand how CR communicates with your DB. – Jackson Aug 16 '16 at 15:04
  • Does this answer your question? [Failed to Load database information in Crystal Report for Visual Studio](https://stackoverflow.com/questions/23902850/failed-to-load-database-information-in-crystal-report-for-visual-studio) – Khalid Bin Sarower May 23 '22 at 09:41

1 Answers1

1

Try this answer


Add the <startup> code below code under the <configuration> element in your app.config

<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
Tiago S
  • 1,299
  • 23
  • 23