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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only