in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Export to PDF via link on webpage and set PDF filename?

Last post 11/17/2008 9:38 AM by George (Developer Express). 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 12/27/2007 10:17 AM

    Export to PDF via link on webpage and set PDF filename?

    We are doing the following via a link on out website to allow iusers to create a PDF export of a report:
     ReportViewer1.WritePdfTo(Page.Response)

    Is there anyway we can set the PDF filename that is created?  Right now is jsut has the name of out page VoucherExport.PDF which it gets from the aspx page name.

     

    Edit: I would also prefer if it would open as a save/open dialog instead so that the user has the choice to view or save it.  Is there anyway to do this?

  • 12/29/2007 4:43 AM In reply to

    Re: Export to PDF via link on webpage and set PDF filename?

    Hello Mark,

    If you're using XtraReports v2007 vol 3, you may try to do the following:

    1. Set the ReportViewer.ClientInstanceName to "MyReportViewer"
    2. Execute this code on the client:
    MyReportViewer.SaveToDisk("PDF");

    For example, the following aspx demonstrates two buttons (standard and DevExpess ASPxButton), which perform your task:

    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp;<dxe:ASPxButton ID="ASPxButton1" runat="server" Text="ASPxButton" AutoPostBack="False" EnableClientSideAPI="True">
                <ClientSideEvents Click="function(s, e) {
     MyReportViewer.SaveToDisk(&quot;PDF&quot;);
    }" />
            </dxe:ASPxButton>
            <asp:Button ID="Button1" runat="server" OnClientClick='MyReportViewer.SaveToDisk("PDF");  return false;'
                Text="Button" /><br />
            <br />
            <dxxr:ReportViewer ID="ReportViewer1" runat="server" Report="<%# new WebApplication3.XtraReport1() %>"
                ReportName="WebApplication3.XtraReport1" ClientInstanceName="MyReportViewer">
            </dxxr:ReportViewer>
       
        </div>
        </form>
    </body>

    Does this help you?

    @.
    R&D, .NET Team.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.
  • 11/17/2008 8:29 AM In reply to

    • Peter1973
    • Not Ranked
    • Joined on 11/17/2008
    • Lem St., Denmark
    • Posts 1

    Re: Export to PDF via link on webpage and set PDF filename?

    Hi

    What can I do, if I don't want the Save/Open dialog to appear?

    Kind Regards

    Peter Larsen
    Application Developer

    Kind regards

    Peter Larsen
    Application Developer
  • 11/17/2008 9:38 AM In reply to

    Re: Export to PDF via link on webpage and set PDF filename?

    Hi Peter,

    In this regard you can use the SaveToWindow method (via the appropriate ReportToolbar's button). Or, if this doesn't meet your needs, please describe your requirements in greater detail.

    R&D, .NET Team.

    PS. If you wish to receive direct assistance from our Support Team, use Support Center at http://www.devexpress.com/sc.
Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED