| Once a report library grows to a certain size there is | | | | formula requires the developer to log on to the Report |
| always going be common formulas which are needed | | | | Server and so uses up a license. For those companies |
| again and again. Having ready access to them can | | | | with only five licenses, this could be a real problem, |
| save a vast amount of development time. | | | | especially as the Crystal Reports software has to be |
| My book started life as a notepad document which | | | | shut down and reopened to free the license. |
| was a list of 25-30 formulas I used a lot, or were so | | | | One final thing to be aware of, which struck me as |
| complicated I did not like the idea of rewriting them. | | | | odd, is that formulas saved as functions on the Report |
| This is fine for a solo consultant travelling from | | | | Server do not handle NULLS. This can make some |
| company to company, but for large teams of | | | | things just impossible to save in this manner. |
| permanent staff something more robust and | | | | How to Setup Functions |
| expansive is required. | | | | Write and save a formula, preferably something useful! |
| For those companies using a Business Objects reports | | | | Within the formula editor, select "Custom Function" |
| server (Enterprise, Edge etc) formulas can be saved in | | | | from the New File dropdown. |
| the repository just like a report and be accessible by | | | | Choose to "Use Extractor" and then select the |
| the whole team. | | | | previously written formula. |
| Even a solo developer can benefit from this approach | | | | Crystal Reports will create a Function based on the |
| as formulas can be added to a formula through this | | | | formula and replace any database fields with variables |
| method far quicker than copy / pasting from a | | | | to allow it's re-use with other values. |
| separate text file. There is also the added bonus to | | | | Rename the computer created variable names to |
| the business which gets to keep this knowledge once | | | | something meaningful. I advise using ctrl F and Find |
| the report developer leaves. | | | | & Replace to ensure all references to the variable |
| I'll end this article with a step by step instruction on how | | | | names are changed. |
| to setup and use this method of formula storage, but | | | | Upload to the Report Server, where the Function be |
| first I want to discuss some of the finer points of | | | | saved in the Repository Custom Functions folder. |
| implementation. | | | | Note the consistent naming pattern to the Functions in |
| One of the main strengths of this approach is the | | | | the illustration above. This is important for later use and |
| standardisation of report calculations, but this increases | | | | makes finding the correct Function a lot easier. |
| the importance of the formulas being right! This may | | | | Using Existing Functions |
| sound obvious, but a formula that is right for one report | | | | To use an existing Function is simple: |
| maybe not be for another. | | | | Open a new formula and expand the Repository |
| For example: a formula that calculates working hours | | | | Custom Functions. |
| based on a five day working week and 08:00 to 16:00 | | | | You may need to log on to the Report Server, then, |
| hours is going to be wrong for reporting on a team | | | | highlight the Function you want. |
| which works a half day on a Saturday. | | | | Click the cog icon with the red arrow pointing to it. |
| With this in mind, I strongly recommend that formulas | | | | Go back to the formula you just opened and notice |
| are double checked, tested and checked again before | | | | that the Functions Panel now has an additional folder |
| they are saved to the repository. Ideally, other team | | | | "Custom Functions" which contains the Function just |
| members should have an active role in the testing. | | | | created. |
| In a team of mixed abilities, an extensive library of | | | | Just double click the Function you want. |
| formulas can lower the required expertise for report | | | | Ok, that may sound a little convoluted when |
| writing and really boost productivity. | | | | approached as an end to end process, but once a |
| And, as the code is still visible, new report developers | | | | library of Functions builds up, accessing it as and when |
| can use it as a study guide to expand their own | | | | required becomes second nature and a genuine time |
| knowledge. | | | | saver. |
| Unfortunately, saving, or accessing a pre-saved | | | | |