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!

Parameters - Enter Parameter Values prompt problem

Status
Not open for further replies.

MattDavies51

Programmer
Oct 13, 2002
24
GB
I have a report that can be run from VB or the Web(ASP).

The problem is that less parameters are passed via the Web method. Therefore when running via the web, Crystal displays the Enter Parameter Values dialog box for that parameter.

Is there any way of automatically setting the Parameter value to Null in Crystal so that this dialog box does not display?

I know it would be easier to change the asp page, but I have no control over it.

Any help will be gratefully appreciated.
 
If you have control over Crystal but not over ASP then I think your best option is to create 2 versions of the report, one for each environment. Obviously the ASP-called version will have the unwanted parameter removed.
 
I didn't mention this before, but this issue will affect all of our company reports so I would prefer not to duplicate all the reports for this one issue.
 
Have you tried removing the offending parameter from the report?

Reebo
Scotland (Sunny with a Smile)
 
I want the parameter to be passed though.

The parameter is passed from VB to indicate that the report has been run from the VB application.

I would change the asp file so that the same parameter is passed(to indicate that the report has been run from the web), but I dont have control over the asp file.
 
Reebo - I think Matt needs to run the same reports under VB, at which time they need the extra parameter.

Matt - I believe in VB you can append a parameter (and then obviously populate it). Not got time to try this at the moment, but something in or around CrxRpt.ParameterFields.(something) should be a good starting point. That way you could create the reports with the ASP number of parameters, then dynamically add the extra parameter that VB needs in the VB itself just before you run it.

Regards

Marc Kozlowski
 
Thanks for your suggestions Marc, however I am already using the parameter array in VB....CrxRpt.Param(n) to pass the parameters.

Currently the report refers to a SQL Stored procedure that accepts 4 parameters(including the extra parameter @prmSource). These 4 parameters can subsequently be displayed or used in formulas.

If the stored procedure was altered to only accept the 3 parameters (minus @prmsource), then it is not possible to manipulate or display @prmSource even if it was passed by VB using CrxRpt.param(n)

I might be wrong though!
 
OK then. How about you design the report and the SQL Stored Procedure to have three parameters...

...then, add a 'vSource' variable in the report that defaults to 'Printed from ASP' or whatever the required legend is...

...then, in the calling VB code, use CrxRpt.SetReportVariableValue to populate the variable with 'Source: VB program' or whatever the alternative legend is.

In this way you are manipulating a report variable rather than a parameter, so the 3 parameters / 4 parameters issue goes away.

Any good?

Best regards

Marc
 
Thanks Marc, thats sounds ideal.

Only one small problem...do you know the VB syntax for SetReportVariableValue as I can't find much documentation on it?
 
Thanks Marc, thats sounds ideal.

Only one small problem...do you know the VB syntax for SetReportVariableValue as I can't find much documentation for it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top