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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF Column name

Thread ID:

Created:

Updated:

Platform:

Replies:

132167 Aug 17,2017 08:35 PM UTC Aug 21,2017 04:52 AM UTC ASP.NET Core 3
loading
Tags: PDF
Anders R Malmo
Asked On August 17, 2017 08:35 PM UTC

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...

Bhuvaneswari Nagarajan [Syncfusion]
Replied On 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. 


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

Thank you, Bhuvaneswari.


Bhuvaneswari Nagarajan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;