E
emarvets
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(ExportFormatType.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(ExportFormatType.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
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(ExportFormatType.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(ExportFormatType.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