Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a Crystal Report which has two sub reports in it. When I try to
view this Crystal Report in my report preview , it is showing data for sub
reports also. But when I run it and view the Crystal
Report I am not able to view the data of sub reports. It is not giving any
error. It is not showing the data. I am not knowing what might be
the problem. Please let me know if you have any idea

pls help me i really need it
thankyou
C#
//ds1 is the dataset of main report
//ds2 is the dataset of sub report
//dt1 is the table of main report
//dt2 is the table of sub report
    ds1.Tables.Add(dt1);
    ds2.Tables.Add(dt2);

    ds1.WriteXmlSchema("sample1.xml");
    ds2.WriteXmlSchema("sample2.xml");


    //transefer data to crystalreportviewer
    CrystalReport1 cr1 = new CrystalReport1();//main report
    CrystalReport2 cr2 = new CrystalReport2();//sub report

    cr1.SetDataSource(ds1);
    cr2.SetDataSource(ds2);

    crystalReportViewer1.ReportSource = cr1;
Posted
Updated 17-Jan-15 21:42pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900