cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport Problem with C#

Former Member
0 Kudos

I've got a relatively simple desktop application written in C# VS2005. I'm trying to get a report with a summarizing SubReport to display. The report displays fine without the SubReport and the SubReport displays okay as a stand alone, but I continue to crash with an "object not set to an instance..." error message. It must be that I'm not configuring the SubReport within the main report correct. I'm displaying the report using the CrystalReportViewer. Any help or sample code would be greatly appreciated.

TIA

Brad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Brad,

please download a [sample How to add subreports in CS for VS 2005|ftp://ftp.businessobjects.com/pub/incoming/NET-CS2005_RAS-Unmanaged_CR115_Add_Subreport.zip].

Other [.NET samples|https://boc.sdn.sap.com/dotnet/samples] you might find on our [dev community|https://boc.sdn.sap.com/].

Best regards

Falk

Former Member
0 Kudos

Thank you for your reply. My problem seems to be how to get data into the subreport so that the overall report (report + subreport) can be displayed by the CrystalReportViewer control. I inserted the subreport directly into the report during design time (Insert - Subreport). I then load the report and its associated data using: mReportDocument.OpenSubReport("SubReportName).SetDataSource(dsSubReportData). I then use the CrystalReportViewer to be displayed etc. Does this additional information help?

Thanks

Brad

Former Member
0 Kudos

Hello Brad,

I recommend to use my sample.

You can save the rpt file later and open in the CR designer to check if the subreport is inserted in the correct section.

Then preview in the designer and in my code. Do you get still the error ?

Thanks

Falk

Former Member
0 Kudos

Hi Falk,

I am desperately looking for an example how to add subreports programmatically in an unmanaged RAS environment. Unfirtunately, your link is no longer valid. Would you please post the actual one?

Thanks a lot!

Pascal

Former Member
0 Kudos

Hi Ludek,

thanks for the links!!

Best regards,

Pascal

Answers (0)