Beispiel #1
0
 // Methods
 internal ExcelWorksheet(string name, ExcelWorksheetCollection parent)
 {
     this.defaultColumnWidth        = 0x924;
     this.outlineRowButtonsBelow    = true;
     this.outlineColumnButtonsRight = true;
     this.pageBreakViewZoom         = 60;
     this.zoom                      = 100;
     this.windowOptions             = WorksheetWindowOptions.ShowOutlineSymbols | (WorksheetWindowOptions.DefaultGridLineColor | (WorksheetWindowOptions.ShowGridLines | (WorksheetWindowOptions.ShowZeroValues | WorksheetWindowOptions.ShowSheetHeaders)));
     this.paperSize                 = 0;
     this.scalingFactor             = 0xff;
     this.startPageNumber           = 1;
     this.fitWorksheetWidthToPages  = 0;
     this.fitWorksheetHeightToPages = 0;
     this.setupOptions              = SetupOptions.Landscape;
     this.printResolution           = 0;
     this.verticalPrintResolution   = 0;
     this.headerMargin              = 0.5;
     this.footerMargin              = 0.5;
     this.numberOfCopies            = 1;
     this.name                      = name;
     this.parent                    = parent;
     this.rows                      = new ExcelRowCollection(this);
     this.columns                   = new ExcelColumnCollection(this);
     this.mergedRanges              = new MergedCellRanges(this);
     this.horizontalPageBreaks      = new HorizontalPageBreakCollection();
     this.verticalPageBreaks        = new VerticalPageBreakCollection();
 }
Beispiel #2
0
 internal ExcelWorksheet(string name, ExcelWorksheetCollection parent, ExcelWorksheet sourceWorksheet)
 {
     this.defaultColumnWidth        = 0x924;
     this.outlineRowButtonsBelow    = true;
     this.outlineColumnButtonsRight = true;
     this.pageBreakViewZoom         = 60;
     this.zoom                      = 100;
     this.windowOptions             = WorksheetWindowOptions.ShowOutlineSymbols | (WorksheetWindowOptions.DefaultGridLineColor | (WorksheetWindowOptions.ShowGridLines | (WorksheetWindowOptions.ShowZeroValues | WorksheetWindowOptions.ShowSheetHeaders)));
     this.paperSize                 = 0;
     this.scalingFactor             = 0xff;
     this.startPageNumber           = 1;
     this.fitWorksheetWidthToPages  = 0;
     this.fitWorksheetHeightToPages = 0;
     this.setupOptions              = SetupOptions.Landscape;
     this.printResolution           = 0;
     this.verticalPrintResolution   = 0;
     this.headerMargin              = 0.5;
     this.footerMargin              = 0.5;
     this.numberOfCopies            = 1;
     this.name                      = name;
     this.parent                    = parent;
     this.protectedWorksheet        = sourceWorksheet.protectedWorksheet;
     this.rows                      = new ExcelRowCollection(this, sourceWorksheet.rows);
     this.columns                   = new ExcelColumnCollection(this, sourceWorksheet.columns);
     this.defaultColumnWidth        = sourceWorksheet.defaultColumnWidth;
     this.mergedRanges              = new MergedCellRanges(this, sourceWorksheet.mergedRanges);
     this.outlineRowButtonsBelow    = sourceWorksheet.outlineRowButtonsBelow;
     this.outlineColumnButtonsRight = sourceWorksheet.outlineColumnButtonsRight;
     if (sourceWorksheet.PreservedWorksheetRecords != null)
     {
         this.PreservedWorksheetRecords = new PreservedRecords(sourceWorksheet.PreservedWorksheetRecords);
     }
     this.windowOptions      = sourceWorksheet.windowOptions & ((WorksheetWindowOptions)(-1537));
     this.firstVisibleRow    = sourceWorksheet.firstVisibleRow;
     this.firstVisibleColumn = sourceWorksheet.firstVisibleColumn;
     this.pageBreakViewZoom  = sourceWorksheet.pageBreakViewZoom;
     this.zoom = sourceWorksheet.zoom;
     this.horizontalPageBreaks      = new HorizontalPageBreakCollection(sourceWorksheet.horizontalPageBreaks);
     this.verticalPageBreaks        = new VerticalPageBreakCollection(sourceWorksheet.verticalPageBreaks);
     this.paperSize                 = sourceWorksheet.paperSize;
     this.scalingFactor             = sourceWorksheet.scalingFactor;
     this.startPageNumber           = sourceWorksheet.startPageNumber;
     this.fitWorksheetWidthToPages  = sourceWorksheet.fitWorksheetWidthToPages;
     this.fitWorksheetHeightToPages = sourceWorksheet.fitWorksheetHeightToPages;
     this.setupOptions              = sourceWorksheet.setupOptions;
     this.printResolution           = sourceWorksheet.printResolution;
     this.verticalPrintResolution   = sourceWorksheet.verticalPrintResolution;
     this.headerMargin              = sourceWorksheet.headerMargin;
     this.footerMargin              = sourceWorksheet.footerMargin;
     this.numberOfCopies            = sourceWorksheet.numberOfCopies;
     this.namedRanges               = new NamedRangeCollection(this, sourceWorksheet.NamedRanges);
 }
Beispiel #3
0
        ///<summary>
        ///Converts the name record range to RPN bytes.
        ///</summary>
        ///<param name="range">The range to be converted.</param>
        ///<param name="sheetName">Sheet' name.</param>
        ///<param name="worksheets">The worksheets collection.</param>
        public static byte[] ConvertNameRecordRangeToRpnBytes(CellRange range, string sheetName, ExcelWorksheetCollection worksheets)
        {
            FormulaToken token1 = null;
            string       text1  = string.Empty;

            if ((range.Width == 1) && (range.Height == 1))
            {
                Match  match1 = RefFormulaToken.IsCellRegex.Match(range.ToString());
                string text2  = NameRecord.ConvertToAbsolute(match1.Groups["Row"].Value);
                string text3  = NameRecord.ConvertToAbsolute(match1.Groups["Column"].Value);
                text1  = sheetName + "!" + text3 + text2;
                token1 = new Ref3dFormulaToken(FormulaTokenCode.Ref3d1);
            }
            else
            {
                Match    match2     = AreaFormulaToken.IsCellRangeRegex.Match(range.ToString());
                string   text4      = NameRecord.ConvertToAbsolute(match2.Groups["Row1"].Value);
                string   text5      = NameRecord.ConvertToAbsolute(match2.Groups["Column1"].Value);
                string   text6      = NameRecord.ConvertToAbsolute(match2.Groups["Row2"].Value);
                string   text7      = NameRecord.ConvertToAbsolute(match2.Groups["Column2"].Value);
                string[] textArray1 = new string[] { sheetName, "!", text5, text4, ":", text7, text6 };
                text1  = string.Concat(textArray1);
                token1 = new Area3dFormulaToken(FormulaTokenCode.Area3d1);
            }
            object[] objArray1 = new object[] { text1, worksheets };
            token1.DelayInitialize(objArray1);
            return(token1.ConvertToBytes());
        }