Export asp:Repeater including RadHtmlChart and RadGrid to Excel

5 posts, 0 answers
  1. Antoine
    Antoine avatar
    2 posts
    Member since:
    May 2013

    Posted 31 May 2013 Link to this post

    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
  2. SamaR
    SamaR avatar
    2 posts
    Member since:
    May 2013

    Posted 31 May 2013 Link to this post

    Hey colleague,
    I hope u can find solution as soon as possible..
    Good luck and never Give up :)
  3. SamaR
    SamaR avatar
    2 posts
    Member since:
    May 2013

    Posted 31 May 2013 Link to this post

    Hey colleague,
    I hope u can find solution for ur prob as soon as possible,
    gd luck and never give up
  4. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 04 Jun 2013 Link to this post

    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.
  5. Antoine
    Antoine avatar
    2 posts
    Member since:
    May 2013

    Posted 05 Jun 2013 Link to this post

    Thank you Telerik Team for your reply

    Antoine
Back to Top