Class ReportXlsxExporter
Writes a paginated report to a SpreadsheetML workbook.
public static class ReportXlsxExporter
- Inheritance
-
ReportXlsxExporter
- Inherited Members
Remarks
This is the sixth consumer of one page model. The PDF and the page images, the
HTML projection, the Word document, the CSV, the plain text and this workbook all read the
same ReportPageModel, so none of them can paginate differently from the others.
OnePageModelDrivesEveryOutputTests asserts it.
A spreadsheet stores values, so this export carries values. A textbox whose RawValue is a number becomes a numeric cell with the report's format translated into an Excel format code — it displays as the report displays it and it sums. Writing the formatted string instead would produce a workbook that looks right and totals to zero, which is the single most common defect in report-to-Excel exports and the reason the page model was widened rather than worked around.
The grid is recovered, not read. A report positions items absolutely; a worksheet is a grid. Rows come from DocWright.Reporting.Export.Band — the same reconstruction the Word export uses — and columns from the distinct vertical edges of every item, so each item spans a whole number of cells and no cell is asked to hold two items.
Methods
- Export(ReportPageModel, FontEngine, Stream, ReportXlsxExportOptions?)
Exports a paginated report to a stream as a workbook.
- ToWorkbook(ReportPageModel, FontEngine)
Builds the workbook a report exports to, without writing it.
- ToWorkbook(ReportPageModel, FontEngine, ReportXlsxExportOptions?)
Builds the workbook a report exports to, without writing it.