locked
Export to CSV and PDF. RRS feed

  • Question

  • User1556928295 posted

    Without having to re-load the Crystal Report. Is there a way to export the CrystalReportViewer to a PDF or CSV file. I've seen code that you have to create a new instance and then you have to pass all the parameters over again,  but the report is already displayed in the CrystaReportViewer, so why would you have to re-create it all over again?

    I have this so far;

                            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
                                DisplayGroupTree="False" DisplayToolbar="False" EnableDatabaseLogonPrompt="False"
                                EnableParameterPrompt="False" ReuseParameterValuesOnRefresh="True" ReportSourceID="CrystalReportSource1"
                                Style="text-align: left" BestFitPage="False" BackColor="#ECE9D8" Visible="False" />
                            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                                <Report FileName="~\Reports\cryVls1a34.rpt">
                                </Report>
                            </CR:CrystalReportSource>

                                        <asp:DropDownList ID="ddlEportFormat" runat="server" AutoPostBack="True">
                                          <asp:ListItem>-- Select Export Format --</asp:ListItem>
                                            <asp:ListItem>Portable Document (PDF)</asp:ListItem>
                                            <asp:ListItem>MS Word (DOC)</asp:ListItem>
                                            <asp:ListItem>MS Excel (XLS)</asp:ListItem>
                                            <asp:ListItem>Comma Seperated Values (CSV)</asp:ListItem>
                                        </asp:DropDownList>

    When the user selects the file type, I want to export the crystal report.

    Monday, April 21, 2014 2:16 PM

Answers

  • User1243880387 posted

    So far I have not seen any automatic export of crystal report using code.

    You can load report in pdf format on the event of the selection of the items. There is some mode property, but not sure if it will be something you want.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 9, 2014 8:14 AM