DataTable Not Passing to Report Designer

Stimulsoft Reports.WEB discussion
Post Reply
bnewman
Posts: 3
Joined: Thu Oct 06, 2011 9:32 am

DataTable Not Passing to Report Designer

Post by bnewman »

I am having problems with the Report Designer. When I pass a Datatable either by report.RegData(dTable) or myreport.Dictionary.DataStore.Add(source) the data schema comes over as you can see below:
Image
However when loading an MRT then clicking preview I get NO report Data. However when I switch everything to a Report Viewer using the same mrt to generate data I get a full report. using the following code.

Code: Select all

		string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);

		StiReport report = new StiReport();
		report.Load(appDirectory + "\\App_Data\\SimpleList.mrt");

		// Load report from code
		DataTable dTable = new DataTable("Data");
		dTable.Columns.Add("col1", typeof(string));
		dTable.Columns.Add("col2", typeof(int));

		DataRow drow = dTable.NewRow();
		drow["col1"] = "test1";
		drow["col2"] = 1;
		dTable.Rows.Add(drow);
		drow = dTable.NewRow();
		drow["col1"] = "test2";
		drow["col2"] = 2;
		dTable.Rows.Add(drow);
		report.RegData(dTable);
		report.Dictionary.Synchronize();
        
		StiWebDesigner1.Design(report);

Code: Select all


        
            
            --%>
        
    

Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

DataTable Not Passing to Report Designer

Post by Vladimir »

Hello,

Please use the GetPreviewDataSet event to register the data for preview:

Code: Select all

protected void StiWebDesigner1_GetPreviewDataSet(object sender, StiWebDesigner.StiPreviewDataSetEventArgs e)
{
    ...
    e.Report.RegData(dTable);
}
Thank you.
bnewman
Posts: 3
Joined: Thu Oct 06, 2011 9:32 am

DataTable Not Passing to Report Designer

Post by bnewman »

That was the solution, thank you Vladimir!
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

DataTable Not Passing to Report Designer

Post by Andrew »

Hello,

Great! :biggrin:
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Re: DataTable Not Passing to Report Designer

Post by patwolf »

Does this mean that the data is send over to the client side multiple times?
Once for design and then again for every preview?
Would it be possible to cache it on the client side?

Thanks
Patrick
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: DataTable Not Passing to Report Designer

Post by HighAley »

Hello.

Data isn't sent to the client side. At design-time only database tables scheme is sent to the client side.
And on preview the rendered report is sent.
The data is needed by report engine which runs on the server side.
So no data is sent to the client side at all.

Thank you.
patwolf
Posts: 90
Joined: Thu May 29, 2008 1:38 pm
Location: Los Angles

Re: DataTable Not Passing to Report Designer

Post by patwolf »

Ah thanks for the info.
Best,
Patrick
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: DataTable Not Passing to Report Designer

Post by HighAley »

Hello.

You are welcome.
Ask questions else if you have.

Thank you.
Post Reply