Beispiel #1
0
        /**
         * Creates a bar chart.  API needs some work. :)
         *
         * NOTE:  Does not yet work...  checking it in just so others
         * can take a look.
         */
        public void CreateBarChart(HSSFWorkbook workbook, HSSFSheet sheet)
        {

            List<RecordBase> records = new List<RecordBase>();
            records.Add(CreateMSDrawingObjectRecord());
            records.Add(CreateOBJRecord());
            records.Add(CreateBOFRecord());
            records.Add(new HeaderRecord(string.Empty));
            records.Add(new FooterRecord(string.Empty));
            records.Add(CreateHCenterRecord());
            records.Add(CreateVCenterRecord());
            records.Add(CreatePrintSetupRecord());
            // unknown 33   
            records.Add(CreateFontBasisRecord1());
            records.Add(CreateFontBasisRecord2());
            records.Add(new ProtectRecord(false));
            records.Add(CreateUnitsRecord());
            records.Add(CreateChartRecord(0, 0, 30434904, 19031616));
            records.Add(CreateBeginRecord());
            records.Add(CreateSCLRecord((short)1, (short)1));
            records.Add(CreatePlotGrowthRecord(65536, 65536));
            records.Add(CreateFrameRecord1());
            records.Add(CreateBeginRecord());
            records.Add(CreateLineFormatRecord(true));
            records.Add(CreateAreaFormatRecord1());
            records.Add(CreateEndRecord());
            records.Add(CreateSeriesRecord());
            records.Add(CreateBeginRecord());
            records.Add(CreateTitleLinkedDataRecord());
            records.Add(CreateValuesLinkedDataRecord());
            records.Add(CreateCategoriesLinkedDataRecord());
            records.Add(CreateDataFormatRecord());
            //		records.Add(CreateBeginRecord());
            // unknown
            //		records.Add(CreateEndRecord());
            records.Add(new SerToCrtRecord());
            records.Add(CreateEndRecord());
            records.Add(CreateSheetPropsRecord());
            records.Add(CreateDefaultTextRecord((short)TextFormatInfo.FontScaleNotSet));
            records.Add(CreateAllTextRecord());
            records.Add(CreateBeginRecord());
            // unknown
            records.Add(CreateFontIndexRecord(5));
            records.Add(CreateDirectLinkRecord());
            records.Add(CreateEndRecord());
            records.Add(CreateDefaultTextRecord((short)3)); // eek, undocumented text type
            records.Add(CreateUnknownTextRecord());
            records.Add(CreateBeginRecord());
            records.Add(CreateFontIndexRecord((short)6));
            records.Add(CreateDirectLinkRecord());
            records.Add(CreateEndRecord());

            records.Add(CreateAxisUsedRecord((short)1));
            CreateAxisRecords(records);

            records.Add(CreateEndRecord());
            records.Add(CreateDimensionsRecord());
            records.Add(CreateSeriesIndexRecord(2));
            records.Add(CreateSeriesIndexRecord(1));
            records.Add(CreateSeriesIndexRecord(3));
            records.Add(EOFRecord.instance);



            sheet.InsertChartRecords(records);
            workbook.InsertChartRecord();
        }
Beispiel #2
0
 public void TestTestMethods()
 {
     HSSFWorkbook wb = new HSSFWorkbook();
     wb.InsertChartRecord();
     //wb.dumpDrawingGroupRecords(true);
     //wb.dumpDrawingGroupRecords(false);
 }