Crystal Reports.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! there,

I am currently working on web-based reports using crystal reports.NET 2003
and I am new to this reporting tool. I notice that the WEB forms report
viewer toolbar does not include the 'PRINT' button, in which users can
specify the print layout - portrait or landscape. Does anybody know how to
add a 'PRINT' button to the web forms report viewer toolbar?

Any help would be GREATLY appreciated!

Jeannette
 
Additional Question:

How can I add the export functionality to the WEB forms report viewer
toolbar so that users can readily export any report to .xls, .rtf, etc.?

Thanks in advance!

Jeannette
 
what i did was add my own buttons to my report page . one buttons says export
to pdf, another says export to excel. i don't think crystal has a print icon
for it's meb menu (although i could be wrong.)


here's my to_pdf sub
Private Sub to_pdf()
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestination As
CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
Dim rptName As String

Dim crReport As Object

'create a new open sales order report
crReport = New OpenSalesOrders

crReport.SetDatabaseLogon 'removed user database login

'setting the viewer to the sales report
Me.CrystalReportViewer1.ReportSource = crReport


'exports file to disk in PDF format
myExportFile = "C:\" & rptName & "." &
Request.ServerVariables("REMOTE_HOST") & ".pdf"
myDiskFileDestination = New
CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestination.DiskFileName = myExportFile

myExportOptions = crReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestination
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With

crReport.Export()

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.AppendHeader("content-disposition", "attachment; filename="
& rptName & Replace(Now.Date(), "/", ".") & ".pdf")

Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()

End Sub

hope that helps.
 
Back
Top