We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

multiple page DataTable

If I have a really big data table that I want to convert to PDF, is there a simple way to have it span multiple pages on the PDF document? If there''s a good answer to that question, is there an easy way to have it automatically create the number of pages I need based on the number of rows, height of rows, layout and size of the page, etc...?

3 Replies

AJ Ajish Syncfusion Team May 11, 2006 03:41 PM UTC

Hi Jesse,

Thank you for your interest in Essential PDF. It is very simple to insert a data table into a pdf document that span for multiple pages using Essential PDF. The ITable interface is needed for importing a table from a database to a PDF document. The method ConfigureTable and Publish method is called for importing and publishing the table into the pdf page. PageBreakBehavior property is used to make table span for multiple columns.

Steps in inserting ADO.Net DataTable:

1) Creating a table // Creating a table. ITable table = pdfDoc.CreateTable(); 2) Get the Datatable to be inserted from the database // Getting the table to a dataset. DataSet dataSet11 = new DataSet(); // Getting Xml file. dataSet11.ReadXml("customers.xml"); dsNorthWind =dataSet11; 3) Set the PageBreakBehaviour property of the created table to span in multiple pages. //To make the Table span over multiple pages without getting cut. table.PageBreakBehavior = AutoBreakBehavior.FullBreak; 4) Assigning dataset to the created table // Assigning the dataset to the created table. table.DataMember = dsNorthWind.Tables[0].TableName; table.DataSource = dsNorthWind; // Configuring the table. table.ConfigureTable( dsNorthWind.Tables[0] ); 5) Publish table. // Publish the table. table.Publish( new PointF( 0, 0 ),pdfDoc.Pages[0]);

Here is sample for your reference: NorthWindReport.zip

Please take a look at the sample and let me know if you need any further assistance.

Thanks, Ajish.


JM Jesse Marek May 11, 2006 04:41 PM UTC

Thanks a lot. Is there also some way I can find the page and location that the table ended so that I can start a new table at that location? >Hi Jesse, > >

Thank you for your interest in Essential PDF. It is very simple to insert a data table into a pdf document that span for multiple pages using Essential PDF. The ITable interface is needed for importing a table from a database to a PDF document. The method ConfigureTable and Publish method is called for importing and publishing the table into the pdf page. PageBreakBehavior property is used to make table span for multiple columns. >

>Steps in inserting ADO.Net DataTable: >

>1) Creating a table > > >// Creating a table. >ITable table = pdfDoc.CreateTable(); > > >2) Get the Datatable to be inserted from the database > > >// Getting the table to a dataset. >DataSet dataSet11 = new DataSet(); > > >// Getting Xml file. >dataSet11.ReadXml("customers.xml"); >dsNorthWind =dataSet11; > > >3) Set the PageBreakBehaviour property of the created table to span in multiple pages. > > >//To make the Table span over multiple pages without getting cut. >table.PageBreakBehavior = AutoBreakBehavior.FullBreak; > > >4) Assigning dataset to the created table > > >// Assigning the dataset to the created table. >table.DataMember = dsNorthWind.Tables[0].TableName; >table.DataSource = dsNorthWind; > >// Configuring the table. >table.ConfigureTable( dsNorthWind.Tables[0] ); > > >5) Publish table. > > >// Publish the table. >table.Publish( new PointF( 0, 0 ),pdfDoc.Pages[0]); > >

> >Here is sample for your reference: NorthWindReport.zip > > >

Please take a look at the sample and let me know if you need any further assistance.

> > >Thanks, >Ajish. >


AD Administrator Syncfusion Team May 11, 2006 09:00 PM UTC

Hi Jesse, Please refer to this sample ITable.Publish gives the table size InsertTables.zip Best regards, Stephen.

Loader.
Live Chat Icon For mobile
Up arrow icon