Erwin Floresca
Top achievements
Rank 1
Erwin Floresca
asked on 18 Jan 2010, 08:59 PM
Hi,
I am trying to display header text in two lines. The first line will have the code and the second line will be description. In order to force the description in second row, I inserted <br> tag between code and description. so my headertext would be something like "MSFT<br>Microsoft". The header text is displayed correctly in the grid. But it breaks when I try to export the grid to pdf. I read in the documentation that we cannot have "<", ">" or any other invalid XHTMl tags. so my question is how can I display the header text in two lines and still be able to export to pdf? Is there any other valid xhtml tag that I can use?
Thanks,
sridhar.
I am trying to display header text in two lines. The first line will have the code and the second line will be description. In order to force the description in second row, I inserted <br> tag between code and description. so my headertext would be something like "MSFT<br>Microsoft". The header text is displayed correctly in the grid. But it breaks when I try to export the grid to pdf. I read in the documentation that we cannot have "<", ">" or any other invalid XHTMl tags. so my question is how can I display the header text in two lines and still be able to export to pdf? Is there any other valid xhtml tag that I can use?
Thanks,
sridhar.
4 Answers, 1 is accepted
0
Hello Erwin,
You could use <p> (paragraph) tags instead of <br>. For more information about the PDF format, please visit this link: PDF export
Let me know if other questions arise.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You could use <p> (paragraph) tags instead of <br>. For more information about the PDF format, please visit this link: PDF export
Let me know if other questions arise.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Erwin Floresca
Top achievements
Rank 1
answered on 19 Jan 2010, 04:05 AM
Thank you. I will try that. I think <br> is invalid tag in XHTML. so first I will try <br /> tag to see if it works.
0
Vaibhav
Top achievements
Rank 1
answered on 21 May 2013, 11:44 AM
exportToPDF() function doesn't work when AutoGenerateColumnsproperty is false for the grid and we use the "GridTemplateColumn". Any solution?
Here's the code:
<rad:RadGrid ID="RadGridCommentsView" OnColumnCreated="RadGrid_ColumnCreated" runat="server"
Style="height:610px; position: absolute; left: 0px; top: 75px;" OnPreRender="RadGrid1_PreRender" ShowHeader ="False"
ShowGroupPanel="false" AutoGenerateColumns="False" ShowFooter="true" MasterTableView-CommandItemSettings-ShowRefreshButton ="false"
MasterTableView-CommandItemDisplay ="None" MasterTableView-CommandItemSettings-ShowAddNewRecordButton ="false" OnItemCommand ="RadGridCommentsView_ItemCommand" >
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true" FileName="Claim Comments Report" HideStructureColumns="true" />
<ClientSettings AllowDragToGroup="true" >
<ClientEvents OnRowDblClick="OnGridRowDblClick" OnColumnResized="ColumnResize"/>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<PagerStyle VerticalAlign="Top" Visible="true" AlwaysVisible ="true" Mode="Slider" ShowPagerText="true" Position ="Top" />
<MasterTableView Width="100%" AutoGenerateColumns="False" CommandItemDisplay="Top" >
<Columns>
<rad:GridBoundColumn DataField="ROW_ID" UniqueName="ROW_ID" Visible="False" >
</rad:GridBoundColumn>
<rad:GridTemplateColumn>
<ItemTemplate>
<table width="70%" cellspacing ="5px">
<tr>
<td colspan ="2">
<b> Subject:</b>
<asp:PlaceHolder runat="server" ID="p1">
<asp:Label ID="lblSubject" runat="server" Text ='<%# Eval("Subject") %>' />
</asp:PlaceHolder>
</td>
</tr>
<tr>
<td>
<b>Date/Time Entered: </b> <asp:Label ID="lblDateEntered" runat="server" Text =' <%#Eval("Date/Time Entered") %>' />
</td>
<td>
<b>Type:</b> <asp:Label ID="lblType" runat="server" Text ='<%# Eval("Type") %>' />
</td>
</tr>
<tr>
<td colspan ="2">
<b> Entered By:</b> <asp:Label ID="lblEnteredBy" runat="server" Text ='<%# Eval("Entered By")%>' />
</td>
</tr>
<tr>
<td colspan ="2">
<b> Comments:</b> <asp:Label ID="lblText" runat="server" Text ='<%# Eval("Text") %>' />
</td>
</tr>
<tr>
<td colspan ="2">
<hr />
</td>
</tr>
</table>
</ItemTemplate>
</rad:GridTemplateColumn>
</Columns>
</MasterTableView>
</rad:RadGrid>
Here's the code:
<rad:RadGrid ID="RadGridCommentsView" OnColumnCreated="RadGrid_ColumnCreated" runat="server"
Style="height:610px; position: absolute; left: 0px; top: 75px;" OnPreRender="RadGrid1_PreRender" ShowHeader ="False"
ShowGroupPanel="false" AutoGenerateColumns="False" ShowFooter="true" MasterTableView-CommandItemSettings-ShowRefreshButton ="false"
MasterTableView-CommandItemDisplay ="None" MasterTableView-CommandItemSettings-ShowAddNewRecordButton ="false" OnItemCommand ="RadGridCommentsView_ItemCommand" >
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true" FileName="Claim Comments Report" HideStructureColumns="true" />
<ClientSettings AllowDragToGroup="true" >
<ClientEvents OnRowDblClick="OnGridRowDblClick" OnColumnResized="ColumnResize"/>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<PagerStyle VerticalAlign="Top" Visible="true" AlwaysVisible ="true" Mode="Slider" ShowPagerText="true" Position ="Top" />
<MasterTableView Width="100%" AutoGenerateColumns="False" CommandItemDisplay="Top" >
<Columns>
<rad:GridBoundColumn DataField="ROW_ID" UniqueName="ROW_ID" Visible="False" >
</rad:GridBoundColumn>
<rad:GridTemplateColumn>
<ItemTemplate>
<table width="70%" cellspacing ="5px">
<tr>
<td colspan ="2">
<b> Subject:</b>
<asp:PlaceHolder runat="server" ID="p1">
<asp:Label ID="lblSubject" runat="server" Text ='<%# Eval("Subject") %>' />
</asp:PlaceHolder>
</td>
</tr>
<tr>
<td>
<b>Date/Time Entered: </b> <asp:Label ID="lblDateEntered" runat="server" Text =' <%#Eval("Date/Time Entered") %>' />
</td>
<td>
<b>Type:</b> <asp:Label ID="lblType" runat="server" Text ='<%# Eval("Type") %>' />
</td>
</tr>
<tr>
<td colspan ="2">
<b> Entered By:</b> <asp:Label ID="lblEnteredBy" runat="server" Text ='<%# Eval("Entered By")%>' />
</td>
</tr>
<tr>
<td colspan ="2">
<b> Comments:</b> <asp:Label ID="lblText" runat="server" Text ='<%# Eval("Text") %>' />
</td>
</tr>
<tr>
<td colspan ="2">
<hr />
</td>
</tr>
</table>
</ItemTemplate>
</rad:GridTemplateColumn>
</Columns>
</MasterTableView>
</rad:RadGrid>
0
Hello Vaibhav,
Please examine the "Exporting HTML tables" section in the following topic:
PDF Export documentation
Regards,
Daniel
Telerik
Please examine the "Exporting HTML tables" section in the following topic:
PDF Export documentation
Regards,
Daniel
Telerik
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.