473,385 Members | 1,324 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,385 software developers and data experts.

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

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()
Nov 19 '05 #1
0 1568

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

Similar topics

2
by: Raghu | last post by:
Hi, In my ASP.NET web application project we need to design crystal reports with Crystal Reports version 8.5 enterpraise edition(Please Note:It is not the Crystal Reports that comes with...
0
by: AnitaM | last post by:
In ASP.NET, I want to create a dataset, input it to a Crystal Report, export the report to a pdf file, & test on my local host. The application runs until I open the pdf file in Acrobat when I get...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
0
by: Tony_E | last post by:
Hello I am trying to export a Crystal Report (8.5) out of an ACCESS (2002) function. crxReport.ExportOptions.FormatType = crEFTExcel80 FlPth = "C:\Reports\CrystalReport" & ".xls"...
4
by: Mandar | last post by:
I am trying to export crystal report to pdf. but i am getting folloing error: "Error in File C:\DOCUME~1\MKM-BA~1\ASPNET\LOCALS~1\Temp\temp_0c6b2c59-df8a-4b26-a570-a2189ee212ac.rpt: Access to report...
0
by: Gurmukh | last post by:
Hello, We are working with VB.net and crystal reports with sql server2000 as database,the problem is that when we open a report and export it via default utility in crystal reports it works fine...
7
by: glbdev | last post by:
I have aspnet code (C#) to create a Crystal Report and export to pdf (in browser) without a Crystal Report Viewer. Works great except when the user attempts to save the file from the browser. ...
6
by: Filips Benoit | last post by:
Dear All, All 3 codes, copied from internet, triggers error 429 : ActiveX component can't create object ! No compile error. I have the reference set to Adobe Acrobat 7.0 Type Library I do not...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.