ExcelReport : What's new with V1
This new version contains fixes, brings new features and is delivered with an example database
Fixes
- Issues due to incorrect case insensitive comparisons that raised Ole Automation errors.
- Issues with incorrect range definitions in the Excel model, throwing Ole automation error messages.
New features.
- The fillReportLine method of the ExcelReport object can receive a ViewEntry object as parameter, as well as a Document.
You can now use a ViewEntryCollection or a ViewNavigator instead of a view to fetch data.
To create a report from documents belonging to a single category, create a ViewEntryCollection with the getAllEntriesByKey method of your view and iterate through the ViewEntries.
To send column totals to an Excel report, create a ViewNavigator and send total rows to the fillReportLine method (the range names in the Excel model have to be column numbers and not item names). - All the values of multi-value fields can now be used in a report.
If the target cell is defined with auto wrap property (Excel cell format property), each value is displayed its own line in the same cell. Otherwise, values are displayed on the same line, separated by spaces. - Carriage return inside field values are automatically removed and replaced by a blank character.
In the preceding version, they appeared as little square characters in the Excel report. - Before rendering the report, in display, print or save mode, a calculate command is sent to Excel.
The model can be defined with a manual calculation mode, avoiding the computation of calculated cells after each insert.
When many lines are inserted in a report, there is a huge performance shift. - The saveAs method is now a function instead of a sub.
A true return value indicates that the save has been completed.
If the save fails, a property (lastError) allows to read the error message (unfortunately, its only a generic error code corresponding to OLE Automation Error.
Example Database
The ExcelReport library is delivered with a Notes Database hosting several examples of use, including an invoicing agent, and an Excel graphic.
The database allows also the use of ExcelReport without any programming.
All you have to do is designing the Excel model, and recording the necessary parameters in a document, then click a button to produce the report.
Compatibility with the preceding version
The signature of the ExcelReport class is changing with this new version. Replacement of the old library by the new one implies a new compilation of the calling script.
The new library is named ExcelReport_1. To use it instead of the old version, you have to change the use directive in the calling object, and this will force a fresh compilation and avoid run time problems.
The class name remains the same, so changing the use directive is the only mandatory change to your code.
The use of new functionalities can imply some other changes.