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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Main Report / Sub Report & Parameter = Parameter

Status
Not open for further replies.

techie2

Programmer
Jul 28, 2004
180
US
Hi,

I am using CR 8.5, CE 8.5 and Oracle 8i.

I have a report which is pointing to stored procedure with parameters "startdate" and "enddate". When I run this report individually, it works fine...no probs here. (This report has to be pointing to stored procedure for additional logic I need to use)

I have main report where I want to insert the above described sub report. Now when I insert the report as sub report, the linking dialogue asks for parameter name to be created. So I gave those names to "mainstardate" and "mainenddate". no probs here also

Now in my subreport, which had 2 parameters "startdate" and "enddate", I want to pass value from parameters from main report.

So my final selection formula becomes:

{?startdate} = {?mainstartdate} and
{?enddate} = {?mainenddate}

Now the problem is {?startdate} and {?enddate} parameters are empty and my subreport which is pointing to stored procedure returns nothing.

Any help is greatly appreciated.

Thanks,

V
 
Your "final formula", which is actually known as the record selection formula, is incorrect on 2 levels.

First, it should have >= and <=, not 2 sets of equals.

I also believe that the subreport would have indicators for the main report parameters which yours does not.

Let Crystal build the selection criteria by linking the main and sub on these parameters.

Now go into the subreport->Report->record selection formula->record and adjust the = to reflect >= and <=.

-k
 
Thanks for reply.

I changed the SF as per your suggestion to >= and <=, still does not return any data.

Ok Let me try to explain once again.

Normally when we build SF, it looks something like this:
{EMPLOYEE.CHECK_DATE} = {?startdate}
which is fine as I am comparing the value of {?startdate} parameter with table column.

In this specific scenario, I need to pass the parameter value from one parameter to another parameter, which is
{?startdate} = {?mainstartdate} and
{?enddate} = {?mainenddate}

I did not create the SF by myself and CR did it for me, but problem is I could not see the parameter names of sub report while linking, so I had to change SF in subreport as decribed in my earlier mail.

Any more thought would be appreciated.

Thanks,

V
 
Again, the syntax is wrong, so you MUST fix it before it can work.

Perhaps the parameter types in your subreport don't match the main, a common problem is that one is a date, and the other a datetime.

Nothing anyone else can do for you, you need to go in and figure out what;s wrong, the theory I've supplied shoudl allowyou to correct it.

So if the data types differ, create formulas in the main report and change the data types to match the supreport parameter types, adn then link on those, and then go in and edit the selection formula.

-k
 
Howdy:

This may be a bit late but here's my 2 cents.

Your sub-report should not have parameters but you be the fields for the check dates in the main report should be linked to the check date fields in the sub-report. It has been my experience with sub-reports that you can not pass values from one parameter to another.

When you link you main report to the sub-report you should choose the {EMPLOYEE.CHECK_DATE} from the main report and then select the checkdate field in the sub-report. This will pass all the vaules of checkdate from teh main report to the subreport.

Give it shot. If you need more help reply to this post.
 
In your subreport, create the record selection formula:

{table.date} >= {?start} and
{table.date} <= {?end}

...where {?start} and {?end} are parameters set up within the subreport. Then in the main report create your two parameters {?mainstart} and {?mainend}. Go to edit subreport links and choose {?mainstart} and move it to the right and then from the drop down box in the bottom left, choose {?start}, NOT {?pm-?start}. Repeat for {?mainend} and {?end}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top