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

Passing Parameters within a report in CR7.0

Status
Not open for further replies.

golyg

Programmer
Jul 22, 2002
319
US
I want a sub-report to use a value that is being returned in the main report.
I was thinking that I had to create a parameter value in the sub report for this to happen but now I am always being prompted from the VC++ app (that is where the report is being created..) .


any idea how to do this?

thanks
 
You want the subreport to use a value in the main report, or a parameter from the main report? Your post title references a parameter, your post does not. Perhaps you're unfamiliar with Crystal syntax, but these are very different things.

Your description leaves far too much to the imagination, try posting technical onformation:

Database/connectivity used
Example dtaa
Expected output

A parameter can be linked to a subreport field by right clicking the subreport and select change subreport links, then selecting the parameter from the main report, and the field in the subreport.

If you have a value in the main report which is to be linked to a subreport, group on the field and then link via that field.

If you need to return a value from a main report to a subreport, or vice verssa, use shared variables, as in:

mainreport formula:
whileprintingrecords;
Shared Numbervar MyValue:= {table.field};

As long as this formula is before the subreport executes, you can reference it, as in:
whileprintingrecords;
Shared Numbervar MyValue;
MyValue/{subtable.field}

You may have the architecture backwards and want the subreport as the main report, but it's hard to say from your post. A little effort on your part will minimize the requirement for us to cover all possibilities and result in faster, accurate responses.

Hope this helps.

-k
 
Well, I did mention the word parameter in my description....
anyways, Yes you did hit it on the nose with the
Code:
parameter can be linked to a subreport field by right clicking the subreport and select change subreport links, then selecting the parameter from the main report, and the field in the subreport.

thats what it needed.

I wasn't thinking it was an ODBC problem...
thanks for you help, sometimes when things aren't working I have a tendency to post quick, usually erratically....

thanks again,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top