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
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
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?
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
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
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.
Ivan Petrov
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
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
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.
I found it.
http://www.telerik.com/forums/export-to-pdf-csv-html
Thanks.
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.
Dess
Telerik
See What's Next in App Development. Register for TelerikNEXT.