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.
Unfortunately, activation email could not send to your email. Please try again.

PDF Column name

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 08:39 AM

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 02:40 PM

Thank you, Bhuvaneswari.


Bhuvaneswari Nagarajan [Syncfusion]
Replied On August 21, 2017 12:52 AM

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.

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.

;