Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
Report Analyzer
cViewSERVER
ReCrystallize
 

Buy Crystal Reports


Articles:
Administration
Advanced
Basic
Crystal eNL
Database
Financial
Problems Solved

Books:
CR Books

Database Books
Developer Books

 
Tools:
All CR Tools
CR Analyzers
CR Bestsellers
DataBase Tools
CR Graphics
International
CR Mail UFLs
ReCrystallizePro
CR Schedulers
CR UFLs
CR Viewers


Add'l:

About us

Contact Us
cViewSUITE Ppt
Support

CR trial
 

Crystal Reports
on Steroids

Crystal Reports: Use the Share UFL to Carry a Balance Forward

The user has a report that asks for an opening balance, and then displays and accumulates selected records to calculate the closing balance to use in next month’s report. Could we use the Share User Function Library to make this a more seamless process?

The first task was to calculate a unique identifier for each month to label the value we want to store. As the balances were accumulated monthly, we calculated this as:

“Bal-“ + ToText(CurrrentDate,”yyyy-MM”)

We also need an identifier to pick up the previous month’s value. This uses the Date Range “LastFullMonth”

and a minimum of that date range to pick up the first day of the previous month. The formula is:

"Bal-" + ToText(Minimum(LastFullMonth),"yyyy-MM")

At the start of the report we need to retrieve the previous month value. This doesn’t need an evaluation time as it can be even be done BeforeReadingRecords. With the default evaluation time of WhileReadingRecords, this formula can be used in other formulas and accumulated in a summary.

Val(ShareTagFetch ("c:\Bal.xml",{@Last Month ID}))

In the report footer section you need to formula to save the balance for the next month run of the report.

WhilePrintingRecords;

ShareTagStore ("c:\Bal.xml", {@This Month ID}, ToText(Sum({table.field})))

While it would be possible to use a parameter to enter the opening balance, using this approach reduces the chance of user error. The XML file will contain the values for each month and a report can be rerun for any prior period with the correct opening balance.

See the Share User Function Library here.

 

 

This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects.