|
PdfLightTable class represents simple tables that are used for publishing structured data from arrays, data tables or data columns. We can create a table simply by specifying a new operator with the proper constructor. DataSource is an object that might be an array (2 dimensional, 1 dimensional or nested), a DataTable, DataColumn, DataView or DataSet. Using Draw() method we can draw the table in PDF document. C# // Creating table PdfLightTable table = new PdfLightTable(); table.DataSourceType = PdfLightTableDataSourceType.External; // Initializing datasource table.DataSource = dataTable; //Set layout properties PdfLayoutFormat format = new PdfLayoutFormat(); format.Break = PdfLayoutBreakType.FitElement; format.Layout = PdfLayoutType.Paginate; // Drawing Table table.Draw(page,new PointF(0,0),format); VB ' Creating table Dim table As PdfLightTable = New PdfLightTable() table.DataSourceType = PdfLightTableDataSourceType.External ' Initializing datasource table.DataSource = dataTable 'Set layout properties Dim format As PdfLayoutFormat = New PdfLayoutFormat() format.Break = PdfLayoutBreakType.FitElement format.Layout = PdfLayoutType.Paginate ' Drawing Table table.Draw(page,New PointF(0,0),format) Please do find the sample which demonstrates the above feature from below mentioned location, http://www.syncfusion.com/support/user/uploads/PDF_TableDemo_17a77f7f.zip |