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

Export asp:Repeater including RadHtmlChart and RadGrid to Excel

4 Answers 167 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
Antoine
Top achievements
Rank 1
Antoine asked on 31 May 2013, 07:35 AM
Hi Telerik Team,
How to Export asp:Repeater including RadHtmlChart and RadGrid to Excel in C# in Code Behind or JQUERY?
I am trying to export some data to Excel and my code is as below:
<asp:Repeater ID="repeaterStandardQuestion" runat="server" OnItemDataBound="repeaterStandardQuestion_ItemDataBound">
    <ItemTemplate>
        <div style="border: solid">
            <table>
                <tr>
                    <td>
                        <div style="text-align: left">
                            <asp:Label ID="lblTitleStandardQuestion" runat="server" />
                        </div>
                        <telerik:RadHtmlChart runat="server" ID="radHtmlChartStandardQuestion" Transitions="true" Width="400px" Height="200px" RegisterWithScriptManager="true">
                            <PlotArea>
                                <Series>
                                    <telerik:BarSeries Name="Average" DataFieldY="PercentageAccepted">
                                        <TooltipsAppearance DataFormatString="{0:##.##}%"></TooltipsAppearance>
                                        <LabelsAppearance DataFormatString="{0:##.##}%" Position="Center"></LabelsAppearance>
                                        <Appearance FillStyle-BackgroundColor="LightBlue"></Appearance>
                                    </telerik:BarSeries>
 
                                </Series>
                                <XAxis DataLabelsField="Name">
                                    <MajorGridLines Visible="false" />
                                    <MinorGridLines Visible="false" />
                                </XAxis>
                                <YAxis MaxValue="100">
                                    <LabelsAppearance DataFormatString="{0:#}%"></LabelsAppearance>
                                    <MinorGridLines Visible="false"></MinorGridLines>
                                    <MajorGridLines Visible="false" />
                                </YAxis>
                            </PlotArea>
                            <Legend>
                                <Appearance Position="Bottom" Visible="false" />
                            </Legend>
                        </telerik:RadHtmlChart>
                    </td>
                    <td>
                        <telerik:RadGrid ID="radGridStandardQuestion" runat="server" AutoGenerateColumns="false" Width="200px">
                            <MasterTableView>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Name" HeaderText="Answer Choices" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="Responses" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate>
                                            <%#GetPercentage( Convert.ToDouble(Eval("PercentageAccepted"))) %>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="NumberAccepted" HeaderText=""></telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
        </div>
        <br />
    </ItemTemplate>
</asp:Repeater>

Regards
Antoine Sweid

4 Answers, 1 is accepted

Sort by
0
SamaR
Top achievements
Rank 1
answered on 31 May 2013, 07:41 AM
Hey colleague,
I hope u can find solution as soon as possible..
Good luck and never Give up :)
0
SamaR
Top achievements
Rank 1
answered on 31 May 2013, 07:42 AM
Hey colleague,
I hope u can find solution for ur prob as soon as possible,
gd luck and never give up
0
Slav
Telerik team
answered on 04 Jun 2013, 09:20 PM
Hello Antoine,

The RadGrid supports Excel export as you can check in this online demo. Nevertheless, this will export the data from a particular grid control. Your scenario will require custom implementation, since it has to include all the data from the grids and the charts in the repeater control. The following resources could be useful for achieving the desired functionality:
 - Import and Export Excel - What is the best library?
 - How can i export Data to Excel file

Regards,
Slav
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.
0
Antoine
Top achievements
Rank 1
answered on 05 Jun 2013, 11:50 AM
Thank you Telerik Team for your reply

Antoine
Tags
AJAX and Web 2.0
Asked by
Antoine
Top achievements
Rank 1
Answers by
SamaR
Top achievements
Rank 1
Slav
Telerik team
Antoine
Top achievements
Rank 1
Share this question
or