Thierry Seunevel Thierry 
Seunevel 
 Tech Corner       
  Home   Missions Tech corner Download Resume Contact
Home > Tech Corner > Excel Report

ExcelReport : Using Excel to print from Lotus Notes (4)

. Principle
. 1st example
. Excel Model
. ExcelReport
. More
. New with V1
The ExcelReport class
The Lotusscript library ExcelReport_1 comprises only the declarations section which contains the class definition for the ExcelReport Object.

This object is visible by the outside world through the properties and methods that define its public interface.

This interface is described here. The examples shown in the Parameters column are given assuming an objet name of report (declared as : Dim report as ExcelReport).
The new features are shown in dark red.
Methods Parameters Comment
New set report = new ExcelReport(String) Instanciate a new object of type ExcelReport, named report, using the path and file name passed in the parameter value as model file
LineField report.LineField = String Settable property defining the report line range. This property defaults to REPORTLINE. The special value *NONE must be specified for a model used only in page mode.
RangeValue variant = report.RangeValue(String) Gettable property allowing to read from Notes the content of an Excel named cell.
RangeNames variant = report.RangeNames Gettable property returning the list of names defined in the model.
This list can be used to find out what Notes documents are necessary to fill the cells of the report.
Sheet report.Sheet= String This settable property allows the definition of the current sheet in a multi-sheets worksheet. This property defaults to the name of the first sheet in the model.
initHeader report.initHeader NotesDocument Processes the data exchange in page mode between the Notes document given in parameter and the named cells in the Excel report.
This method can be called several time with different Notes documents.
fillReportLine integer = report.fillReportLine (variant) Inserts a new line in the report, and fill the columns defined in the LineField range with the values found in the Notes document or the NotesViewEntry sent as parameter for the matching field names or column numbers. If the view row is a total row, only column numbers (vColx or aColx) can be used..
Returns a count of the number of calls.
printOut report.printOut Printing of the current sheet of the Excel report, without display of the print dialog box.
preView report.preView Display the Excel preview of the current Excel report
From this display you can go from page to page and print the report.
insertPgBreak report.insertPgBreak Asks for the insert of a page break before the last line added by the fillReportLine method.
saveAs integer = report.saveAs (String) Saves the current Excel report under the path and file name given in parameter.
If a file of the same name already exists in this location, a dialog box is displayed and allows to override the old file, or cancel the operation.
In this version, saveAs is a function returning true or false according to the success of the saving.
The call can be left unchanged in existing code.
closeReport report.closeReport Explicit close of the Excel report.
This method is called automatically when needed, so its explicit call is optionnal.
If the Excel model is defined with calculation in manual mode, an explicit call has to be used before the import of named cell values.
delete delete report Explicit call of the delete function on the ExcelReport object.
This call is optionnal. Use it if you experience OLE issues, locking of the model file ...
lastError string = report.lastError If a save call returns false, this function gives the text or the error message.
Generally, this text doesn't help very much because it is an OLE error message.
To view the source code of the class, download the database and open it with the Notes designer or follow this link.

    Top  Top  Previous  Excel Model | More..  Next


©  Thierry Seunevel (2004) www.seusoft.com