Question

I have a table in my dataset that I create it in dataset design view in Visual Studio 2010. Then in my XtraReport1 class I have some labels that refer to these table columns. At the beginning this table is empty. When program is run, this table fill with with data, and then i make a new XtraReport in my code and call .ShowPreviewDialog() for it to show report. But it's empty and there is no error. Where i don't understanding ?

XtraReport1 report = new XtraReport1();
report.ShowPreviewDialog();

I think when I new up a XtraReport in my code and ShowPreviewDialog, in this specific time XtraReport look at dataset and get its data. Am I wrong? I'm sure that table that XtraReport is using is full with data because I show its data in exact time in a GridView - the GridView has data but the XtraReport doesn't!!

Was it helpful?

Solution

Answer is what Davide Piras said in comment : You are not associating the datatable to the report object. before calling the showpreview assign it to the report datasource

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top