Problem in generating Multiple Tab


#1

hi

I am using aspose.excel.web and i a have a problem in generating
multiple tabs in as single worksheet when i exporting data into
Excelsheet.



//////////////////

Worksheet Sheet1 = excelSheet.Worksheets[0];

Sheet1.Name = “Remaining Reserves”;

Cells Cells = Sheet1.Cells;

Cells.ImportDataTable(deskTopDefault.DeskTopsDefaultDS.Tables[0], true,
0, 0, deskTopDefault.DeskTopsDefaultDS.Tables[0].Rows.Count+1,
deskTopDefault.DeskTopsDefaultDS.Tables[0].Columns.Count+1);

excelSheet.Save(“tb2”, SaveType.OpenInBrowser, FileFormatType.Default, this.Response);

/////////////////



in the above code i want to export another dataset with another tab in single Excel Sheet.



//gaurav


#2

Hi gaurav,

I am confused. You said you use Aspose.Excel.Web. But from your sample code, I think it's Aspose.Excel. What's the really product that you are using?

To export another dataset to a worksheet in an Excel file, you can try:

Worksheet Sheet1 = excelSheet.Worksheets[0];
Sheet1.Name = "Remaining Reserves";
Cells Cells = Sheet1.Cells;
Cells.ImportDataTable(deskTopDefault.DeskTopsDefaultDS.Tables[0], true, 0, 0, deskTopDefault.DeskTopsDefaultDS.Tables[0].Rows.Count+1, deskTopDefault.DeskTopsDefaultDS.Tables[0].Columns.Count+1);

Worksheet Sheet2 = excelSheet.Worksheets[1];
Sheet2.Name = "Remaining Reserves2";
Cells Cells = Sheet2.Cells;
Cells.ImportDataTable(deskTopDefault.DeskTopsDefaultDS.Tables[1], true, 0, 0, deskTopDefault.DeskTopsDefaultDS.Tables[1].Rows.Count+1, deskTopDefault.DeskTopsDefaultDS.Tables[1].Columns.Count+1);