Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > export to PDF problem

Reply
Thread Tools

export to PDF problem

 
 
Sze
Guest
Posts: n/a
 
      07-08-2010
I got a method to export the report to PDF directly, However, it sometimes
work (export the pdf in 5 secs) but sometimes. (there is dialog box prompt
out and said downloading.........) , and the doc can't export as pdf


Public Sub ExportToCrystalPDF(ByVal Filter As String, ByVal Filename As
String)
Dim Login As New MasterData.Login
Dim rptCount As New
CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
rptCount.Load(Server.MapPath("./Reports/" + Filename + ".rpt"))
' Dim customerFilePath As String =
Server.MapPath("App_Data\FineArtMaster.xsd")
Login.Sub_CrystalLogin(rptCount)

Dim crParameterFieldDefinitions As
CrystalDecisions.CrystalReports.Engine.ParameterFi eldDefinitions =
rptCount.DataDefinition.ParameterFields

' rptCount.RecordSelectionFormula = "TRUE and
{mounting.mounting} = ""Mounting Type 1"""
rptCount.RecordSelectionFormula = Filter
Dim crExportOptions As ExportOptions

crExportOptions = rptCount.ExportOptions
With crExportOptions
.FormatOptions = New PdfRtfWordFormatOptions()
.ExportFormatType = ExportFormatType.PortableDocFormat
End With

Dim req As ExportRequestContext = New ExportRequestContext()
req.ExportInfo = crExportOptions


Dim st As System.IO.Stream

st = rptCount.FormatEngine.ExportToStream(req)

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment; filename= " &
Filename & ".pdf")

Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)

Response.End()
Response.Close()

rptCount.Dispose()
st.Dispose()

End Sub


 
Reply With Quote
 
 
 
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      07-12-2010
Hi,

>I got a method to export the report to PDF directly, However, it sometimes
>work (export the pdf in 5 secs) but sometimes. (there is dialog box prompt
>out and said downloading.........) , and the doc can't export as pdf


To resolve this issue I think first we need to identify whether it's a
server side issue or client side issue.

Could you please set a breakpoint at:

Response.End()

Can the breakpoint be hit when it doesn't work?

In addition, you mentioned "there is dialog box prompt
out and said downloading.........". Could you share a screenshot of that
dialog box?

BTW, which browser are you using?

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
http://www.velocityreviews.com/forums/(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      07-21-2010
Hi,

>I got a method to export the report to PDF directly, However, it sometimes
>work (export the pdf in 5 secs) but sometimes. (there is dialog box prompt
>out and said downloading.........) , and the doc can't export as pdf


Do you have any progress on this issue?

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).


 
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
Export to PDF with google maps + msacces export Maarten Porters Ruby 1 07-28-2008 01:45 PM
Postscript to PDF with pdf-tools, pdf-writer, or other Sean Nakasone Ruby 1 04-14-2008 09:13 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
ReportViewer export to PDF = PDF[1]. Richard Coltrane ASP .Net 1 02-25-2007 11:46 PM
Invalid export DLL or export format =?Utf-8?B?RGF2aWQgVmFsbGU=?= ASP .Net 0 10-29-2003 11:46 AM



Advertisments