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

Pre-Execution Formula

Status
Not open for further replies.

jakecolman

IS-IT--Management
Apr 2, 2006
54
US
Is there a way to specify a formula to be executed before the report actually does anything? I would like to use this formula to validate the report parameters (e.g., field 2 must not have a value greater than field 1) and to display an error message if the parameters are not valid.

Thanks!

...Jake
 
Not that I know of.

You can make adjustments to what was entered, but you didn't post anything technical, such as the type of parameters, your software version, database used...

One means is to adjust the parameter value if it isn't greater than another, or you might use the built in range types, which will do this itself to some degree.

Here's an example record selection:

(
if {?My2ndParm} >= {?My1stParm} then
{table.field} in {?My1stParm} to {?My2ndParm}
else
if {?My2ndParm} < {?My1stParm} then
true
)

This would ignore the parameters if the second is less than the first, and you could make other adjustments.

-k
 
I am using Business Objects XI. I don't need to adjust my parameters (which are date fields); I need to do a sanity check on them. For example, The 'Trade Date' must be specified as earlier than 'Settle Date'. Currently, if they enter the wrong date values the database will simply not return any data. My users want a sanity check done so that I can let them know that the date values they entered are incorrect. This way they won't be wondering why they did not get any results.
 
MSBrady,

Where would I include this formual on the report? And how can I display an appropriate error message and stop execution if the parameters do not pass my sanity check?

Thanks!

...Jake
 
I would try the record selection area as K pointed out.
 
Crystal doesn't really allow for this, you can make a date range, and if the second date is earlier than the first, it will prompt.

Otehrwise you need to understand that Crystal isn't a development language, rather a banded report writer with buzzers and whistles.

To accomplish what you want you'd need to write external code and pass the parameters to Crystal.

I'd opt for hiring smarter users, in lieu of that, display the parameters chosen on the report so that they realize THEIR error and then can rerun the report.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top