Esempio n. 1
0
        public XSSFPrintSetup(CT_Worksheet worksheet)
        {
            this.ctWorksheet = worksheet;

            if (ctWorksheet.IsSetPageSetup())
            {
                this.pageSetup = ctWorksheet.pageSetup;
            }
            else
            {
                this.pageSetup = ctWorksheet.AddNewPageSetup();
            }
            if (ctWorksheet.IsSetPageMargins())
            {
                this.pageMargins = ctWorksheet.pageMargins;
            }
            else
            {
                this.pageMargins = ctWorksheet.AddNewPageMargins();
            }
        }
Esempio n. 2
0
 public CT_PageSetup AddNewPageSetup()
 {
     this.pageSetupField = new CT_PageSetup();
     return this.pageSetupField;
 }
Esempio n. 3
0
 public static CT_PageSetup Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_PageSetup ctObj = new CT_PageSetup();
     ctObj.paperSize = XmlHelper.ReadUInt(node.Attributes["paperSize"]);
     ctObj.scale = XmlHelper.ReadUInt(node.Attributes["scale"]);
     ctObj.firstPageNumber = XmlHelper.ReadUInt(node.Attributes["firstPageNumber"]);
     ctObj.fitToWidth = XmlHelper.ReadUInt(node.Attributes["fitToWidth"]);
     ctObj.fitToHeight = XmlHelper.ReadUInt(node.Attributes["fitToHeight"]);
     if (node.Attributes["pageOrder"] != null)
         ctObj.pageOrder = (ST_PageOrder)Enum.Parse(typeof(ST_PageOrder), node.Attributes["pageOrder"].Value);
     if (node.Attributes["orientation"] != null)
         ctObj.orientation = (ST_Orientation)Enum.Parse(typeof(ST_Orientation), node.Attributes["orientation"].Value);
     if (node.Attributes["usePrinterDefaults"] == null)
         ctObj.usePrinterDefaults = true;
     else
         ctObj.usePrinterDefaults = XmlHelper.ReadBool(node.Attributes["usePrinterDefaults"]);
     ctObj.blackAndWhite = XmlHelper.ReadBool(node.Attributes["blackAndWhite"]);
     ctObj.draft = XmlHelper.ReadBool(node.Attributes["draft"]);
     if (node.Attributes["cellComments"] != null)
         ctObj.cellComments = (ST_CellComments)Enum.Parse(typeof(ST_CellComments), node.Attributes["cellComments"].Value);
     ctObj.useFirstPageNumber = XmlHelper.ReadBool(node.Attributes["useFirstPageNumber"]);
     if (node.Attributes["errors"] != null)
         ctObj.errors = (ST_PrintError)Enum.Parse(typeof(ST_PrintError), node.Attributes["errors"].Value);
     ctObj.horizontalDpi = XmlHelper.ReadUInt(node.Attributes["horizontalDpi"]);
     ctObj.verticalDpi = XmlHelper.ReadUInt(node.Attributes["verticalDpi"]);
     ctObj.copies = XmlHelper.ReadUInt(node.Attributes["copies"]);
     ctObj.id = XmlHelper.ReadString(node.Attributes["id", PackageNamespaces.SCHEMA_RELATIONSHIPS]);
     return ctObj;
 }
Esempio n. 4
0
 public CT_Macrosheet()
 {
     this.extLstField = new CT_ExtensionList();
     this.oleObjectsField = new List<CT_OleObject>();
     this.pictureField = new CT_SheetBackgroundPicture();
     this.legacyDrawingHFField = new CT_LegacyDrawing();
     this.legacyDrawingField = new CT_LegacyDrawing();
     this.drawingField = new CT_Drawing();
     this.customPropertiesField = new List<CT_CustomProperty>();
     this.colBreaksField = new CT_PageBreak();
     this.rowBreaksField = new CT_PageBreak();
     this.headerFooterField = new CT_HeaderFooter();
     this.pageSetupField = new CT_PageSetup();
     this.pageMarginsField = new CT_PageMargins();
     this.printOptionsField = new CT_PrintOptions();
     this.conditionalFormattingField = new List<CT_ConditionalFormatting>();
     this.phoneticPrField = new CT_PhoneticPr();
     this.customSheetViewsField = new List<CT_CustomSheetView>();
     this.dataConsolidateField = new CT_DataConsolidate();
     this.sortStateField = new CT_SortState();
     this.autoFilterField = new CT_AutoFilter();
     this.sheetProtectionField = new CT_SheetProtection();
     this.sheetDataField = new List<CT_Row>();
     this.colsField = new List<CT_Col>();
     this.sheetFormatPrField = new CT_SheetFormatPr();
     this.sheetViewsField = new CT_SheetViews();
     this.dimensionField = new CT_SheetDimension();
     this.sheetPrField = new CT_SheetPr();
 }