Beispiel #1
0
        public void TestSetGetHeaderFooterMargin()
        {
            CT_Worksheet   worksheet = new CT_Worksheet();
            CT_PageMargins pMargins  = worksheet.AddNewPageMargins();

            pMargins.header = (1.5);
            pMargins.footer = (2);
            XSSFPrintSetup printSetup = new XSSFPrintSetup(worksheet);

            Assert.AreEqual(1.5, printSetup.HeaderMargin, 0.0);
            Assert.AreEqual(2.0, printSetup.FooterMargin, 0.0);

            printSetup.HeaderMargin = (5);
            printSetup.FooterMargin = (3.5);
            Assert.AreEqual(5.0, pMargins.header, 0.0);
            Assert.AreEqual(3.5, pMargins.footer, 0.0);
        }
Beispiel #2
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();
            }
        }