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!

WhilePrintingRecords, WhileReadingRecords....What's the difference?

Status
Not open for further replies.

Digitalcandy

IS-IT--Management
May 15, 2003
230
US
Can someone briefly explain the difference between the two. The only difference I know of is that I could not do summaries off of WhileReadingRecords formulas.
 
WhileReadingRecords is processed in the first pass of the report - basically telling Crystal to execute the formula before it starts performing any calculations.

WhilePrintingRecords processes in the second pass, meaning while the database records are being written out in the report. Normally useful, as you need summary options to be done after they have read and processed the components of their summing activity.

You can source definitive descriptions from your Crystal Reports F1 help.

Naith
 
WhileReadingRecords and BeforeReadingRecords are rarely used in Crystal report writing in my experience.

In theory the BeforeReadingRecords evaluates a formula before the data is gathered....WhileReadingRecords by its name evaluates a formula as it reads the data???? how it does that is beyond me frankly. I have tried BeforeReadingRecords once or twice but never really got anything to work properly.

WhilePrintingRecords evaluates formulas at the time of printing the report and is very useful...while you will get some argument here about its value, I am a supporter of its constant use in formulas with the following exceptions:

1. Record selection formulas....for obvious reasons this is not valid
2. Formulas that do summary operations ... summing, averaging, min, max .... these are done before printing the report and you cannot use WhilePrintingRecords here
3. Formulas which are created for sorting or grouping purposes...again because these operations are required before the printing takes place.

BUT all other formulas including conditional formulas should have WhilePrintingRecords added....Why?

Without this function, you leave it up to Crystal to decide when to evaluate the formula....sometimes, especially if there are a lot of formulas in the report, Crystal does not evaluate the formula at the proper time, resulting in bad reported data.

By adding this function you FORCE Crystal to do the evaluation at the proper time.

With the exception of the previously mentioned formula types, it never hurts to add WhilePrintingRecords to your formulas and by doing so it often helps the timing of the formulas.

Jim Broadbent
 
Ngolem and Naith, thanks for the respones. Ngolem, I'm a little confused as I am doing Grand Totals on a formula that is using WhilePrintingRecords function. According to your number 2 rule this can't happen.
 
It depends on how you are doing your totals...If it is a manual total it is no problem...but if it were a summary total I think there would be....You would not have the option to do a "Insert Grand Total" when you right-click on the field

This is one of the reasons I stick to manual totals...there isn't that limitation

Jim Broadbent
 
Yes...Chelseatech...but that isn't a hard and fast rule since you are limited to formulas that are not used in Grouping/sorting/or record selection...you can still use global variables in those formulas.

Digitalcandy - to add to my comment to you - You can have summary functions within a formula that has "WhilePrintingRecords" .... you just cannot make THAT formula a summary formula itself.



Jim Broadbent
 
Hello,

Though my query is not directly linked to what you people are discussing but still it has a link.

Can anyone of you tell me that these 'WhileReadingRecords/WhilePrintingRecords' have any effect on Maps in CR8? Or any link with the displaying of these maps in ASP pages?

thanks...haq
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top