public void TestSetGetScale() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.scale = (uint)9; XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(9, printSetup.Scale); printSetup.Scale = ((short)100); Assert.AreEqual((uint)100, pSetup.scale); }
public void TestSetGetPageStart() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.firstPageNumber = 9; XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(9, printSetup.PageStart); printSetup.PageStart = ((short)1); Assert.AreEqual((uint)1, pSetup.firstPageNumber); }
public void TestSetGetDraft() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.draft = (false); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.Draft); printSetup.Draft = (true); Assert.AreEqual(true, pSetup.draft); }
public void TestSetGetCopies() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.copies = (9); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(9, printSetup.Copies); printSetup.Copies = (short)15; Assert.AreEqual((uint)15, pSetup.copies); }
public void TestSetGetPaperSize() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.paperSize = (9); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(PaperSize.A4, printSetup.GetPaperSizeEnum()); Assert.AreEqual(9, printSetup.PaperSize); printSetup.SetPaperSize(PaperSize.A3); Assert.AreEqual((uint)8, pSetup.paperSize); }
public void TestSetGetFitWidthHeight() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.fitToWidth = (50); pSetup.fitToHeight = (99); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(50, printSetup.FitWidth); Assert.AreEqual(99, printSetup.FitHeight); printSetup.FitWidth = ((short)66); printSetup.FitHeight = ((short)80); Assert.AreEqual((uint)66, pSetup.fitToWidth); Assert.AreEqual((uint)80, pSetup.fitToHeight); }
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(); } }
public void TestSetGetOrientation() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.orientation = (ST_Orientation.portrait); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(PrintOrientation.PORTRAIT, printSetup.Orientation); Assert.AreEqual(false, printSetup.Landscape); Assert.AreEqual(false, printSetup.NoOrientation); printSetup.Orientation = (PrintOrientation.LANDSCAPE); Assert.AreEqual((int)pSetup.orientation, printSetup.Orientation.Value); Assert.AreEqual(true, printSetup.Landscape); Assert.AreEqual(false, printSetup.NoOrientation); }
public void TestSetGetLeftToRight() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.pageOrder = (ST_PageOrder.downThenOver); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.LeftToRight); printSetup.LeftToRight = (true); Assert.AreEqual(PageOrder.OVER_THEN_DOWN.Value, (int)pSetup.pageOrder); }
public void TestSetGetHVResolution() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.horizontalDpi = (120); pSetup.verticalDpi = (100); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(120, printSetup.HResolution); Assert.AreEqual(100, printSetup.VResolution); printSetup.HResolution = ((short)150); printSetup.VResolution = ((short)130); Assert.AreEqual((uint)150, pSetup.horizontalDpi); Assert.AreEqual((uint)130, pSetup.verticalDpi); }
public void TestSetGetUsePage() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.useFirstPageNumber = (false); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.UsePage); printSetup.UsePage = (true); Assert.AreEqual(true, pSetup.useFirstPageNumber); }
public void TestSetGetNotes() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.cellComments = ST_CellComments.none; XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.Notes); printSetup.Notes = true; Assert.AreEqual(PrintCellComments.AS_DISPLAYED.Value, (int)pSetup.cellComments); }
public void TestSetGetNoColor() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.blackAndWhite = (false); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.NoColor); printSetup.NoColor = true; Assert.AreEqual(true, pSetup.blackAndWhite); }
public void TestSetGetValidSettings() { CT_Worksheet worksheet = new CT_Worksheet(); CT_PageSetup pSetup = worksheet.AddNewPageSetup(); pSetup.usePrinterDefaults = (false); XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet); Assert.AreEqual(false, printSetup.ValidSettings); printSetup.ValidSettings = (true); Assert.AreEqual(true, pSetup.usePrinterDefaults); }