Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass parameter to subreport

Status
Not open for further replies.

EBee

MIS
Aug 10, 2001
229
US
I have a parameter that I use for my main report, That same parameter is also being used in my subreport. For some reason It wants me to input the same parameter twice. How can I pass the parameter on my main report to my subreport. And, does it have to re-run again when it does it. Is there a way to run my report once ?

thanks
erwin
 
This could be a couple of scenarios

1. You have linked your subreport through the parameter and also have the same parameter set up in the subreport separately. If you look at the select expert, you should see two instances of the parameter. To change this, just remove the parameter that you created in the subreport and use the parameter that was created when you linked subreports. The syntax for the system-generated parameter is going to look like Pm-?Name. The syntax for your parameter may or may not be different, depending on how you set it up.

2. The other possibility is that you have set up the parameter in the main report and in the subreport instead of linking your parameter. In that case, remove the parameter from the subreport. Go back to the main report and select your subreport. Go to the subreport links and select the parameter in the main report and link it to the appropriate field in the subreport.


K Tanner
 
thanks for the information,

can you explain how does the SQL SERVER gets access by the report if there is a sub-report. Does it get queried twice or does it use the same group from the main report. It seems that after the main report is done accessing the database, the subreport does it again, which is I don't understand. Does this mean my subreaport link is not setup properly?

erwin
 
First thing you need to understand is that Crystal Reports is Two-Pass reporting Process.

The Sub report Query is passed to Database during SECOND PASS and hence it is always advised to go for Sub-Report if you had already tried all options at hand.Using Stored Procedure is best way to design specially if report design demands Sub-Report.

For more details look at the following document.Also look at the document named
SCR_EVALUATIONTIME.pdf

 
I guess i would like to try to create a stored procedure, but i have no clue as to how to build one. Is there a web site that you can direct me so i can see a sample of a stored procedure.

thanks
erwin
 
What knd of database you have ? Oracle or SQL server or any other...cos working with procedures is lil different in Oracle when compared to MS-SQL Server.But in any case go to knowledge base on Crystal Decisions site and search using keyword:
The knowledge base page is:

"Stored Procedure" with option od ALL words.
It returned with bunch of documents for using Stored Procedures in reports.
I found the following article very helpful from Knowledge base on Crystal decisions site:

Synopsis

In an effort to streamline our Oracle Stored Procedure information, we have created a whitepaper which lists the versions of Crystal Reports that will support Oracle stored procedures, which database drivers should be used, requirements for your Oracle stored procedure, as well as a sample stored procedure.

This whitepaper can be found at the following link:


and search for the following file:

SCR_Oracle_Stored_Procedures.pdf




Solution

As a result of combining this information into one whitepaper, we have removed the following knowledge base articles from our website:

c2000342 - Oracle stored procedure with DATE selection
c2004898 - Requirements for ORACLE Stored Procedure Access
c2004581 - Oracle Stored Procedure Support Through ODBC
c2000287 - Oracle Connectivity / Stored Procedure Support
c2008013 - Support for Stored Procedures in SCR 4
c2008015 - Support for Stored Procedures in SCR 6
c2008016 - Support for Stored Procedures in SCR 7
c2008017 - Support for Stored Procedures in SCR 8
c2008024 - Requirements when reporting off Oracle Stored Procedures
c2008025 - Sample Oracle Stored Procedure
c2008026 - How to Execute a Stored Procedure in SQL*Plus


The day He summons you, you will respond by praising Him, and you will then realize that you had lasted in this life but a short while.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top