3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 07 Apr 2009, 04:30 AM
Hello Tayonee,
It is possible to modify the data before exporting to PDF. See the example;
CS:
If you need additional data as title, then you can use Caption or CommandItemTemplate for that. Also refer the link for more information about Exporting tips and tricks
Thanks,
Shinu.
It is possible to modify the data before exporting to PDF. See the example;
CS:
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
| { |
| if (item["CategoryID"].Text == "1") |
| { |
| item["Description"].Text = "Modified"; |
| } |
| } |
| RadGrid1.ExportSettings.OpenInNewWindow = true; |
| RadGrid1.MasterTableView.ExportToPdf(); |
| } |
If you need additional data as title, then you can use Caption or CommandItemTemplate for that. Also refer the link for more information about Exporting tips and tricks
Thanks,
Shinu.
0
Tayonee
Top achievements
Rank 1
answered on 07 Apr 2009, 01:03 PM
Thanks for the response. I cannot get the CommandItemTemplate working. The text in the CommandItemTemplate region never shows up in the pdf. Here is my code:
<telerik:RadGrid ID="grdSearchResults" runat="server" AutoGenerateColumns="False" DataSourceID="sqlUserDetail" AllowPaging="true" PageSize="20"
GridLines="None" AllowMultiRowSelection="true" AllowSorting="true">
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="false">
<Pdf AllowAdd="true" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"
Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" PageTitle="Practicioner export document"
Subject="Practicioner Export" Title="Practicioner export" PaperSize="Letter" />
</ExportSettings>
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>
<MasterTableView DataSourceID="sqlUserDetail" DataKeyNames="UserID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<CommandItemTemplate>
Test additional data
</CommandItemTemplate>
Also how do you add data to the pdf (I'm guessing that is what the AllowAdd property is for).
<telerik:RadGrid ID="grdSearchResults" runat="server" AutoGenerateColumns="False" DataSourceID="sqlUserDetail" AllowPaging="true" PageSize="20"
GridLines="None" AllowMultiRowSelection="true" AllowSorting="true">
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="false">
<Pdf AllowAdd="true" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"
Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" PageTitle="Practicioner export document"
Subject="Practicioner Export" Title="Practicioner export" PaperSize="Letter" />
</ExportSettings>
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>
<MasterTableView DataSourceID="sqlUserDetail" DataKeyNames="UserID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<CommandItemTemplate>
Test additional data
</CommandItemTemplate>
Also how do you add data to the pdf (I'm guessing that is what the AllowAdd property is for).
0
Princy
Top achievements
Rank 2
answered on 08 Apr 2009, 04:24 AM
Hi Tayonee,
Have you set the CommandItemDisplay property to Top? If not try setting it as shown below.
ASPX:
Thanks
Princy
Have you set the CommandItemDisplay property to Top? If not try setting it as shown below.
ASPX:
| <MasterTableView CommandItemDisplay="Top" > |
Thanks
Princy