Print Page | Close Window

Not able to print

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6631
Printed Date: 03 May 2024 at 3:12am


Topic: Not able to print
Posted By: snufse
Subject: Not able to print
Date Posted: 09 Jun 2009 at 5:49am
I have an ASP application where I print the Crystal Report using a print button. When I run the app on my local PC it prints fine, when I run the app from the server it does not print (but gives me message that document is printed). Aany ideas?
 

Private Sub Print_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Print_Button.Click

Message = PrintDocument()

ASPNET_MsgBox_Alert(Message)

End Sub

 

Public Function PrintDocument() As String

myCrystalReport1 = Session("myCrystalReport1")

Try

myCrystalReport1.PrintToPrinter(1, False, 0, 0)

Message = "Daily Sales Report printed OK"

Catch ex As Exception

Message = "Not able to print document"

End Try

myCrystalReport1 = Session("myCrystalReport1")

CrystalReportViewer1.ReportSource = myCrystalReport1

Return (Message)

End Function




Print Page | Close Window