This is a migrated thread and some comments may be shown as answers.

Showing Grid in exported PDF

11 Answers 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andreas Mildenberger
Top achievements
Rank 1
Andreas Mildenberger asked on 23 Feb 2011, 11:10 AM

Hello,

 

I already export my radGridView to PDF with the following code:

  

Telerik.WinControls.UI.Export.ExportToPDF exportPDF = new Telerik.WinControls.UI.Export.ExportToPDF(radGridView);

               

exportPDF.PdfExportSettings.Title = "Title";

exportPDF.SummariesExportOption = Telerik.WinControls.UI.Export.SummariesOption.ExportAll;

exportPDF.ExportVisualSettings = true;
exportPDF.TableBorderThickness = 10;

exportPDF.PdfExportSettings.PageWidth = 600;

exportPDF.PdfExportSettings.PageHeight = 950;

exportPDF.FitToPageWidth = true;

  

but no matter how I set the TableBorderThickness property, there is no difference in the PDF…

 

1. I want to be able to hide the border around my table on every page
2. I want to show the whole Grid ( border around every cell ),

How can I implement these 2 cases?

Regards,


Stefan 

11 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Feb 2011, 01:29 PM
Hello,

Whilst I agree that the TableBorder property seems to have no effect, you can set a border for all of the cells by subscribing to the HTMLCellFormattingEventHandler

exportPDF.HTMLCellFormatting += new Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exportPDF_HTMLCellFormatting);

void exportPDF_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
{
    e.HTMLCellElement.Styles.Add("border-style", "solid");
}

Hope this helps but let me know if you need more information
Richard
0
Andreas Mildenberger
Top achievements
Rank 1
answered on 23 Feb 2011, 03:05 PM
That works fine for showing the whole grid, thanks!

But if I don't want to show the whole grid, there though is a border line around the grid... how can I hide it?
0
Richard Slade
Top achievements
Rank 2
answered on 23 Feb 2011, 03:18 PM
Hello,

Glad that helped.
Regarding the outer border, as per my post and your original obervaton, this unfortunatly seems to have no effect in the current version. I have checked in the Public Issue Tracking system and have not found a record of this as a known issue. If I can find a workaround for this, I'll let you know.

In the meantime, may I ask that you mark the previous reply as answer.
I'll get back to you if I can find a way to turn off the outer table border
Thanks
Richard
0
Martin Vasilev
Telerik team
answered on 28 Feb 2011, 03:53 PM
Hello guys,

It is true that TableBorderThickness property does not work. This issue is related to the pdf conversion library, which we are using. We will investigate this further and improve our export capabilities in one of the next releases. Please excuse us for the inconvenience.

Regards,
Martin Vasilev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Taylor
Top achievements
Rank 1
answered on 25 Nov 2011, 09:34 AM
The last post, from 9 months ago, mentioned that the TableBorderThickness property was broken and would be investigated and corrected in an upcoming release.  It does not appear to be working in recent releases I have tried.  Has this been corrected yet?  If not, is there any workaround?
0
Ivan Petrov
Telerik team
answered on 29 Nov 2011, 05:08 PM
Hi Taylor,

Thank you for writing.

The issue has been addressed and will not be present in our upcoming service pack. There are still, however, some limitations coming from the PDF conversion library, that we use, which would not allow you to set a border thickness of 0. Even if you do so, the border will be drawn with 1 pixel width.

I hope this will be useful. Should you have further questions, I would be glad to help.

Best wishes,
Ivan Petrov
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Taylor
Top achievements
Rank 1
answered on 20 Mar 2012, 08:20 AM
Has this been resolved yet so the entire table can be drawn without a border?
0
Ivan Petrov
Telerik team
answered on 21 Mar 2012, 05:58 PM
Hi Todd,

Thank you for writing.

As I mentioned in my previous post, this limitation comes form the third party conversion library we are using. Currently, we cannot do anything to change its behavior.

If you have other questions, I would be glad to help.

Kind regards,
Ivan Petrov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
KUMARAN
Top achievements
Rank 1
answered on 17 Apr 2015, 04:54 AM

exportPDF.HTMLCellFormatting += new Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exportPDF_HTMLCellFormatting);




void exportPDF_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
{
    e.HTMLCellElement.Styles.Add("border-style", "solid");
}

How to use this code in VB.

0
KUMARAN
Top achievements
Rank 1
answered on 17 Apr 2015, 05:17 AM

I found it.

http://www.telerik.com/forums/export-to-pdf-csv-html 

Thanks.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Apr 2015, 06:31 AM
Hello Kumaran,

Thank you for writing.

You can refer to our Export to PDF help article which includes a VB.NET example as well.

Additionally, feel free to use our online converter which converts code from C# to VB and from VB to C#.

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
GridView
Asked by
Andreas Mildenberger
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Andreas Mildenberger
Top achievements
Rank 1
Martin Vasilev
Telerik team
Taylor
Top achievements
Rank 1
Ivan Petrov
Telerik team
KUMARAN
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or