crystal reports viewers, crystal reports schedulers, view crystal reports, report analyzers, burst reporting, report scheduler
 
view crystal reports, rpt viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler
desktop viewer, crystal reports viewers, crystal reports schedulers, report analyzers, burst reporting, report scheduler

Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
Report Analyzer
cViewSERVER
ReCrystallize
 


Articles:
Administration
Advanced
Basic
Crystal eNL
Database
Financial
Problems Solved

Books:
CR Books

Database Books
Developer Books

 
Tools:
Analyzers
Bestsellers

CR Schedulers
CR UFLs
CR Viewers
DataBase Tools
Graphics
International
Mail UFLs
ReCrystallizePro


Add'l:

About us

Contact Us
cViewSUITE Ppt
Support

 

CrystalReports
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.

 

Other Uses for the SHARE UFL

How often have you wanted to take a value from one report and use it in a second report? Now you can.

  • Use the ShareTagSave function in one report to save the data in a "Share File".
  • Then in another report use the ShareTagFetch to use that value in your new report.

A couple of neat tricks:

  1. The Share UFL can vastly improve Crystal Reports performance. For example, when using a subreport in the details section to calculate a summary from a large transaction table for the product in that section, the Share UFL can let you run the subreport only once instead of several thousand times.
  2. When you need to carry a balance forward from one Crystal Report to another, the Share UFL enables you to do that.

And, there are many more ways to use the Share UFL to put your Crystal Reports system on steroids.

Share data values between Crystal Reports with Share UFL

We have received requests in the past asking how to use value from one report in a second report. The usual answer is to repeat the database processing in a subreport inside the second report. This is highly inefficient of course, and hits major limitations if there are values needed from more than one report in a later report.

Another solution to this is to calculate the totals in some summary tables, and use them there. That's fine if SQL functions will do what you want, but the values could be more complex than some simple SQL functions.

In the past, we made this possible via using our Disk Output Library and Text Lookup User Function Library: write the values to a disk file using the DiskLinesEntry function, and retrieve it with the TextLookupCell function.

We decided to combine these into an easy-to-use User Function Library that you can access under "Functions" in your Formula Explorer. The result is the Share UFL. To use this powerful tool, you create a Share file and a tag for the value you want to save with the ShareTagStore function:

WhilePrintingRecords; ShareTagStore(c:\Reports\Data\Finance.xml,
Balance, ToText(Sum({Table.Amount}));

Retrieve the value in another report with:

WhilePrintingRecords;
ShareTagFetch(c:\Reports\Data\Finance.xml,Balance)

You can use multiple Share files in one report, and in the full version up to 1000 different tags for the values you want to save.