Page 1 of 1

How to give parameter to datasource of subreport

Posted: Fri Sep 18, 2009 6:41 am
by vencaq
Hello. Is any possibility to give parameter to datasource of subreport? I have report which contains subreport. The subreport is using different datasource which needs parameter to execute. For example datasource of the main report writes out three rows and I need to give values from column paramID to datasource of the subreport as parameters.

Thanks.

How to give parameter to datasource of subreport

Posted: Tue Sep 22, 2009 1:58 am
by Jan
Hello,

Please check attached report.

Thank you.

How to give parameter to datasource of subreport

Posted: Fri Jan 29, 2010 5:19 am
by ZoliNewUser
Hi Jan,
I have the same problem.
I have created a Report-Subreport by your Sample.
There are two Tables
Table1: Invoices tabble contains main infos as lngInvoiceID, lngCustomerID,...
Table2: Articles table contains several things what customer bought.// lngInvoiceID, lngArticleID...
I want to print concrete invoice with main infos and all articles what it contains.

Table1: select * from Invoices where lngInvoiceID = @InvID //lngInvoiceID included
Table2: select * from Articles where lngInvoiceID = @AInvID
Table2 has a parameter @AInvID =Table1.lngInvoiceID

Report:
Page1.DataBand1.DataSource = Table1 and Has a Supreport1
Subreport1.DataBand2.DataSource = Table2
Subreport1.DataBand2.MasterComponent = DataBand1 // It is Page1.DataBand1, I thing it is correct

In the application i give the @InvID parameter to the Report
Report[@InvID] = 1111;
It's OK, but the Report prints only main infos of Table1, Subreport1 is not printed.
In the SQL Server Profiler (MSQL) I could'nt find anything about SQl query of Subreport1

What i do wrong?

Thanks.

How to give parameter to datasource of subreport

Posted: Mon Feb 01, 2010 6:57 am
by Edward
Hi

Could you please send us a sample application to support[at]stimulsoft.com for reproducing of the problem? If possible, please attach a necessary data too.

Thank you.

How to give parameter to datasource of subreport

Posted: Tue Feb 02, 2010 5:47 am
by ZoliNewUser
Hi Edward,

I have figured it out.
I have to set the Table2.ReconnectOnEachRow = true;
I'm new user.
Could you make a help file like as general window help, in what the user can search by content, index...?
I thing, it makes the beginning easer for new users.

Thank you.

How to give parameter to datasource of subreport

Posted: Tue Feb 02, 2010 5:12 pm
by Edward
Hi

Thank you for your feedback.

Please download chm files you requested from the following page:

http://stimulsoft.com/Documentation.aspx

also you always can search the forum :)

Thank you.