Skip to Content

Correct configuration and distribution of application using CR for VS

Hello, I use the Crystal Reports for VS component in the VS 2013, to develop a new separate executable of legacy application which intended to work with .NET framework 3.5 and be distributed together with CR merge (MSM) modules to the client. Currently the project uses the ADO.Net DB connection and works on my development machine only with in app.config.

The questions are:

1.To work with .NET framework 3.5, should I distribute the CR runtime SP20 or I can distribute SP21? (in the CR Wiki was said that SP21 supports only .NET 4.0+ for ADO.NET) (https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads)

2.Should I install the appropriate runtime on the development machine (where the CR for VS is installed)?

3. CR modules in which folder should reference my VS project to have the executable work on the client machine (after distribution with CR MSM modules)?

The detailed answers will be greatly appreciated! Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Nov 08, 2017 at 09:20 AM

    Update: after installing .NET framework 4.7, it began to work!

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 07, 2017 at 04:21 PM

    You need to deploy the same version of the runtime with your application as you are using for development in VS - the two versions MUST match!

    It's up to you which version you use:

    - SP20 has dependencies on .NET 2.0 which must be installed in addition to .NET 3.5 which your program requires.

    - SP 21 requires .NET 4.0 for ADO.NET data sets, so you would have to target that instead of .NET 3.5 for your application.

    Don't worry about where the SDK files are located - your application should pick them up from the GAC.

    -Dell

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 07, 2017 at 06:53 PM

    Thank you very much Dell for the answer!

    I removed the SP21 and installed the SP20 on my dev machine and recompiled the executable with SP 20. I also installed the SP20 runtime on the clean (target) Win7 machine having only default .NET framework 3.5 installed, and deployed the exe to that machine.

    The recompiled app works good on the dev machine BUT throws the CrystalDecisions.CrystalReports.Engine.DataSourceException on the target machine when I try to set the report DataSource to the DataSet.

    The exception is:

    CrystalDecisions.CrystalReports.Engine.DataSourceException: Failed to load database information.
    Error in File CrystalReportTestDataSource2 1644_3060_{1108FCDC-369F-4AC0-ABAD-C87AC56673BD}.rpt:
    Failed to load database information. ---> System.Runtime.InteropServices.COMException (0x800002CD): Failed to load database information.
    Error in File CrystalReportTestDataSource2 1644_3060_{1108FCDC-369F-4AC0-ABAD-C87AC56673BD}.rpt:
    Failed to load database information.
       at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)
       at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
       --- End of inner exception stack trace ---
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)
    
    

    The relevant code is below (error handling lines removed). All involved files (.RPT, .XSD and .XML) are in their places and code checks their location

    ReportDocument crReportDoc = new ReportDocument();
    crReportDoc.Load(reportFileName); 
    DataSet ds = new DataSet(); 
    ds.ReadXmlSchema(xsdFileName);     //sucess
    ds.ReadXml(xmlFileName, XmlReadMode.InferSchema);  //sucess
    crReportDoc.SetDataSource(ds);   //### DataSourceException thrown (on the clean machine only)###
    

    Any help will be greatly appreciated! (I tried to find the answer/ solution but did not succeed meanwhile)

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 08, 2017 at 04:44 PM

    I fixed the WIKI, SP 21 does support 3.5 and above.

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 21 at 07:21 PM

    hi

    i installed SAP Crystal Reports Developer 13.0.21 for Visual Studio 2010-2017 and it work correctly in my system.

    when i install Crystal Reports Runtime engine For .NET Framework 4 (32-bit) in client system , it show viewer tool but it dose not show report1.rpt document.

    and it shown error : " CrystalDecisions.CrystalReports.Engine.ReportDocument " threw an exception.i'm using VS2012 and .Net 4.5

    Add comment
    10|10000 characters needed characters exceeded