Page 1 of 1

DataSet With Two Tables

Posted: Mon Jul 09, 2018 9:28 am
by el7lme
I have a problem when creating a report which has two separate tables as i defined a custom data source then added two tables "salesInvoice" & "SysCompany"
st.png
st.png (59.57 KiB) Viewed 3100 times

In JS i did the following code
this.report.loadFile(this._getSubFolder()+'/'+file.FileName);

// Set Company Dataset
var dataSetCompany = new Stimulsoft.System.Data.DataSet("SysCompany");
dataSetCompany.readJson(JSON.stringify(this.SelectedCompany))
this.report.regData("SysCompany", "", dataSetCompany);

// Set Sales Invoice Dataset
var dataSet = new Stimulsoft.System.Data.DataSet("salesInvoice");
dataSet.readJson(JSON.stringify(this.Data))
this.report.regData(dataSet.dataSetName, "", dataSet);

I tried many many scenario like attached two tables as one json and send but no way
All result give me NAN

I am using Stimulsoft 17_2_3 JS

Re: DataSet With Two Tables

Posted: Mon Jul 09, 2018 11:49 am
by Lech Kulikowski
Hello,

Please try to use the synchronize() method. If the issue still present, please send us your JSON data for analysis.

Thank you.

Re: DataSet With Two Tables

Posted: Fri Jul 13, 2018 3:25 pm
by el7lme
Now its working
I have combined the two dataset on one Json variable ans register the dataset.

// Coabmbine Two Table Into One Json Object
reportData={details:this.Data,SysCompany:this.SelectedCompany}
// Define DataSet For Report
var dataSet = new Stimulsoft.System.Data.DataSet("root");
//Read Data Into Defined Dataset
dataSet.readJson(JSON.stringify(reportData))

// Register Defined Data Set
this.report.dictionary.databases.clear();
this.report.regData("root", "root", dataSet);
this.report.dictionary.synchronize();

Many Thanks to Lech Kulikowski

Re: DataSet With Two Tables

Posted: Mon Jul 16, 2018 8:08 am
by Lech Kulikowski
Hello,

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.