.NETGURU
Export Crystal Report to PDF
Messages   Related Types
This message was discovered on microsoft.public.dotnet.academic.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Steve Walker (VIP)
When I view my report in html the SelectionFormula which contains a start date and end date works fine, I get back a report with the date range. When I export to PDF the formula does not work.

Code below:

Dim crpt As New DQIUnitFees
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo

crpt = New DQIUnitFees

Dim StartDt As String
Dim EndDt As String

StartDt = "6/1/2004"
EndDt = "6/30/2004"

CrystalReportViewer1.SelectionFormula = "{vw_accounts_receivables_rpt.Invoice Date} = (CDateTime ('" & (StartDt) & "') to CDateTime ('" & (EndDt) & "')) "

For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "arits"
myLogin.ConnectionInfo.UserID = "arits"
myTable.ApplyLogOnInfo(myLogin)
Next

CrystalReportViewer1.ReportSource = crpt

Dim s As System.IO.MemoryStream = CType(crpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.IO.MemoryStream)

Response.Clear()

Response.Buffer = True

Response.ContentType = "application/pdf"

Response.BinaryWrite(s.ToArray())

Response.End()

s.Close()
s = Nothing
Reply to this message...
 
    
Steve Walker (VIP)
I figured it out, I was passing the viewer the date range but not the variable I was using for the memory stream.

By adding this code it fixed the problem.

crpt.RecordSelectionFormula = CrystalReportViewer1.SelectionFormula

- Steve

"Steve Walker" wrote:

[Original message clipped]

Reply to this message...
 
    
wkidd
I've found that export from Crystal Reports to any file format does not work
perfectly. In some cases, the output is so mangled that I would descrive it
as non-functional.

I now use a PDF print driver. Once installed, just print your report to the
special print driver and the job will export perfectly to a pdf file.
Another advantage is that you can use it to image documents from any
document, not just Crystal.
http://www.pdf995.com/

Adobe Distiller is another similar product.

WKidd

"Steve Walker" <Steve Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> When I view my report in html the SelectionFormula which contains a start
date and end date works fine, I get back a report with the date range. When
I export to PDF the formula does not work.
[Original message clipped]

"') to CDateTime ('" & (EndDt) & "')) "
[Original message clipped]

ocFormat), System.IO.MemoryStream)
[Original message clipped]

Reply to this message...
 
 
System.IO.MemoryStream




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification