Ejemplo n.º 1
0
 /**
  * Creates a PageSettingsBlock with default settings
  */
 public PageSettingsBlock()
 {
     _rowBreaksRecord = new HorizontalPageBreakRecord();
     _columnBreaksRecord = new VerticalPageBreakRecord();
     _rowRecords = new ArrayList();
     header = CreateHeader();
     footer = CreateFooter();
     _hCenter = CreateHCenter();
     _vCenter = CreateVCenter();
     printSetup = CreatePrintSetup();
 }
Ejemplo n.º 2
0
 /**
  * Creates a PageSettingsBlock with default settings
  */
 public PageSettingsBlock()
 {
     _plsRecords = new List<PLSAggregate>();
     _rowBreaksRecord = new HorizontalPageBreakRecord();
     _columnBreaksRecord = new VerticalPageBreakRecord();
     header = new HeaderRecord(string.Empty);
     footer = new FooterRecord(string.Empty);
     _hCenter = CreateHCenter();
     _vCenter = CreateVCenter();
     printSetup = CreatePrintSetup();
 }
Ejemplo n.º 3
0
        public override Object Clone()
        {
            PrintSetupRecord rec = new PrintSetupRecord();

            rec.field_1_paper_size    = field_1_paper_size;
            rec.field_2_scale         = field_2_scale;
            rec.field_3_page_start    = field_3_page_start;
            rec.field_4_fit_width     = field_4_fit_width;
            rec.field_5_fit_height    = field_5_fit_height;
            rec.field_6_options       = field_6_options;
            rec.field_7_hresolution   = field_7_hresolution;
            rec.field_8_vresolution   = field_8_vresolution;
            rec.field_9_headermargin  = field_9_headermargin;
            rec.field_10_footermargin = field_10_footermargin;
            rec.field_11_copies       = field_11_copies;
            return(rec);
        }
Ejemplo n.º 4
0
 private PrintSetupRecord CreatePrintSetupRecord()
 {
     PrintSetupRecord r = new PrintSetupRecord();
     r.PaperSize = ((short)0);
     r.Scale = ((short)18);
     r.PageStart = ((short)1);
     r.FitWidth = ((short)1);
     r.FitHeight = ((short)1);
     r.LeftToRight = (false);
     r.Landscape = (false);
     r.ValidSettings = (true);
     r.NoColor = (false);
     r.Draft = (false);
     r.Notes = (false);
     r.NoOrientation = (false);
     r.UsePage = (false);
     r.HResolution = ((short)0);
     r.VResolution = ((short)0);
     r.HeaderMargin = (0.5);
     r.FooterMargin = (0.5);
     r.Copies = ((short)15); // what the ??
     return r;
 }
Ejemplo n.º 5
0
        private static PrintSetupRecord CreatePrintSetupRecord()
        {
            PrintSetupRecord retval = new PrintSetupRecord();

            retval.PaperSize = ((short)0);
            retval.Scale = ((short)18);
            retval.PageStart = ((short)1);
            retval.FitWidth = ((short)1);
            retval.FitHeight = ((short)1);
            retval.Options = ((short)4);
            retval.HResolution = ((short)0);
            retval.VResolution = ((short)0);
            retval.HeaderMargin = (0.3);
            retval.FooterMargin = (0.3);
            retval.Copies = ((short)1);
            return retval;
        }
