Hello!
I am trying to test following the following example of VS2015 for Spire.XLS.
In particular the MarkerDesigner-VS2015 project: The idea is test marker with tables and convert the xlsx result to pdf.
I have taken the opportunity to convert the xls into a pdf after apply the MarkerDesigner.
The problem is that in your example, page breaks automatically adapt and generate the pdf well, but in my example it does not.
What should I do to adjust the page breaks so that the pdf comes out correctly?
I have used the same code to generate both files. I attach the result.
Thank you very much for your help!
Workbook workbook = new Workbook();
Workbook workbookTest = new Workbook();
workbook.LoadFromFile(@"D:\temp\AMPO\Puebas Spire XLS\Demos\Data\MarkerDesigner.xls");
workbookTest.LoadFromFile(@"D:\temp\AMPO\Puebas Spire XLS\Demos\Data\SubVendorList.xlsx");
DataTable dt = (DataTable)dataGrid1.DataSource;
Worksheet sheet = workbook.Worksheets[0];
Worksheet sheetTest = workbookTest.Worksheets[0];
//Fill parameter
//workbook.MarkerDesigner.AddParameter("Variable1","1234.5678");
//Fill DataTable
workbook.MarkerDesigner.AddDataTable("Country",dt);
workbookTest.MarkerDesigner.AddDataTable("Country", dt);
try
{
workbook.MarkerDesigner.Apply();
workbook.SaveToFile(@"d:\test.xlsx", ExcelVersion.Version2010);
workbook.SaveToFile(@"d:\test.pdf", FileFormat.PDF);
workbookTest.MarkerDesigner.Apply();
workbookTest.SaveToFile(@"d:\test2.xlsx", ExcelVersion.Version2010);
workbookTest.SaveToFile(@"d:\test2.pdf", FileFormat.PDF);
}
catch (Exception)
{
}