diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md index 662bde63a4..49b724b06a 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md @@ -2,7 +2,7 @@ Introduction to use the specialist user properties of the PdfEmitter. ## Reason -The PdfEmitter provides a set of specialist user properties to optimize the excel output according of the reporting based requirements. +The PdfEmitter provides a set of specialist user properties to optimize the pdf output according of the reporting based requirements. Each of the user properties starts with the master prefix "PdfEmitter". @@ -42,7 +42,7 @@ The following list get an overview of all supported user properties, the content Content define the pdf conformance of the created pdf document, e.g. PDF.A1A Location report Data type string - Values conformance values: PDF.Standard, PDF.X1A2001, PDF.X32002, PDF.A1A, PDF.A1B + Values PDF.Standard, PDF.X1A2001, PDF.X32002, PDF.A1A, PDF.A1B Default PDF.Standard Reference see PdfEmitter.IccColorType, PdfEmitter.IccProfileFile, PdfEmitter.PDFA.AddDocumentTitle, PdfEmitter.PDFA.FallbackFont diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java index 808d4b0117..b01ba1e46d 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/ExcelEmitter.java @@ -157,6 +157,30 @@ public abstract class ExcelEmitter implements IContentEmitter { /** property: ExcelEmitter.ForceRecalculation */ public static final String FORCE_RECALCULATION = "ExcelEmitter.ForceRecalculation"; + /** property: ExcelEmitter.PrintGridlines */ + public static final String PRINTGRIDLINES_PROP = "ExcelEmitter.PrintGridlines"; + + /** property: ExcelEmitter.PrintRowColHeadings */ + public static final String PRINTROWCOLHEADINGS_PROP = "ExcelEmitter.PrintRowColHeadings"; + + /** property: ExcelEmitter.PrintFitToPage */ + public static final String PRINTFITTOPAGE_PROP = "ExcelEmitter.PrintFitToPage"; + + /** property: ExcelEmitter.DisplaySheetZoom */ + public static final String DISPLAY_SHEET_ZOOM = "ExcelEmitter.DisplaySheetZoom"; + + /** property: minimum zoom value of excel sheet */ + public static final short poiExcelDisplaySheetZoomScaleMin = 10; + + /** property: maximum zoom value of excel sheet */ + public static final short poiExcelDisplaySheetZoomScaleMax = 400; + + /** property: minimum scale of the excel print out */ + public static final short poiExcelPrintScaleMin = 10; + + /** property: maximum scale of the excel print out */ + public static final short poiExcelPrintScaleMax = 400; + /** * Logger. */ diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/README.md b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/README.md index 5a257a3083..58b21f3d0e 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/README.md +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/README.md @@ -20,6 +20,7 @@ The following list get an overview of all supported user properties, the content false, disabled debug log Default false + **ExcelEmitter.RemoveBlankRows** Content handling of blank rows @@ -96,7 +97,7 @@ The following list get an overview of all supported user properties, the content Content define the number format of a numeric value for excel Location text-element of cell Data type string - Values custom format which should be used to display the value on excel, e.g. "#,#00.00" + Values custom format which should be used to display the value on excel, e.g. "#,#00.00" the format use the form of the excel-defined forms (language version: en) Default empty (null) @@ -123,7 +124,7 @@ The following list get an overview of all supported user properties, the content Location report, table Data type boolean Values true, a summary row is inserted below the detailed data being summarized and a new outline level is established on that row - false, a summary row is inserted above the detailed data being summarized and a new outline levelis established on that row. + false, a summary row is inserted above the detailed data being summarized and a new outline level is established on that row. Default false **ExcelEmitter.FreezePanes** @@ -263,3 +264,38 @@ The following list get an overview of all supported user properties, the content Values true, activate the recalculation option false, no recalculation Default false + +**ExcelEmitter.PrintGridlines** + + Content activate the print out of the grind lines + Location page, table, list + Data type boolean + Values true, activate grid line print out + false, without grid line print out + Default false + +**ExcelEmitter.PrintRowColHeadings** + + Content activate the print out of the row and column heading labels + Location page, table, list + Data type boolean + Values true, activate print out of the row and column heading labels + false, without print out of the row and column heading labels + Default false + +**ExcelEmitter.PrintFitToPage** + + Content the page will be fit to center of the print out + Location page, table, list + Data type boolean + Values true, fit the page to center + false, no fitting of the page + Default false + +**ExcelEmitter.DisplaySheetZoom** + + Content define the used scaling for the sheet zoom + Location page, table, list + Data type number, integer + Values the zoom value must be -1 (= off) or between 10 and 400 + Default -1 diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealListHandler.java b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealListHandler.java index 6d7cc35815..96d7e3b648 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealListHandler.java +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealListHandler.java @@ -2,13 +2,13 @@ * Copyright (c) 2011, 2012, 2013 James Talbut. * jim-emitters@spudsoft.co.uk * - * + * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * https://www.eclipse.org/legal/epl-2.0/. - * + * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * James Talbut - Initial implementation. ************************************************************************************/ @@ -130,6 +130,22 @@ public void endList(HandlerState state, IListContent list) throws BirtException if (!EmitterServices.booleanOption(state.getRenderOptions(), list, ExcelEmitter.DISPLAYZEROS_PROP, true)) { state.currentSheet.setDisplayZeros(false); } + if (EmitterServices.booleanOption(state.getRenderOptions(), list, ExcelEmitter.PRINTGRIDLINES_PROP, false)) { + state.currentSheet.setPrintGridlines(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), list, ExcelEmitter.PRINTROWCOLHEADINGS_PROP, + false)) { + state.currentSheet.setPrintRowAndColumnHeadings(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), list, ExcelEmitter.PRINTFITTOPAGE_PROP, false)) { + state.currentSheet.setFitToPage(true); + } + int displayZoom = EmitterServices.integerOption(state.getRenderOptions(), list, + ExcelEmitter.DISPLAY_SHEET_ZOOM, -1); + if ((displayZoom >= ExcelEmitter.poiExcelDisplaySheetZoomScaleMin) + && (displayZoom <= ExcelEmitter.poiExcelDisplaySheetZoomScaleMax)) { + state.currentSheet.setZoom(displayZoom); + } } @Override diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealTableHandler.java b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealTableHandler.java index 3952e2da9c..6b6233137a 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealTableHandler.java +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/AbstractRealTableHandler.java @@ -169,7 +169,7 @@ public void endTable(HandlerState state, ITableContent table) throws BirtExcepti if (calcWidth > 1.0) { state.currentSheet.autoSizeColumn(col, true); calcWidth = state.currentSheet.getColumnWidth(col) * 1.15; // offset to handle width differences of apache poi - int maxColumnWidth = 255 * 256; // The maximum column width for an individual cell is 255 + int maxColumnWidth = 255 * 256; // The maximum column width for an individual cell is 255 // characters if (calcWidth > maxColumnWidth) { calcWidth = maxColumnWidth; @@ -202,6 +202,24 @@ public void endTable(HandlerState state, ITableContent table) throws BirtExcepti if (!EmitterServices.booleanOption(state.getRenderOptions(), table, ExcelEmitter.DISPLAYZEROS_PROP, true)) { state.currentSheet.setDisplayZeros(false); } + if (!EmitterServices.booleanOption(state.getRenderOptions(), table, ExcelEmitter.DISPLAYROWCOLHEADINGS_PROP, + true)) { + state.currentSheet.setDisplayRowColHeadings(false); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), table, ExcelEmitter.PRINTGRIDLINES_PROP, false)) { + state.currentSheet.setPrintGridlines(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), table, ExcelEmitter.PRINTROWCOLHEADINGS_PROP, false)) { + state.currentSheet.setPrintRowAndColumnHeadings(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), table, ExcelEmitter.PRINTFITTOPAGE_PROP, false)) { + state.currentSheet.setFitToPage(true); + } + int displayZoom = EmitterServices.integerOption(state.getRenderOptions(), table, + ExcelEmitter.DISPLAY_SHEET_ZOOM, -1); + if ((displayZoom >= ExcelEmitter.poiExcelDisplaySheetZoomScaleMin) && (displayZoom <= ExcelEmitter.poiExcelDisplaySheetZoomScaleMax)) { + state.currentSheet.setZoom(displayZoom); + } } @Override diff --git a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/PageHandler.java b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/PageHandler.java index dbd240bddc..f91760bd22 100644 --- a/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/PageHandler.java +++ b/engine/uk.co.spudsoft.birt.emitters.excel/src/uk/co/spudsoft/birt/emitters/excel/handlers/PageHandler.java @@ -59,9 +59,6 @@ */ public class PageHandler extends AbstractHandler { - private final static short poiExcelPrintScaleMin = 10; - private final static short poiExcelPrintScaleMax = 400; - /** * Constructor * @@ -176,6 +173,22 @@ public void startPage(HandlerState state, IPageContent page) throws BirtExceptio if (!EmitterServices.booleanOption(state.getRenderOptions(), page, ExcelEmitter.DISPLAYZEROS_PROP, true)) { state.currentSheet.setDisplayZeros(false); } + if (EmitterServices.booleanOption(state.getRenderOptions(), page, ExcelEmitter.PRINTGRIDLINES_PROP, false)) { + state.currentSheet.setPrintGridlines(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), page, ExcelEmitter.PRINTROWCOLHEADINGS_PROP, + false)) { + state.currentSheet.setPrintRowAndColumnHeadings(true); + } + if (EmitterServices.booleanOption(state.getRenderOptions(), page, ExcelEmitter.PRINTFITTOPAGE_PROP, false)) { + state.currentSheet.setFitToPage(true); + } + int displayZoom = EmitterServices.integerOption(state.getRenderOptions(), page, + ExcelEmitter.DISPLAY_SHEET_ZOOM, -1); + if ((displayZoom >= ExcelEmitter.poiExcelDisplaySheetZoomScaleMin) + && (displayZoom <= ExcelEmitter.poiExcelDisplaySheetZoomScaleMax)) { + state.currentSheet.setZoom(displayZoom); + } int pagesHigh = EmitterServices.integerOption(state.getRenderOptions(), page, ExcelEmitter.PRINT_PAGES_HIGH, -1); if ((pagesHigh > 0) && (pagesHigh < Short.MAX_VALUE)) { @@ -189,7 +202,7 @@ public void startPage(HandlerState state, IPageContent page) throws BirtExceptio state.currentSheet.setAutobreaks(true); } int printScale = EmitterServices.integerOption(state.getRenderOptions(), page, ExcelEmitter.PRINT_SCALE, -1); - if ((printScale >= poiExcelPrintScaleMin) && (printScale <= poiExcelPrintScaleMax)) { + if ((printScale >= ExcelEmitter.poiExcelPrintScaleMin) && (printScale <= ExcelEmitter.poiExcelPrintScaleMax)) { state.currentSheet.getPrintSetup().setScale((short) printScale); }