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

Conditional Formatting Off a SP Parameter

Status
Not open for further replies.

selvirino

Programmer
Jun 18, 2001
17
US
I am working with Crystal Reports 6 in an environment where batch reporting is done using Crystal Info. Data is provided to the reports from SQL Server 7 stored procedures. I have a situation where a single report is run multiple times by Crystal Info, each time with different parameters.

How can I conditionally format the report's title based on the paramters passed by Crystal Info through the report to the SQL Server stored procedure?

I tried creating a formula referencing the parameter as {?myParamName} and also as {?@myParamName}. The formula editor rejects both these pieces of syntax as invalid field names.

Any help will be most appreciated.

Thanks!
 
I'm not certain about CR 6, it's been a while, but if you have a parameter in the report, it will show up as a parameter in the report, meaning you can select it for use in a formula.

Somewhat ominously, your first parm reference attempt syntax looks right, providing there are no spaces in it:

{?myParamName}

-k kai@informeddatadecisions.com
 
Right. I think the confusing thing here is that I do not have any parameter fields in the report. The report is run as part of a Crystal Info batch job, which means there is no user interaction: no prompting of users for parameter values. The parameters are passed using Crystal Info.

I guess this is why {?myParameterName} doesn't work in a formula; there is no parameter field in the report. However, the report is linked to the stored procedure, and I can pull up a list of expected parameters for the stored procedure through the Designer. It seems like a pretty basic thing to me to be able to reference a stored procedure parameter in the report, specifically in a formula. I just can't figure out the syntax.
 
The report probably has parameters in it, it's just that you're circumventing the prompting process by populating them in SI.

When you open the report in Crystal Reports, does it show the SP parameters?

If not, it's unclear to me how SI is passing these parms.

Generally you use SI to prepopulate parms at schedule time, that doesn't mean that the parms aren't there.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top