Ejemplo n.º 6
0
        public InternalChart(RecordStream rs)
        {
            _plsRecords = new List<PLSAggregate>();
            records = new List<RecordBase>(128);

            if (rs.PeekNextSid() != BOFRecord.sid)
            {
                throw new Exception("BOF record expected");
            }
            BOFRecord bof = (BOFRecord)rs.GetNext();
            if (bof.Type != BOFRecord.TYPE_CHART)
            {
                throw new RuntimeException("Bad BOF record type");
            }

            records.Add(bof);
            while (rs.HasNext())
            {
                int recSid = rs.PeekNextSid();

                Record.Record rec = rs.GetNext();
                if (recSid == EOFRecord.sid)
                {
                    records.Add(rec);
                    break;
                }

                if (recSid == ChartRecord.sid)
                {

                    continue;
                }

                if (recSid == ChartFRTInfoRecord.sid)
                {
                    _chartFrtInfo = (ChartFRTInfoRecord)rec;
                }
                else if (recSid == HeaderRecord.sid)
                {
                    header = (HeaderRecord)rec;
                }
                else if (recSid == FooterRecord.sid)
                {
                    footer = (FooterRecord)rec;
                }
                else if (recSid == HCenterRecord.sid)
                {
                    _hCenter = (HCenterRecord)rec;
                }
                else if (recSid == VCenterRecord.sid)
                {
                    _vCenter = (VCenterRecord)rec;
                }
                else if (recSid == LeftMarginRecord.sid)
                {
                    _leftMargin = (LeftMarginRecord)rec;
                }
                else if (recSid == RightMarginRecord.sid)
                {
                    _rightMargin = (RightMarginRecord)rec;
                }
                else if (recSid == TopMarginRecord.sid)
                {
                    _topMargin = (TopMarginRecord)rec;
                }
                else if (recSid == BottomMarginRecord.sid)
                {
                    _bottomMargin = (BottomMarginRecord)rec;
                }
                else if (recSid == UnknownRecord.PLS_004D) // PLS
                {
                    PLSAggregate pls = new PLSAggregate(rs);
                    PLSAggregateVisitor rv = new PLSAggregateVisitor(records);
                    pls.VisitContainedRecords(rv);
                    _plsRecords.Add(pls);

                    continue;
                }
                else if (recSid == PrintSetupRecord.sid)
                {
                    printSetup = (PrintSetupRecord)rec;
                }
                else if (recSid == PrintSizeRecord.sid)
                {
                    _printSize = (PrintSizeRecord)rec;
                }
                else if (recSid == HeaderFooterRecord.sid)
                {
                    HeaderFooterRecord hf = (HeaderFooterRecord)rec;
                    if (hf.IsCurrentSheet)
                        _headerFooter = hf;
                    else
                        _sviewHeaderFooters.Add(hf);
                }
                else if (recSid == ProtectRecord.sid)
                {
                    _protect = (ProtectRecord)rec;
                }
                records.Add(rec);
            }
            
        }
Ejemplo n.º 7
0
 private bool ReadARecord(RecordStream rs)
 {
     switch (rs.PeekNextSid())
     {
         case HorizontalPageBreakRecord.sid:
             CheckNotPresent(_rowBreaksRecord);
             _rowBreaksRecord = (PageBreakRecord)rs.GetNext();
             break;
         case VerticalPageBreakRecord.sid:
             CheckNotPresent(_columnBreaksRecord);
             _columnBreaksRecord = (PageBreakRecord)rs.GetNext();
             break;
         case HeaderRecord.sid:
             CheckNotPresent(header);
             header = (HeaderRecord)rs.GetNext();
             break;
         case FooterRecord.sid:
             CheckNotPresent(footer);
             footer = (FooterRecord)rs.GetNext();
             break;
         case HCenterRecord.sid:
             CheckNotPresent(_hCenter);
             _hCenter = (HCenterRecord)rs.GetNext();
             break;
         case VCenterRecord.sid:
             CheckNotPresent(_vCenter);
             _vCenter = (VCenterRecord)rs.GetNext();
             break;
         case LeftMarginRecord.sid:
             CheckNotPresent(_leftMargin);
             _leftMargin = (LeftMarginRecord)rs.GetNext();
             break;
         case RightMarginRecord.sid:
             CheckNotPresent(_rightMargin);
             _rightMargin = (RightMarginRecord)rs.GetNext();
             break;
         case TopMarginRecord.sid:
             CheckNotPresent(_topMargin);
             _topMargin = (TopMarginRecord)rs.GetNext();
             break;
         case BottomMarginRecord.sid:
             CheckNotPresent(_bottomMargin);
             _bottomMargin = (BottomMarginRecord)rs.GetNext();
             break;
         case UnknownRecord.PLS_004D: // PLS
             _plsRecords.Add(new PLSAggregate(rs));
             break;
         case PrintSetupRecord.sid:
             CheckNotPresent(printSetup);
             printSetup = (PrintSetupRecord)rs.GetNext();
             break;
         case UnknownRecord.BITMAP_00E9: // BITMAP
             CheckNotPresent(_bitmap);
             _bitmap = rs.GetNext();
             break;
         case PrintSizeRecord.sid:
             CheckNotPresent(_printSize);
             _printSize = rs.GetNext();
             break;
         case HeaderFooterRecord.sid:
             HeaderFooterRecord hf = (HeaderFooterRecord)rs.GetNext();
             if (hf.IsCurrentSheet)
                 _headerFooter = hf;
             else
                 _sviewHeaderFooters.Add(hf);
             break;
         default:
             // all other record types are not part of the PageSettingsBlock
             return false;
     }
     return true;
 }
