|
Although the Excel export is not WYSIWYG, there are several things you can do to control the results. After you dimension the export object's variable, but before you export the report, you can set any of the following properties: - AutoRowHeight (boolean) When set to true, Excel will correct for the size of the row by resizing the row to the largest object in it.
- DisplayGridLines (boolean) Controls whether grid lines will display.
- FileFormat Can be set to Xls95 or Xls97Plus
- MinColumnWidth (float) Specifies in inches how small columns can be in the Excel document. Larger values reduce the number of columns in a sheet.
- MinRowHeight (float) Specifies in inches how small rows can be in the exported file. Larger values force the export to place more controls on a single line.
- MultiSheet (boolean) Determines whether the report will be generated as a single Excel sheet, or as a multiple sheet workbook. If set to true, each page in the report will be placed on its own Excel sheet.
- RemoveVerticalSpace (boolean) Determines whether the exported report outputs runs of vertical empty spaces, or if they are eliminated.
- UseCellMerging (boolean) When set to true, causes multiline textboxes to be exported as a single cell.
Example
[C#] DataDynamics.ActiveReports.Export.Xls.XlsExport x = new DataDynamics.ActiveReports.Export.Xls.ExcelExport(); x.MinRowHeight=1; x.MultiSheet=true; x.RemoveVerticalSpace=true; x.UseCellMerging=false; x.MinColumnWidth=1; x.FileFormat=DataDynamics.ActiveReports.Export.Xls.FileFormat.Xls95; x.AutoRowHeight=true; x.DisplayGridLines=true; x.Export(this.viewer1.Document, Application.StartupPath + \\YourReport.xls);
[Visual Basic] Dim x As New DataDynamics.ActiveReports.Export.Xls.XlsExport() x.AutoRowHeight = True x.DisplayGridLines = True x.FileFormat = DataDynamics.ActiveReports.Export.Xls.FileFormat.Xls95 x.MinColumnWidth = 1 x.MinRowHeight = 1 x.MultiSheet = True x.RemoveVerticalSpace = True x.UseCellMerging = True x.Export(Me.Viewer1.Document, Application.StartupPath + "\\YourReport.xls")
|