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

Export - TemplateColumn

1 Answer 36 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Random asked on 12 Oct 2012, 11:02 AM

I am currently facing a problem with the export functionality of the RadGrid.
In my code i am automatically generating templatecolumns with controls inside (RadTextBox, RadCheckBox, RadComboBox and so on)

On my commanditemtemplate i have 4 buttons to export to PDF, XLS, DOC, CSV.
Everything works as expected in XLS (Format = ExcelML) but it fails on the other.

Problems i am facing are:
1.) PDF, DOC, CSV display a client selection column
2.) PDF, DOC, CSV dont display values from RadTextBox and RadNumericTextBox controls
3.) CSV doesnt display values from RadCheckBox controls

When i change my code to generate ASP TextBoxes (one line of code nothing more changed)...
1.) CSV still doesnt display values but PDF, DOC does
2.) PDF overlaps with client selection box (because width of column is 10 and the word "FALSE" is lager so it overlaps with following column), DOC looks fine

And a question how is it possible to export a grid in any given width to PDF?
XLS, DOC, CSV dont give a **** about the width of the grid but PDF seems to care and the grid overflows on the pagewidth end, and maybe on the pageheight aswell just dont have enough data to get 2 A4s right now

Hope you can help like to be able to export those 4 formats and have the same data result, styling can and will vary by format but atleast the data should be the same.

Btw, the grid on the page works fine - everything is displayed a expected.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 16 Oct 2012, 05:20 PM

There are several ways to avoid overlapping of the columns when exporting to pdf:

1) To make sure that you have an empty space in the text - this way RadGrid will be able to wrap the content in several lines.
2) To reduce the font size / use narrower fonts
3) To decrease the page margins
4) To increase the page size

I prepared a small sample where I set the width between the columns and set the font size to fit on the sheet.

Kind regards,
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question