Ejemplo n.º 8
0
 public override void Dispose()
 {
     _rowBreaksRecord = null;
     _columnBreaksRecord = null;
     header = null;
     footer = null;
     _hCenter = null;
     _vCenter = null;
     _leftMargin = null;
     _rightMargin = null;
     _topMargin = null;
     _bottomMargin = null;
     _pls = null;
     printSetup = null;
     _bitmap = null;
 }
Ejemplo n.º 9
0
 private bool ReadARecord(RecordStream rs)
 {
     switch (rs.PeekNextSid())
     {
         case HorizontalPageBreakRecord.sid:
             _rowBreaksRecord = (PageBreakRecord)rs.GetNext();
             _rowRecords.Add(_rowBreaksRecord);
             break;
         case VerticalPageBreakRecord.sid:
             _columnBreaksRecord = (PageBreakRecord)rs.GetNext();
             _rowRecords.Add(_columnBreaksRecord);
             break;
         case HeaderRecord.sid:
             header = (HeaderRecord)rs.GetNext();
             _rowRecords.Add(header);
             break;
         case FooterRecord.sid:
             footer = (FooterRecord)rs.GetNext();
             _rowRecords.Add(footer);
             break;
         case HCenterRecord.sid:
             _hCenter = (HCenterRecord)rs.GetNext();
             _rowRecords.Add(_hCenter);
             break;
         case VCenterRecord.sid:
             _vCenter = (VCenterRecord)rs.GetNext();
             _rowRecords.Add(_vCenter);
             break;
         case LeftMarginRecord.sid:
             _leftMargin = (LeftMarginRecord)rs.GetNext();
             _rowRecords.Add(_leftMargin);
             break;
         case RightMarginRecord.sid:
             _rightMargin = (RightMarginRecord)rs.GetNext();
             _rowRecords.Add(_rightMargin);
             break;
         case TopMarginRecord.sid:
             _topMargin = (TopMarginRecord)rs.GetNext();
             _rowRecords.Add(_topMargin);
             break;
         case BottomMarginRecord.sid:
             _bottomMargin = (BottomMarginRecord)rs.GetNext();
             _rowRecords.Add(_bottomMargin);
             break;
         case 0x004D: // PLS
             _pls = rs.GetNext();
             _rowRecords.Add(_pls);
             break;
         case PrintSetupRecord.sid:
             printSetup = (PrintSetupRecord)rs.GetNext();
             _rowRecords.Add(printSetup);
             break;
         case 0x00E9: // BITMAP
             _bitmap = rs.GetNext();
             _rowRecords.Add(_bitmap);
             break;
         default:
             // all other record types are not part of the PageSettingsBlock
             return false;
     }
     return true;
 }
Ejemplo n.º 10
0
        /**
         * Creates the PrintSetup Record and Sets it to defaults and marks it invalid
         * @see org.apache.poi.hssf.record.PrintSetupRecord
         * @see org.apache.poi.hssf.record.Record
         * @return record containing a PrintSetupRecord
         */

        protected Record CreatePrintSetup()
        {
            PrintSetupRecord retval = new PrintSetupRecord();

            retval.PaperSize = ((short)1);
            retval.Scale = ((short)100);
            retval.PageStart = ((short)1);
            retval.FitWidth = ((short)1);
            retval.FitHeight = ((short)1);
            retval.Options = ((short)2);
            retval.HResolution = ((short)300);
            retval.VResolution = ((short)300);
            retval.HeaderMargin = (0.5);
            retval.FooterMargin = (0.5);
            retval.Copies = ((short)0);
            return retval;
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSSFPrintSetup"/> class.
 /// </summary>
 /// <param name="printSetupRecord">Takes the low level print Setup record.</param>
 public HSSFPrintSetup(PrintSetupRecord printSetupRecord)
 {
     this.printSetupRecord = printSetupRecord;
 }
Ejemplo n.º 12
0
 public override Object Clone()
 {
     PrintSetupRecord rec = new PrintSetupRecord();
     rec.field_1_paper_size = field_1_paper_size;
     rec.field_2_scale = field_2_scale;
     rec.field_3_page_start = field_3_page_start;
     rec.field_4_fit_width = field_4_fit_width;
     rec.field_5_fit_height = field_5_fit_height;
     rec.field_6_options = field_6_options;
     rec.field_7_hresolution = field_7_hresolution;
     rec.field_8_vresolution = field_8_vresolution;
     rec.field_9_headermargin = field_9_headermargin;
     rec.field_10_footermargin = field_10_footermargin;
     rec.field_11_copies = field_11_copies;
     return rec;
 }