Can a PDF file be generated in client side

Discussion in 'ASP .Net' started by jbeteta@gmail.com, Jul 22, 2006.

  1. Guest

    Hello,

    My ASP.NET 2003 application generates Crystal Reports to PDF files, but
    on the server side.
    Is it possible to create these PDF files in CLIENT side?

    Here is my function to create PDF files on server side:

    Private Function To_PDF(ByVal oRpt As ReportClass)
    PDFName = Session.SessionID + ".pdf"
    'oRpt.Load()
    'oRpt.SetParameterValue("param1", strMensajeRep)
    Dim exportOpts As ExportOptions = oRpt.ExportOptions
    oRpt.ExportOptions.ExportFormatType =
    ExportFormatType.PortableDocFormat
    oRpt.ExportOptions.ExportDestinationType =
    ExportDestinationType.DiskFile
    oRpt.ExportOptions.DestinationOptions = New
    DiskFileDestinationOptions
    CType(oRpt.ExportOptions.DestinationOptions,
    DiskFileDestinationOptions).DiskFileName = Server.MapPath("../Temp/" +
    PDFName)
    oRpt.Export()
    oRpt.Close()
    oRpt.Dispose()
    Dim popupScript As String = "<script>window.open('../Temp/" +
    PDFName +
    "','_self','menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes')</script>"
    Page.RegisterStartupScript("PopupScript", popupScript)

    End Function

    Thank you!
     
    , Jul 22, 2006
    #1
    1. Advertising

  2. JustinBlat Guest

    I doubt there is really anything you could do on the client completely.
    If you're just trying to avoid the postback, you could always make an
    xmlhttp call to the server and return this code, or load the PDF page
    in an iframe.


    wrote:
    > Hello,
    >
    > My ASP.NET 2003 application generates Crystal Reports to PDF files, but
    > on the server side.
    > Is it possible to create these PDF files in CLIENT side?
    >
    > Here is my function to create PDF files on server side:
    >
    > Private Function To_PDF(ByVal oRpt As ReportClass)
    > PDFName = Session.SessionID + ".pdf"
    > 'oRpt.Load()
    > 'oRpt.SetParameterValue("param1", strMensajeRep)
    > Dim exportOpts As ExportOptions = oRpt.ExportOptions
    > oRpt.ExportOptions.ExportFormatType =
    > ExportFormatType.PortableDocFormat
    > oRpt.ExportOptions.ExportDestinationType =
    > ExportDestinationType.DiskFile
    > oRpt.ExportOptions.DestinationOptions = New
    > DiskFileDestinationOptions
    > CType(oRpt.ExportOptions.DestinationOptions,
    > DiskFileDestinationOptions).DiskFileName = Server.MapPath("../Temp/" +
    > PDFName)
    > oRpt.Export()
    > oRpt.Close()
    > oRpt.Dispose()
    > Dim popupScript As String = "<script>window.open('../Temp/" +
    > PDFName +
    > "','_self','menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes')</script>"
    > Page.RegisterStartupScript("PopupScript", popupScript)
    >
    > End Function
    >
    > Thank you!
     
    JustinBlat, Jul 22, 2006
    #2
    1. Advertising

  3. Guest

    I asked this question because we have a web application which users can
    run a Crystal Report and then
    generate a PDF file (on server side, of course). BUT... I think that
    many users using this functionality at the same time a lot of times,
    can reduce performance of the web server significatively. How could I
    avoid that, giving at the same time the chance to create PDF files?

    JustinBlat wrote:
    > I doubt there is really anything you could do on the client completely.
    > If you're just trying to avoid the postback, you could always make an
    > xmlhttp call to the server and return this code, or load the PDF page
    > in an iframe.
    >
    >
    > wrote:
    > > Hello,
    > >
    > > My ASP.NET 2003 application generates Crystal Reports to PDF files, but
    > > on the server side.
    > > Is it possible to create these PDF files in CLIENT side?
    > >
    > > Here is my function to create PDF files on server side:
    > >
    > > Private Function To_PDF(ByVal oRpt As ReportClass)
    > > PDFName = Session.SessionID + ".pdf"
    > > 'oRpt.Load()
    > > 'oRpt.SetParameterValue("param1", strMensajeRep)
    > > Dim exportOpts As ExportOptions = oRpt.ExportOptions
    > > oRpt.ExportOptions.ExportFormatType =
    > > ExportFormatType.PortableDocFormat
    > > oRpt.ExportOptions.ExportDestinationType =
    > > ExportDestinationType.DiskFile
    > > oRpt.ExportOptions.DestinationOptions = New
    > > DiskFileDestinationOptions
    > > CType(oRpt.ExportOptions.DestinationOptions,
    > > DiskFileDestinationOptions).DiskFileName = Server.MapPath("../Temp/" +
    > > PDFName)
    > > oRpt.Export()
    > > oRpt.Close()
    > > oRpt.Dispose()
    > > Dim popupScript As String = "<script>window.open('../Temp/" +
    > > PDFName +
    > > "','_self','menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes')</script>"
    > > Page.RegisterStartupScript("PopupScript", popupScript)
    > >
    > > End Function
    > >
    > > Thank you!
     
    , Jul 22, 2006
    #3
  4. You can off load the pdf creation and possibly the report generation onto a
    compute grid. This gets the computation off your web servers.

    Here is a link to a case study that is very similar to your situation (no
    Crystal Report generation, but PDF conversion):
    http://www.digipede.net/products/case_pacevents.html

    And here is a link to a free Digipede Network Developer Edition:
    http://www.digipede.net/products/dev-edition.html that you can use to test
    the solution.

    Kim Greenlee

    --
    digipede - Many legs make light work.
    Grid computing for the real world.
    http://www.digipede.net
    http://krgreenlee.blogspot.net
     
    =?Utf-8?B?S2ltIEdyZWVubGVl?=, Jul 22, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boss302
    Replies:
    0
    Views:
    1,056
    Boss302
    Nov 21, 2006
  2. Bogdan
    Replies:
    2
    Views:
    655
    Bogdan
    Jun 9, 2008
  3. Zoe Hart
    Replies:
    1
    Views:
    373
    Scott Wisniewski
    Jan 8, 2004
  4. Ricardo Pog
    Replies:
    1
    Views:
    437
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    384
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page