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

Grid Export to PDF/Excel

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Farshad
Top achievements
Rank 1
Farshad asked on 09 Jun 2012, 11:59 AM
Hi everyone,
Please response to Kassaiefarshad@yahoo.com .

I am using RadGrid in a webpart in Sharepoint 2010.What I want is to export grid's content to Pdf/Excel.
I don't use Ajax in my webpart.
What I have written in RadGrid is as follow:
  <telerik:RadGrid ID="RadGridKnowledgeTopViewed" runat="server"
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
            CellSpacing="0" GridLines="None">
<ClientSettings>
<Selecting CellSelectionMode="None"></Selecting>
</ClientSettings>
<MasterTableView AllowPaging="False" AllowSorting="False" DataKeyNames="Guid">
<CommandItemSettings ExportToPdfText="PDF خروجی" ExportToExcelText="Excel خروجی" ShowAddNewRecordButton="false"
 RefreshText="" ShowExportToExcelButton="true" ShowExportToPdfButton="true"></CommandItemSettings>
     
    <Columns>
        <telerik:GridBoundColumn DataField="KnowledgeTitle"
            FilterControlAltText="Filter KnowledgeTitle column" HeaderText="عنوان دانش"
            SortExpression="KnowledgeTitle" UniqueName="KnowledgeTitle">
            <HeaderStyle Width="500px" />
            <ItemStyle Width="500px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Views"
            FilterControlAltText="Filter Views column" HeaderText="مشاهده ها"
            SortExpression="Views" UniqueName="Views">
            <HeaderStyle Width="70px" />
            <ItemStyle Width="70px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Score"
            FilterControlAltText="Filter Score column" HeaderText="امتیاز"
            SortExpression="Score" UniqueName="Score">
            <HeaderStyle Width="70px" />
            <ItemStyle Width="70px" />
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ExportSettings FileName="KMSTest" IgnorePaging="true" OpenInNewWindow="true">
                <Pdf Author="سیستم مدیریت دانش" Creator="گروه مشاورین هوژان"
                    PageHeight="297mm" PageWidth="210mm" PaperSize="A4" />
</ExportSettings>
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
However, I can not see any button in Grid to export to PDF/Excell.

Any help appreciated.
Farshad Kassaie.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jun 2012, 04:39 AM
Hi Farshad,

Try setting the MasterTableView property CommandItemDisplay to "Top" / "Bottom" / "TopAndBottom".

ASPX:
<MasterTableView AllowPaging="False" AllowSorting="False" DataKeyNames="Guid" CommandItemDisplay="Top">

Thanks,
Shinu.
Tags
Grid
Asked by
Farshad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or