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

Crystal Report Export to PDF Inline Fails

I am working (unsuccessfully) with Crystal XI. I create a report and
export it to pdf. It works fine when I set it to an attachment, but
nothing appears to happen when I switch over to inline. Here is my
code:
Dim CRLeaveSlip As New LeaveSlip
CRLeaveSlip.SetDataSource(MasterDataSet)

Dim s As MemoryStream

s =
DirectCast(CRLeaveSlip.ExportToStream(ExportFormat Type.PortableDocFormat),
MemoryStream)

Page.Visible = False
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Response.AppendHeader("content-length",
s.Length.ToString())
Response.AppendHeader("content-disposition", "inline;
filename=LeaveSlip.pdf")
Response.BinaryWrite(s.ToArray)
Response.Flush()
Response.Close()
Response.End()

This works fine but as an attachment:
Dim CRLeaveSlip As New LeaveSlip
CRLeaveSlip.SetDataSource(MasterDataSet)

Dim s As MemoryStream

s =
DirectCast(CRLeaveSlip.ExportToStream(ExportFormat Type.PortableDocFormat),
MemoryStream)
Page.Visible = False
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Response.AppendHeader("content-length",
s.Length.ToString())
Response.AppendHeader("content-disposition", "attachment;
filename=LeaveSlip.pdf")
Response.BinaryWrite(s.ToArray)
Response.Flush()
Response.Close()
Response.End()
A couple of other things I noted while bashing my head against a brick
wall:

The AcroRd32.exe process starts when the inline page is sent to the
browser, even though the page never appears to change
IE reports "Downloaded 0KB" in the bottom left of the screen in the
status bar

Setting the content-encoding to gzip sets IE to a blank page

Any help is greatly appreciated,

Eric Marvets
Visual Developer, Security MVP

Mar 29 '06 #1
0 1245

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

Similar topics

1
by: Stephanie Stowe | last post by:
I am doing a support rotation for our massive ASP app. We use Crystal Reports / Enterprise. By some magic which I am unfamiliar with Crystal Enterprise allows the creation of a report on the...
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...
1
by: John | last post by:
Hi. Sir: Does anyboday know how to export subreport data using the export button in crystal report tool bar? We have a main report including a on-demand report. When we click the on-demand...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
1
by: CBKowitz | last post by:
I have an intermittent problem, when viewing a crystal report. This problem only happens to some users and some report formats. When they try to view the report in Microsoft Word format the...
0
by: adamz5 | last post by:
I am currently exporting a crystal report using code. This works fine and exports the report to a word document onto disk using DiskFileDestinationOptions() and ExportOptions However when i...
9
by: Altman | last post by:
I am currently using ASP.Net 2003 and will be upgrading to 2005 sometime in the near future. I have been having issues with using Crystal Reports that were included with .Net to handle my...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.