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

Assigning Varaible to a Parameter???

Status
Not open for further replies.

mynameant

Programmer
Oct 19, 2005
64
US
Is it possible to assign a variable value to go to parameter in CRXI?

I am passing a shared value from main report to sub report and my sub report has a parameter which should accept this shared variable value as the parameter value. is it possible?

Thanks
 
Instead of using a shared variable, link the sub to the main report by linking the field used in the shared variable to the corresponding subreport field.

Or, if you just want both main and sub to share the same parameter filtering, then create the same parameter in the main report as in the sub, and link the parameters together by using the dropdown in the lower left of the linking screen to choose {?parm} instead of the default {?pm-?parm}. Set the parm = to some field in the record selection formula.

-LB
 
lbass,
I could not link the field to a parameter in sub report. I could only link param to param, but i'll check again.

Regarding the second option I could not do that. let me explain:
I have main report to accept multiple parameter values from user. so, it's going to be an array of values [correct??]. I cannot directly pass this to my stored procedure [oracle]. my report is based on stored procedure. So, I have to get all the values user selected in a comma seperated string format. This part is working. But now, to send this value to parameter, I need to link this to sub report param and I'm not able to do that. do you think there is any other way [If I cannot link para to a field]?
Thanks for your help.
 
If you have a string array {@stringarray} you want to pass to a subreport, then use it as a linking field, and then in the sub go to report->selection formula->record and change the formula to something like:

{table.field} in split({?pm-@stringarray},",")

-LB
 
Thanks for the response, but I think I should explain in detail about my requirement.
User selects muliple parameters for a report. I need to pass these parameters to Oracle stored procedure and bring related information. But ,unfortunately, Multiple parameter in crystal is a string array and crystal will not recognize array parameter from procedure. So, I can only create string parameter in my stored procedure.
So, to solve this problem, I thought of creating a main report, where it's simple parameter, and user selects multiple values. After that I am joining all these values as a comma delimted string and want to pass it to my sub report parameter, which is my actual stored procedure parameter. This is where I am at loss.How do I link this comma seperated string value to a parameter, so that crystal will not pop up sub report parameter to user.

The way you explained above might not solve my problem? or will it?

thanks for any more hints to get me going.
 
In the main report you could use a formula like this to return the parameter array in a comma delimited string:

join({?Parm},", ")

If you have the stored procedure in a subreport, you can then link this formula to your stored procedure parameter (I think--I've never really worked with a stored procedure).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top