Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can a PDF file be generated in client side

Reply
Thread Tools

Can a PDF file be generated in client side

 
 
jbeteta@gmail.com
Guest
Posts: n/a
 
      07-21-2006
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!

 
Reply With Quote
 
 
 
 
JustinBlat
Guest
Posts: n/a
 
      07-22-2006
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.


http://www.velocityreviews.com/forums/(E-Mail Removed) 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!


 
Reply With Quote
 
 
 
 
jbeteta@gmail.com
Guest
Posts: n/a
 
      07-22-2006
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.
>
>
> (E-Mail Removed) 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!


 
Reply With Quote
 
=?Utf-8?B?S2ltIEdyZWVubGVl?=
Guest
Posts: n/a
 
      07-22-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Re: Retrieving checkbox state from client-side generated code Eliyahu Goldin ASP .Net 0 05-11-2004 03:35 PM
Adding custom client-side onClick handler with client-side validator controls Zoe Hart ASP .Net Web Controls 1 01-08-2004 10:45 PM



Advertisments