Spire.DataExport for .NET is a 100% pure data .NET library suit for exporting data into MS Word, Excel, RTF, Access, PDF, XPS, HTML, XML, Text, CSV, DBF, SYLK, SQL Script, DIF, Clipboard, etc.

Fri Mar 14, 2014 7:43 am

Hello,

I have a DataTable with a lot of columns. I want to export the DataTable to a PDF document. This works like a charm except that the columns which do not fit on one A4 page are lost / truncated. They are not automatically printed on a second page.

Here is the code

Dim export As New PDF.PDFExport
export.PDFOptions.PageOptions.Orientation = Common.PageOrientation.Landscape
export.DataSource = Common.ExportSource.DataTable
export.DataTable = dt
export.SaveToFile("y:\main\test\pdfDatatable.pdf")

How can I "force" a pagebreak in order to print the remaining columns on a second page?

Best regards

Frederic

it@cdds.lu
 
Posts: 1
Joined: Mon Mar 03, 2014 3:49 pm

Fri Mar 14, 2014 9:46 am

Hello,

Thanks for your inquiry.
Sorry that at present it doesn't support the automatically page break when exporting dt to PDF, and we have transferred the issue to our Dev team.
But you could export dt to excel, and then convert the excel to pdf , please download Spire.xls7.3.2(http://www.e-iceblue.com/Download/downl ... t-now.html) and test the below method, which is also simple.
Code: Select all
Workbook book = new Workbook();
Worksheet sheet = book.Worksheets[0];
sheet.InsertDataTable(datatable, true, 1, 1);
book.SaveToPdf(@"result.pdf");

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Mar 18, 2014 9:30 am

Hello,

Have you tested our Spire.Xls product? Does it fulfill your requirement? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Wed Nov 26, 2014 10:27 pm

Do you ever plan to address this, otherwise the PDF export seems pointless to me ..

Also RTF suffer from the same problems...

ascotford
 
Posts: 12
Joined: Wed Sep 18, 2013 3:34 pm

Thu Nov 27, 2014 7:19 am

Hello,

We have added the issue to our schedule, We will notify you as soon as we made some significant progress towards issue resolution.

Best regards,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Wed Aug 26, 2015 2:56 pm

We are evaluating DataExport and it seems like a great product that will fit our needs. However before we purchase we need a fix for the column truncation issue in the RTFExport and PDFExport classes.

jeanny
 
Posts: 3
Joined: Mon Aug 24, 2015 6:26 pm

Fri Aug 28, 2015 3:30 am

Hello,

Thanks for your inquiry.
Our dev team doesn't have a plan to fix the issue.
I recommend you to export dt to excel files, and then convert the excel to pdf. You will get the pdf file. Next, please convert the pdf to doc, then convert the doc to rtf. You will get the rtf file.
please download Spire.Office ( The latest version is Spire.Office Platinum (Hot Fix) Version:2.12.4 ) and refer to the below code, which is also simple.
Code: Select all
 Workbook book = new Workbook();           
            Worksheet sheet = book.Worksheets[0];
            sheet.InsertDataTable(datatable, true, 1, 1);
            book.SaveToPdf(@"5689.pdf");
           
            PdfDocument pdf=new PdfDocument ();
            pdf.LoadFromFile("5689.pdf");
            pdf.SaveToFile("5689.doc", Spire.Pdf.FileFormat.DOC);

            Document doc=new Document ();
            doc.LoadFromFile("5689.doc");
            doc.SaveToFile("5689.rtf", Spire.Doc.FileFormat.Rtf);


Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Fri Aug 28, 2015 1:56 pm

We are not interested in Spire.Office since all we need is to export a DataTable to XLSX/PDF/DOCX. Thanks anyways!

jeanny
 
Posts: 3
Joined: Mon Aug 24, 2015 6:26 pm

Thu Aug 04, 2016 1:16 pm

Hi there,

Sorry to open this old thread but, has this issue been fixed ? the column truncation ?

Thank you.

ppereiranb
 
Posts: 1
Joined: Wed Aug 03, 2016 4:25 pm

Fri Aug 05, 2016 6:16 am

Hi,

Thanks for your inquiry. There are two solutions.
1)Please set the PageOptions property, such as set PageOrientation as Landscape, or set width, etc. Sample code for your reference.
Code: Select all
pdfExport1.PDFOptions.PageOptions.Width = 12.00;
pdfExport1.PDFOptions.PageOptions.MarginBottom = 0;
pdfExport1.PDFOptions.PageOptions.Orientation = Common.PageOrientation.Landscape;
pdfExport1.SaveToFile();

2)We suggest exporting dt to excel files and then convert the excel to pdf using Spire.XLS. Here is sample code for your reference.
Code: Select all
            Workbook book = new Workbook();           
            Worksheet sheet = book.Worksheets[0];
            sheet.InsertDataTable(datatable, true, 1, 1);
            book.SaveToPdf(@"5689.pdf");

Hope it can help you. If the issue still exists, please provide us your data and codes you were using for investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.DataExport