Example #1
0
        public void WriteRecord(JB64Value[] Data)
        {
            IRow TempRow = this.CurrSheet.CreateRow(this.CurrRow);

            this.CurrRow++;
            for (int x = 0; x < Data.Length; x++)
            {
                ICell TempCell = TempRow.CreateCell(x);
                if (Data[x].Type == "boolean")
                {
                    TempCell.SetCellValue((bool)Data[x].Val);
                }
                else if (Data[x].Type == "integer" || Data[x].Type == "number")
                {
                    Data[x].ConvertToNumber();
                    TempCell.SetCellValue((double)Data[x].Val);
                }
                else
                {
                    if (Data[x].Type == "date")
                    {
                        Data[x] = new JB64Value(MainWizard.UTCToLocalDate((string)Data[x].Val), "date");
                    }
                    if (Data[x].Type == "time")
                    {
                        Data[x] = new JB64Value(MainWizard.UTCToLocalTime((string)Data[x].Val), "time");
                    }

                    Data[x].ConvertToString();
                    TempCell.SetCellValue((string)Data[x].Val);
                }
            }
        }
Example #2
0
        public void Init(string Filename, string SheetName)
        {
            string FileExt = MainWizard.GetFileExt(Filename);

            if (FileExt == ".xls")
            {
                this.Workbook = new HSSFWorkbook();
            }
            else
            {
                this.Workbook = new XSSFWorkbook();
            }

            this.CurrSheet = this.Workbook.CreateSheet(SheetName);
            this.CurrRow   = 0;

            this.TempFile = File.Create(Filename);
        }