Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Export Crystal Report to PDF and open it in Acrobat Reader instead of Internet Explorer

Reply
Thread Tools

Export Crystal Report to PDF and open it in Acrobat Reader instead of Internet Explorer

 
 
Dave
Guest
Posts: n/a
 
      12-15-2004
Is this possible? Here is my current code (which opens the pdf in Internet
Explorer)

Dim crReportDocument As
CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Dim crExportOptions As CrystalDecisions.shared.ExportOptions
Dim crDiskFileDestinationOptions As
CrystalDecisions.shared.DiskFileDestinationOptions
Dim Fname As String
crReportDocument = New
CrystalDecisions.CrystalReports.Engine.ReportDocum ent
crReportDocument.Load("C:\Inetpub\wwwroot\SAFDB\Jo bHoursReport.rpt")
Try
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

For Each tbCurrent In crReportDocument.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "NOVAPRJ"
.UserID = "sa"
.Password = "sa"
.DatabaseName = "NSSApplication"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
Catch ex As Exception
Response.Write(ex.Message)
Finally
End Try

Dim StartYear As Integer
Dim StartMonth As Integer
Dim StartDay As Integer
Dim EndYear As Integer
Dim EndMonth As Integer
Dim EndDay As Integer

crReportDocument.Refresh()
Fname = "c:\Reports\" & Session.SessionID.ToString & ".pdf"
crDiskFileDestinationOptions = New
CrystalDecisions.shared.DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.Disk File
.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableD ocFormat
End With
crReportDocument.Export()
' The following code writes the pdf file to the Client's browser.
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
'Response.WriteFile(Fname)
Response.Redirect(Fname)
Response.Flush()
Response.Close()
Response.ClearContent()
Response.End()
System.IO.File.Delete(Fname)
crReportDocument.Close()


 
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
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
acrobat reader/ yahoo toolbar; foxit pdf reader akiwi NZ Computing 1 03-28-2005 07:10 AM
FAIL TO LOAD THE CRYSTAL REPORT USING WEB CRYSTAL REPORT VIEWER Comfort ASP .Net Web Controls 0 10-18-2004 01:35 PM
Export from crystal report to pdf =?Utf-8?B?TWFuZGFy?= ASP .Net 4 08-12-2004 10:51 PM
Export PDF from Crystal Report .NET using ASP.NET =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?= ASP .Net 0 02-05-2004 05:26 PM



Advertisments