How to pass parameters into sub-reports.

How to pass parameters into sub-reports.

Forum member · Jul 20, 2007
I have sub-report in Body of my main report. How can I pass parameters into this sub-report? Let's say I have main report "Users" based on SQL Table "Users". Let's say I need for every user a sub-report with "UserAccessRights", based on SQL Table "UserAccessRights". How can I call "UserAccessRights" sub-report for every User record filtered by UserID field? How can I pass the UserID value from parent report to "UserAccessRights" sub-report? I know the concept in CrystalReports, you just make a link between sub-report parameters and fields from parent report. Sorry for so many lame questions, I am still learning the implementation concept of DynamicPDF.

Re: How to pass parameters into sub-reports.

Support · Jul 20, 2007
Hello, You can refer to the columns from previous queries by surrounding the column name with the pound sign (#) in the subreport. You can refer to the Nested Query topic on our documentation which shows this. Thanks, ceTe Software Support Team.

Re: How to pass parameters into sub-reports.

Forum member · Jul 20, 2007
Works perfectly fine. Thank you for the fast help egain.

Re: How to pass parameters into sub-reports.

Forum member · Aug 17, 2007
...and working with MySQL ??? Thanks Napoleone

Re: How to pass parameters into sub-reports.

Support · Aug 17, 2007
Hello Napoleone, Yes, you can work with the MySql database also without any problem. You will have to follow the following steps for this. 1. Make sure the Properties Box visible (to display the Properties Box, select View menu, then "Properties Box"). 2. Next, select the Report to view its properties either by clicking on the blue vertical tab labeled "Report" or by selecting the report from the drop down list in the Properties window. 3. Find the "Query" property under the "Data" section of the report properties and press the more button. 4. A new Query Editor window opens up. 5. Select the Provider type as Event Driven from the list and you can specify the connection string here or in the web.config. And you can specify the query string in the OpeningRecordSet event of the Query. You can also refer to the Event Driven Querries topic on our help documentation. Thanks, ceTe Software Support Team.

Re: How to pass parameters into sub-reports.

Forum member · Aug 18, 2007
Thanks. I have tried 'Event Driven Queries' and is all ok with simple query. But I have a report and a sub-report in my file .dplx and works under MySQL, how I build the relation between two reports? Sorry for my english language. Thanks Napoleone

Re: How to pass parameters into sub-reports.

Support · Aug 20, 2007
Hello Napoleone, Yes, you can pass the parameters from the main report to the sub reports without any problem. In the main report's OpeningRecordSet event you can loop through the record set and create a record set for the sub report. You can access the current records by using the RecordSets property of the LayoutWriter. We can send an example if you can send a mail to our [^a|mailto:support@cete.com|Support Team^]. Thanks, ceTe Software Support Team.

Re: How to pass parameters into sub-reports.

Forum member · Aug 21, 2007
Thanks, many thanks. It's all OK. Compliments for you application. Best regards. Napoleone