Asked by:
Crystal Report Print in ASP.NET but not printing in IIS

Question
-
User988552829 posted
Hello everybody! I have deploy asp.net visual basic 2005 in IIS 5.1. It working fine in the project asp.net but when I publish it in IIS 5.1 and print to printer it show message box ok but nothing print out.
Tuesday, December 10, 2013 10:40 PM
All replies
-
User1815411410 posted
this issue is actualy resolved on IIS6 or higher.
I would recommend you to upgrade your system.Wednesday, December 11, 2013 3:05 AM -
User988552829 posted
I try to test in IIS 7 too like u said but still the same problem. any tip ?
Wednesday, December 11, 2013 8:42 PM -
User-1185172246 posted
I guess that your printing code (that you have not posted here) is trying to print by using ASP.NET/VB code. Problem is that ASP.NET code runs/executes at server side machine NOT at the client machine. So when you test it in your own machine, where it acts as the server AND as the client at the same time, your works flawlesslly. But when you deploy it to a real server (IIS any version), your code will try to print to any printer available at the server NOT at the client machine.
So, if you want to print the content of your page (HTML) then using simple javascript window.print() and for other more advanced scenarios (like printing PDF, DOC, XLS, or raw printer commands) then you might need some help from an external tool.
Thursday, December 12, 2013 5:37 AM -
User1815411410 posted
hi there,
can you please try to post the issue/error here?Thursday, December 12, 2013 11:06 PM -
User988552829 posted
Here is code that run no error with can print in project but in iis nothing print only message box ok
Dim Params As New Hashtable Params.Add("@UserName", CurrentUser.UserName.ToUpper) Params.Add("@TableID", TableID) Params.Add("@Printer", "KITCHEN_1") Params.Add("@Language", ViewState("SelectedLang")) Dim _rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = Nothing Try _rpt = CrystalReportHelper.GetReport(HttpContext.Current.Server.MapPath("~/") & "Kitchen.rpt", Params) Dim strFileName As String = IO.Path.GetTempPath & "Kitchen.pdf" _rpt.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, strFileName) _rpt.PrintOptions.PrinterName = Database.GetLoookup("Value", "KITCHEN_1", "Description", "_Listings", True) _rpt.PrintToPrinter(1, 1, 1, 1) Msg.ShowMessage("ការកុម្មង់ត្រូវបានបញ្ជូនទៅផ្ទះបាយ!", MsgTitle) Catch ex As Exception Msg.ShowMessage("ការកុម្មង់មិនត្រូវបានបញ្ជូនទៅផ្ទះបាយទេ!" & vbCrLf & ex.Message, MsgTitle) Finally _rpt.Close() _rpt.Dispose() End Try
Friday, December 13, 2013 2:00 AM -
Saturday, December 14, 2013 12:18 AM