Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal to PDF
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00678283
Message ID:
00678322
Views:
12
What is the size of the PDF you are trying to send to the client? PDFs can get quite large so the time it takes could be just trying to send a large file.

>I have an asp.net application that creates a crystal report from a dataset in asp.net. After creating the report, I export the crystal report to pdf. The environment the application resides in is a win2k advanced server running the latest iis in a clustered environment. The data is populated via a win2k sql cluster. My problem is that it runs very fast in my test environment but so slow in the production environment that it times out.
>The test environment is a single web server w/ the sql server on it as well. Here is a snippet of code:
>
>
>
>'CREATE THE CRYSTAL REPORT THEN EXPORT TO PDF
> Dim intUniqueNumber As Int32
> intUniqueNumber = objFunctions.GetUniqueValue
> Dim oRpt As New VertCrystal2()
>
> ' This is the Crystal Report file created at Design Time
> oRpt.SetDataSource(pobjDS)
> ' Set the SetDataSource property of the Report to the Dataset
> CrystalReportViewer1.ReportSource = oRpt
>
>
> 'Note : we are creating an instance of the strongly-typed Crystal Report file here.
>
> Dim DiskOpts As CrystalDecisions.Shared.DiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions()
>
> Try
> oRpt.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
> ' You also have the option to export the report to other sources
> ' like Microsoft Exchange, MAPI, etc.
> oRpt.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
> 'Here we are exporting the report to a .pdf format. You can
> ' also choose any of the other formats specified above.
> DiskOpts.DiskFileName = "c:\inetpub\wwwroot\print\docs\report" & Session("FileName") & ".pdf"
> 'If you do not specify the exact path here (i.e. including
> ' the drive and Directory),
> 'then you would find your output file landing up in the
> 'c:\WinNT\System32 directory - atleast in case of a
> ' Windows 2000 System
> oRpt.ExportOptions.DestinationOptions = DiskOpts
> oRpt.Export()
> strReport = "c:\inetpub\wwwroot\print\docs\report" & Session("FileName")
>
> 'Clear previous objects from memory
>
> Response.ClearContent()
> Response.ClearHeaders()
> Response.ContentType = "application/pdf"
> Response.WriteFile(strReport & ".pdf")
> Response.Expires = 0
> Response.Flush()
> Response.Close()
> System.IO.File.Delete(strReport & ".pdf")
>
> objFunctions.SetViewedFlag(Session("FileName"))
>
> Catch err As Exception
> End Try
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform