Link to home
Start Free TrialLog in
Avatar of kvnsdr
kvnsdr

asked on

Crystal Reports ReportDocument1 XML Load Problem!

The following code successfully loads report.rpt into CrystalReportViewer1, however NO data shows in the report.

Now I know the XML is correct because it's read by an XSLT/HTML method.


                DataSet dataset = new DataSet();
                dataset.ReadXml("C:\\Reports\\Xml\\Stats.xml");
                this.reportDocument1.SetDataSource(dataset);
                this.reportDocument1.Load("C:\\Report.rpt");
                this.crystalReportViewer1.ReportSource = this.reportDocument1;
                this.crystalReportViewer1.RefreshReport();
Avatar of rameedev
rameedev
Flag of India image

Can you try loading the .rpt file first and then set the datasource...

  this.reportDocument1.Load("C:\\Report.rpt");
  this.reportDocument1.SetDataSource(dataset);
Avatar of kvnsdr
kvnsdr

ASKER

No difference.

Also added this code to check the dataset data, but still no data showing in CrystaReports....

dataset.WriteXml("C:\\Reports\\Xml\\Stats123.xml");

Both Stats.xml and Stats123.xml are identical.

Same data in and out.
How did u design the report...using an xsd file...if yes then the data xml file which you are using should be of the same format as the xsd file
Avatar of kvnsdr

ASKER

Okay, here's the problem.

I'm pulling data from three data-tables within the dataset.

Now, if one of the data-tables is empty, NO data is loaded into the entire report.

I all three data-tables have at least one row of data, the report works great.

So,

Q. How do I design the report the correct way?
ASKER CERTIFIED SOLUTION
Avatar of rameedev
rameedev
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial