Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Sub reports will not work in VS2010

$
0
0

I have installed crystal reports for VS2010 (EXE) package from SAP web site.

I am using VS2010 for my application.

 

My VB.NEt app was originally developed in VS2003 several years ago. The app has about 150 crystal reports, which ran fine on .NET 1.1 without a problem, My company decided to upgrade the project to .NET4.0 recently.

 

I have migrated all the code and the reports to .NET 4.0. I can build and compile fine. When I launch the app, it runs fine also.

I have been able to open crystal reports which dO NOT HAVE SUB REPORTS embedded in them. They seem fine.

 

Every report that has a sub report causes VS2010 to crash. In the debug mode, the code fails when i try to set the report source.

 

I get the below error.

{"Could not load file or assembly 'file:///C:
Program Files
SAP BusinessObjects
Crystal Reports for .NET Framework 4.0
Common
SAP BusinessObjects Enterprise XI 4.0
win32_x86
dotnet1
crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.":"file:///C:
Program Files
SAP BusinessObjects
Crystal Reports for .NET Framework 4.0
Common
SAP BusinessObjects Enterprise XI 4.0
win32_x86
dotnet1
crdb_adoplus.dll"}

 

I have changed my app config to the folliowing.

<startup useLegacyV2RunTimeActivationPolicy="true">

    <supportedRuntime version="v4.0"/>

  </startup>

 

Below is the code snippet that Crystal report crashes. All my reports uses ADO.NET XML files.  I create an xml file, specify the column names in the xml file, set the report source to a dataset that has a table containing the same name as the XML root element and the same columns.

 

Public Sub LoadForm11_Acct(ByRef Ds1 As DataSet, ByRef Ds2 As DataSet, _

                                    ByRef Ds3 As DataSet, ByVal sYear As Int16)

 

 

        crRptDoc = New rptAcctForm11

 

        Dim sSub1 As CrystalDecisions.CrystalReports.Engine.ReportDocument

        Dim sSub2 As CrystalDecisions.CrystalReports.Engine.ReportDocument

 

        Dim sTaxYear As CrystalDecisions.CrystalReports.Engine.TextObject = _

               CType(crRptDoc.ReportDefinition.ReportObjects.Item("txtYear"),  _

               CrystalDecisions.CrystalReports.Engine.TextObject)

 

        sTaxYear.Text = sYear

 

'CRASHES RIGHT AT THE BELOW LINE

        crRptDoc.SetDataSource(Ds1)

 

 

        sSub1 = crRptDoc.OpenSubreport("rptP11-Vehicles.rpt")

        sSub2 = crRptDoc.OpenSubreport("rptVehicleListing.rpt")

 

 

        sSub1.SetDataSource(Ds2)

        sSub2.SetDataSource(Ds3)

 

 

 

        Me.Text = "Assessor's Personal Book For Individual Account"

        Me.crPA.ReportSource = crRptDoc

 

    End Sub

 

 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>