473,378 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Can a PDF file be generated in client side

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 21 '06 #1
3 1545
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.
jb*****@gmail.com 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 '06 #2
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.
jb*****@gmail.com 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 '06 #3
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

Jul 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
3
by: IRAS Blues | last post by:
Hi all, I've got a form that consists of a bunch of textboxes and also file upload inputs. For both sets of fields, I need to be able to add in additional elements on the fly. This is done by an...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: alexttp | last post by:
Introduction: Assume having a MyApp.MyClass class bearing both data (say, DataSets) and functionality (proprietary methods). A WebService exposes this class via some GetMyClass WebMethod. A...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
4
by: Eric Layman | last post by:
HI, Im on dotnet 1.1 I've generated extra checkboxes, textboxes via client side javascript: eg: var inputElement = document.createElement('input'); inputElement.setAttribute('type',...
2
by: andytaw | last post by:
Is there a way to achieve to following: 1) ASP page is loaded to client. 2) User submits form, requesting a file download 3) File is generated and written to response 4) User receives file, saves...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.