Hi we are using Aspose.Cells 8.3.2.1 .NET C#
Hi Graeme,
foreach (Worksheet sheet in book.Worksheets)
{
book.Worksheets.ActiveSheetIndex = sheet.Index;
book.Save(dir + sheet.Name + “.html”, new HtmlSaveOptions() { ExportActiveWorksheetOnly = true });
}
Hi Babar,
{
var currentWorkSheet =
documentTemplateSpreadsheet.Worksheets[1];
int insertPoint =
documentTemplateSpreadsheet.Worksheets[0].Cells.Rows.Count;
Aspose.Cells.Range range2 = documentTemplateSpreadsheet.Worksheets[0].Cells.CreateRange(insertPoint, 0, documentTemplateSpreadsheet.Worksheets[1].Cells.Rows.Count, documentTemplateSpreadsheet.Worksheets[1].Cells.Columns.Count);
range2.Copy(range);
documentTemplateSpreadsheet.Worksheets[0].Cells.CopyRows(documentTemplateSpreadsheet.Worksheets[1].Cells, 0, insertPoint, 1);
documentTemplateSpreadsheet.Worksheets.RemoveAt(1);
}
Hi again,
Ah ok thats not good for what i need. Ok i have anew approach which is to convert the Excel document into a pdf document however when i do this i get page breaks between all of the sheets when rendered to the PDF. Id there a way to stop the page breaks and have each sheet running together?
GraemeBaillie:
Id there a way to stop the page breaks and have each sheet running together?
workbook.Save( dir + "output.pdf", new PdfSaveOptions() { OnePagePerSheet = true});
I have just tried this as it still gives you a separate pdf page for each sheet. Is there no way to have multiple sheets on the same page but allow the contents to spill over multiple pages?
Hi Graeme,
Worksheet target = workbook.Worksheets[0];
for (int i = 1; i < workbook.Worksheets.Count; i++)
{
Worksheet source = workbook.Worksheets[i];
Range sourceRange = source.Cells.MaxDisplayRange;
target.Cells.CreateRange(target.Cells.MaxDataRow + 1, 0, sourceRange.RowCount, sourceRange.ColumnCount).Copy(sourceRange);
workbook.Worksheets.RemoveAt(i);
}
workbook.Save( dir + “output.pdf”, new PdfSaveOptions() { AllColumnsInOnePagePerSheet = true});