|
|
|||
Home Products Downloads Registered users Support Prices Order Primary Subscription |
|
||
Other featuresIn addition to range options and column options, Active XL Report processes several sheet options and report options. The first ones have an influence upon a worksheet, and the second, accordingly, on a report. Both are used to automate getting the optimal height and width for cells, scaling to the installed printer, hiding some worksheets, and protecting them from changes. Sheet optionsWhere? form: frmOther1; template: Other1.xls You need to specify the sheet options in the A2 cell of a given worksheet. When processing every worksheet of the template, Active XL Report checks that cell's value. When Active XL Report recognizes any options, it takes some additional actions. Here they are:
Note The A2 cell will be cleared only if it contains any Active XL Report options. So you can use this cell for your own needs. This rule also refers to the A1 cell that contains report options. Some Active XL Report users, knowing that report options can be specified on any worksheet, create a hidden worksheet with report options. Report optionsWhere? form: frmOther2; template: Other2.xls Report options should be placed in the A1 cell of any worksheet (or worksheets - in this case all the options supplied will count) of a template workbook. While processing every worksheet of a template, Active XL Report checks this cell. When Active XL Report recognizes any options it takes some additional actions. Here is the options list:
Add a report to an existing workbookWhere? form: frmOther3; template: Other3.xls+ExistingBook.xls Active XL Report allows you to add a report to an existing workbook with the ReportTo method. The syntax is:
Sub ReportTo(WorkbookName As String, [AArray])
Where WorkbookName is the path and filename of an existing workbook. Active XL Report creates a report going through usual chain of methods, and adds all non-hidden worksheets of the report workbook to the workbook specified. The OnlyValues option will be applied to every worksheet added. And more, all names referencing the worksheet added will be destroyed. The report worksheets are added after the last existing worksheet. xlrDemo example adds the Sheet1 worksheet to the ExistingWorkbook.xls. If the Sheet1 worksheet already exists in the target workbook the added worksheet will be renamed according to Excel naming convention. Thus Sheet1 will become Report parametersWhere? form: frmUnboundData1; template: UnboundData1.xls It is easy: 1) use the Add method of the Params property of XLReport object to create a parameter, name it, and define its value; 2) use the parameter in a template as if it is a field of a NoRange-datasource whose name is fixed - XLRParams. For instance, if you create the StartDate parameter and use the XLRParams_StartDate field formula in a cell of a template then the formula will be substituted with the parameter's value. Unbound dataWhere? form: frmUnboundData2; template: UnboundData2.xls The use of parameters will not help you to transfer a lot of data to a report. In order to transfer large volumes of data Active XL Report uses the similarity between 2D arrays and data sets: rows in array are similar to records in a data set, and columns are similar to fields. This idea is implemented in two mechanisms of unbound data transfer. The first one allows you transferring your data all at once, while the second one allows transferring portions of data - "records". In both cases, data are transferred in a variant array: in the first case - in a 2D array including two additional rows with "field" names and types; in the second case - in a 1D array containing the current "record". In the second case "field" names and types become known to Active XL Report through the use of GetDatasetInfo event, while "records" are formed in the GetRecord event. Just pass the array of the above specified contents to the Report (ReportTo) method Active XL Report in order to use the first method. Be sure to set the DatasetType to xlrUnboundDataset. In order to use the second mechanism of unbound data transfer, leave the Dataset property and/or the corresponding item in the array - the parameter of the Report (ReportTo) method - empty. Active XL Report, having found that DatasetType is xlrUnboundDataset and the Dataset property is empty, will generate the GetDatasetInfo event and, having understood the dataset structure, will start to generate GetRecord events informing you about the required record number in the RecNo input parameter (it starts from 1). When you transfer all data, pass True (-1) in the Eof output parameter. The "field" types for xlrUnboundDataset are defined in the DataTypes enumeration that can found in the Object Browser. The types are: xlrInteger, xlrFloat, xlrString, xlrBoolean, xlrDateTime, and xlrNotSupported. And these types are Excel types. Except for xlrNotSupported: fields and "fields" of type xlrNotSupported are not transferred to a report. Time to look back - other featuresPlease remember that:
|
Components
Data Access methods
Excel version supportedMS Excel 97 (SR2)
[ Download it ] |