PDF Column name

Hi, im having issues with the PdfLightTable when creating a PDF in ASP.NET Core.

PdfLightTable pdfLightTable = new PdfLightTable();
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.TableDirect;
pdfLightTable.AllowRowBreakAcrossPages = true;
pdfLightTable.Columns.Add(new PdfColumn("Name"));
pdfLightTable.Columns.Add(new PdfColumn("Age"));
pdfLightTable.Columns.Add(new PdfColumn("Class"));
//Add rows.
pdfLightTable.Rows.Add(new object[] { "Tet column", "Maxim", "III" });
// Draw the PDF
pdfLightTable.Draw(tablePage, PointF.Empty);

The column values are all created as expected, but no column header is visible...

3 Replies

BN Bhuvaneswari Nagarajan Syncfusion Team August 18, 2017 12:39 PM UTC

Hi Anders, 

Thank you for using Syncfusion products, 

We can achieve your requirement by setting the ShowHeader property as true. Please refer the below code snippet, 

//Create a PdfLightTable. 
PdfLightTable pdfLightTable = new PdfLightTable(); 
//Set the header value 
pdfLightTable.Style.ShowHeader = true; 
//Set the Data source as direct. 
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.TableDirect; 
pdfLightTable.AllowRowBreakAcrossPages = true; 
//Create columns. 
pdfLightTable.Columns.Add(new PdfColumn("Name")); 
pdfLightTable.Columns.Add(new PdfColumn("Age")); 
pdfLightTable.Columns.Add(new PdfColumn("Class")); 
//Add rows. 
pdfLightTable.Rows.Add(new object[] { "Tet column", "Maxim", "III" }); 
//Draw the PdfLightTable. 
pdfLightTable.Draw(tablePage, PointF.Empty); 


Please let us know if you need further assistance. 

Regards, 
Bhuvaneswari N. 



AR Anders R Malmo August 18, 2017 06:40 PM UTC

Thank you, Bhuvaneswari.



BN Bhuvaneswari Nagarajan Syncfusion Team August 21, 2017 04:52 AM UTC

Hi Anders,    
  
Thanks for the update. Please get back to us if you need further assistance on this.  
  
Regards,  
Bhuvaneswari N. 


Loader.
Up arrow icon