Hi,
dt.Columns.Add(“Type”);
dt.Columns.Add(“Number”);
dt.Rows.Add(new object[] { “MMM”, “11111111111111111111” });
Workbook book = new Workbook();
book.Worksheets[0].Cells.ImportDataTable(dt, true, 0, 0, true, false);
book.Save(“C:/temp/output.xlsx”);
shwank:
Actualy i want to excel functionalty -->Format Cells >> Number Tab >>Catagory>>Text
Hi,
Hi,
Style style = worksheet.Cells[“B3”].GetStyle();
style.Number = 49;
worksheet.Cells[“B3”].SetStyle(style);
To:
Style style = workBook.CreateStyle();
style.Number = 49;
worksheet.Cells[“B3”].SetStyle(style, new StyleFlag() { NumberFormat = true });
I have no such a overload.
Hi,
Hi again,
I tried excel cell color change for testing, but it’s not working to.
I think, I have a big mistake for usage Aspose because nothing work
Workbook workBook = new Workbook(FileFormatType.Xlsx);
Worksheet worksheet = workBook.Worksheets[0];
worksheet.AutoFitColumns();
worksheet.Cells.ImportDataTable(dataTable, true, 0, 0, true, false);
Style style = workBook.CreateStyle();
//style.Number = 49;
style.Custom = “@”;
style.Pattern = BackgroundType.Solid;
style.ForegroundColor = Color.Red;
StyleFlag f = new StyleFlag();
f.NumberFormat = true;
worksheet.Cells[“B3”].SetStyle(style,f);
workBook.Save(filePath);
shwank:
I tried excel cell color change for testing, but it's not working to.I think, I have a big mistake for usage Aspose because nothing workWorkbook workBook = new Workbook(FileFormatType.Xlsx);Worksheet worksheet = workBook.Worksheets[0];worksheet.AutoFitColumns();worksheet.Cells.ImportDataTable(dataTable, true, 0, 0, true, false);Style style = workBook.CreateStyle();//style.Number = 49;style.Custom = "@";style.Pattern = BackgroundType.Solid;style.ForegroundColor = Color.Red;StyleFlag f = new StyleFlag();f.NumberFormat = true;worksheet.Cells["B3"].SetStyle(style,f);workBook.Save(filePath);
Hi,
Hi,
hi,
Hi,