Question

I create a C# program and connected to stimulsoft for Make Reports.

I send a Dataset with 2 Datatable to my report with below code:

DataSet ds = new DataSet();
dtP.TableName = "dtP";
dtF.TableName = "dtF";
ds.Tables.Add(dtP);
ds.Tables.Add(dtF);
Report.RegData(ds);
Report.Show();

and "Report" is stireport object.

when my report page shown. my report is empty.

And when sent just 1 datatable as Dataset to my report that's work well.


Solve:

with add below code to my c# program can solve my problem:

objStiReport.Dictionary.Clear();
objStiReport.RegData(ds);
objStiReport.Dictionary.Synchronize();
Was it helpful?

Solution

I also had this problem. I tried many ways but no one solve the problem. I changed something in the dictionary in stimulsoft report designer.

1) choose the Data from Dataset, DataTable data adaptor type

2) Set a name for Name In Source property (for example DS)

3) Add some tables to DS and set the Name In Source of them to something like this DS.Table1. Note that it's important to set the Name In Source property of tables like this.

As I set the Name In Source property of tables like DS.TableName, the problem gone away for me.

OTHER TIPS

 1. Merge your 2 datables

dtP.Merge(dtF, false, MissingSchemaAction.Add);

 1. fill your report with datatable
Report.RegData(dtP);

another way (if datatable are not able to be merge ) is to create one datatable with all column of each datatable

you can create a datarelation to establish a relationship between two datatables but can RegData method understand a relationship (datarelationp) ?

  1. First open report with stimul report designer

  2. In top of Dictionary tab, click on 'Action', and select 'Import XML Schema' and select your dataset file (with XSD extention) select 'Import XML Schema' and select your dataset file

  3. For add other dataset repeat step 2 but select 'Merg XML Schema'

  4. On your app code, use like this:

     StiReport report = new StiReport();
     report.Load(Server.MapPath(@"Report.mrt"));
     report.Compile();
    
     report.RegData(myDataSet1);
     report.RegData(myDataSet2);
     StiMobileViewer1.Report = report;
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top