473,804 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 crReportDocumen t As
CrystalDecision s.CrystalReport s.Engine.Report Document
Dim crExportOptions As CrystalDecision s.shared.Export Options
Dim crDiskFileDesti nationOptions As
CrystalDecision s.shared.DiskFi leDestinationOp tions
Dim Fname As String
crReportDocumen t = New
CrystalDecision s.CrystalReport s.Engine.Report Document
crReportDocumen t.Load("C:\Inet pub\wwwroot\SAF DB\JobHoursRepo rt.rpt")
Try
Dim tbCurrent As CrystalDecision s.CrystalReport s.Engine.Table
Dim tliCurrent As CrystalDecision s.Shared.TableL ogOnInfo

For Each tbCurrent In crReportDocumen t.Database.Tabl es
tliCurrent = tbCurrent.LogOn Info
With tliCurrent.Conn ectionInfo
.ServerName = "NOVAPRJ"
.UserID = "sa"
.Password = "sa"
.DatabaseName = "NSSApplication "
End With
tbCurrent.Apply LogOnInfo(tliCu rrent)
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

crReportDocumen t.Refresh()
Fname = "c:\Reports \" & Session.Session ID.ToString & ".pdf"
crDiskFileDesti nationOptions = New
CrystalDecision s.shared.DiskFi leDestinationOp tions
crDiskFileDesti nationOptions.D iskFileName = Fname
crExportOptions = crReportDocumen t.ExportOptions
With crExportOptions
.DestinationOpt ions = crDiskFileDesti nationOptions
.ExportDestinat ionType =
CrystalDecision s.Shared.Export DestinationType .DiskFile
.ExportFormatTy pe =
CrystalDecision s.Shared.Export FormatType.Port ableDocFormat
End With
crReportDocumen t.Export()
' The following code writes the pdf file to the Client's browser.
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
'Response.Write File(Fname)
Response.Redire ct(Fname)
Response.Flush( )
Response.Close( )
Response.ClearC ontent()
Response.End()
System.IO.File. Delete(Fname)
crReportDocumen t.Close()
Nov 19 '05 #1
0 1585

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

Similar topics

2
3735
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 VisualStudio.NET). Also the Crsyatl Report software 8.5 version will not be installed in the IIS web server which is hosting my ASP.NET web application. It will be installed in a different server which has .net and IIS 5.0.
0
1471
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 the following message: Acrobat could not open MyReport.pdf.pdf because it is either not a supported file type or because the file has been corrupted (for example it was sent as an email attachment and wasn’t correctly decoded). Does anyone...
16
11884
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. I can do this individually for each graph but this does not help me as I need both on the same JPEG. I thought I would try an export the form that contains both but I am having trouble. (My VBA is self taught and a little knowledge is...
6
13145
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 spreadsheet. I'm having trouble with my code at the point at which it hits ".ReadRecords" -- the module just runs and runs without generating anything. I've gotten this code to correctly save .rpt files without any data, but not with data, nor have I been...
0
1795
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" crxReport.ExportOptions.DiskFileName = FlPth It gives me an error message on the below line
4
3756
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 file denied. Another program may be using it." It works with other reports but not this one. Code using for export: Dim myExportOptions As CrystalDecisions.Shared.ExportOptions Dim myDiskFileDestinationOptions As...
0
1113
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 but once we close that report and open report again it gives error on line where we load the report?? Gives error as loadsave reportexception: load report failed. If we reopen the application it works fine only once it doesn't open
7
3382
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. In the "Save a copy ..." dialog box the filename defaults to the name of aspx page. I need it to default to a custom report name. How can I specify the new file name in aspnet and pass it to the new PDF page? Thanks for the help,
6
20456
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 have the full version of Adobe Reader 7.0 ! The final goal is to print a PDF-file from access after selecting the file in a browser.
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.