简体   繁体   中英

Data I add to a table in DataSet is not shown in XtraReport

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!!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM