|
|||||||||
|
Crystal Reports Tools: Improve Performance While Saving Time and Money |
|
Crystal Reports: IIF Function Isn't IF
IIF does not behave like the IF function Conditional formulas with the If..then.. else control structure have been widely used in Crystal for many versions now. Excel experts will also be familiar with the IF() function they use there to apply similar logic and they might discover the IIF function looks like it does the same thing. But it doesn’t. IF {table.field2} = 0 then 0 else {table.field1} / {table.field2} IIF ({table.field2} = 0 , 0 , {table.field1} / {table.field2}) Do NOT do the same things. Because the IIF function is a FUNCTION it has to calculate both arguments before it decides which one to select. So if field2 is zero, the formula will fail with an error. The division part of the IIF is always calculated so you can’t use an IIF to avoid a divide by zero error. In a similar way, if either argument of the IIF is used to accumulate a variable then it will ALWAYS accumulate the variable. Use the IF THEN ELSE control structure to calculate the results correctly. Remember, IIF is a function. IF is a conditional statement.
While we're on the topic of functions, consider using User Function Libraries to add great functionality to your Crystal Reports system. User Function Libraries are used inside a formula to add calculations that are not otherwise available. They show up as Functions in your Formula Editor and extra functions are usually displayed under Additional Functions. We have developed some interesting functions, and there are some others available from Business Objects and other 3rd party developers. User Function Libraries first appeared in Crystal Reports 5, and were a DLL that was installed in the Windows\Crystal folder. This folder continues to work for all subsequent versions of Crystal Reports. You can also install them in the Crystal Program folder. This varies from version to version since version 9.0. Crystal Reports 2008 installs into C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 Some great UFLsBelow is a listing of some very useful UFLs. Click the link or associated image for pricing and information on each one.
Intrigued? Here's some info on the GRID UFL. Export structured data to Excel or another application, the
smart way. Grid UFL provides you the proper control of your Crystal Reports
Export. The ability to export your reports to another application or format is
one of the really useful features of Crystal Reports. But when you do this, you
run into the limitations of both Crystal Reports and the other application. Grid
UFL helps you overcome those limitations.
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. |