Crystal Report Printtoprinter Error
Contents |
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference
Crystal Report Viewer Print To Printer
Dev centers Retired content Samples We’re sorry. The content you requested has print to printer crystal report c# been removed. You’ll be auto redirected in 1 second. Designing Distributed Applications Crystal Reports Implementing Runtime Customization Implementing Runtime crystal reports print to printer no printers installed Customization Handling Exceptions for the Crystal Report Engine Handling Exceptions for the Crystal Report Engine Handling Exceptions for the Crystal Report Engine Deciding between the Viewer or Report Engine for Customization
Asp.net Crystal Report Print To Client Printer
Customizing the Appearance of the Viewer Choosing a Report to View Modifying Fonts and Colors Customizing Data Presentation Customizing Export Options Accessing Secure Databases Handling Exceptions for the Crystal Report Engine TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. This documentation
Print Crystal Report Directly To Printer In C#
is archived and is not being maintained. Handling Exceptions for the Crystal Report Engine Visual Studio .NET 2003 When you run Crystal Reports through your application, there may be times when the Crystal Report Engine causes an exception. When an exception occurs, it can cause an error dialog to appear or cause reports to stop processing. Some of the causes of an exception are: The Report Engine is unable to connect to the database. This can be because a database location or incorrect logon parameters have been passed to the Report Engine. It can also be because of other database errors such as the table being locked by another user, the database engine being improperly installed, or the table being corrupt. Incorrect data has been passed to a parameter. If a parameter receives incorrect data from code or from user input, it can cause the report to stop running. For example, a string value passed to a numeric parameter will stop the report from running. An error is found in a Crystal Reports formula. If one of the formulas in the report cannot be properly
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About crystal report error codes Us Learn more about Stack Overflow the company Business Learn more about hiring
Crystal Reports Error Messages
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the crystal reports formula error handling Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Crystal Reports XI PrintToPrinter “Missing https://msdn.microsoft.com/en-us/library/aa288423(v=vs.71).aspx parameter values” up vote 0 down vote favorite 1 I'm working on an issue with a Crystal report (Crystal XI running in a VB app) where a sporadic "Missing parameter values" error is received when trying to print the report directly. Here's a summary of the issue: User runs the report via the report menu (everything works fine) User clicks 'Print Preview' (everything works fine) User http://stackoverflow.com/questions/11352656/crystal-reports-xi-printtoprinter-missing-parameter-values clicks 'Print' (supposed to send the document directly to the printer, but sometimes get missing parameter error) Here is what I had for code to start: crystalReportViewer.MdiParent = parent crystalReportViewer.Show() Dim report As ReportDocument = CType(crystalReportViewer.ReportSource, ReportDocument) report.PrintToPrinter(1, False, 0, 0) crystalReportViewer.Close() crystalReportViewer.Dispose() Based on what I've been googling, I came up with this code: crystalReportViewer.MdiParent = parent crystalReportViewer.Show() Dim report As ReportDocument = CType(crystalReportViewer.ReportSource, ReportDocument) 'here are my attempts to get it to work Dim pf As ParameterFields = report.ParameterFields report.PrintOptions.PrinterName = "Microsoft XPS Document Writer" report.PrintToPrinter(1, False, 0, 0) crystalReportViewer.Close() crystalReportViewer.Dispose() I'm about out of ideas on how to solve this issue. Has anyone else run across this? printing parameters crystal-reports reporting share|improve this question asked Jul 5 '12 at 21:13 lmg 2315 can you share the exception you are getting..? –Asif Jul 6 '12 at 5:00 Here's a screenshot of the error: tinypic.com/r/6tl84z/6 –lmg Jul 6 '12 at 13:18 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote Start Code: You problably have some empty parameter in your report. After Search Code: You have this line: Dim pf As ParameterFields = report.ParameterFields You
here for a quick http://stackoverflow.com/questions/10476921/printtoprinter-method-for-crystal-reports-throws-logon-exception overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this https://bytes.com/topic/c-sharp/answers/263776-crystal-reports-printtoprinter-method site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us crystal report Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PrintToPrinter print to printer method for crystal reports throws logon exception up vote 1 down vote favorite I am using PrintToPrinter(1,false,1,1) in my website for a crystal report . After I click on this button ( btnPrintToPrinter) it throws LogOnException and says Database Logon failed : protected void btnPrintToPrinter_Click(object sender, EventArgs e) { int empno = Convert.ToInt32(Session["AnyVal"]); SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); string strQuery = "SELECT [View_EmplDetail].[Uni-Code], [View_EmplDetail].[FacultyCode], [View_EmplDetail].[EmpIDstr], [View_EmplDetail].[EngGivenName], [View_EmplDetail].[position_eng], [View_EmplDetail].[Emp_no], [View_EmplDetail].[GivenName], [View_EmplDetail].[position_name], [View_EmplDetail].[DariName], [Tbl_Dept].[EName], [View_EmplDetail].[photo] FROM [MoHEDatabase].[dbo].[View_EmplDetail] [View_EmplDetail] INNER JOIN [MoHEDatabase].[dbo].[Tbl_Dept] [Tbl_Dept] ON [View_EmplDetail].[DepCode]=[Tbl_Dept].[DepCode] WHERE [Emp_no] = @empno"; SqlCommand command = new SqlCommand(strQuery, connection); command.CommandType = System.Data.CommandType.Text; command.Parameters.AddWithValue("@empno", empno); command.Connection = connection; command.Connection.Open(); SqlDataAdapter da = new SqlDataAdapter(command); DataTable dt = new DataTable(); da.Fill(dt); ReportDocument rpt = new ReportDocument(); string _reportPath = Server.MapPath("..\\Student\\cardFinal.rpt"); //rpt.Load(AppDomain.CurrentDomain.BaseDirectory + "\\" + @"\\Student\\Card
your question and get tips & solutions from a community of 418,472 IT Pros & Developers. It's quick & easy. Crystal Reports PrintToPrinter Method P: n/a Alx Sharp Hello group! I'm facing a strange problem in the application I'm writing... I'm using crystal reports for printing sale receipts, and I wrote this lines of code: rpt.Parameter_SaleID.CurrentValues.AddValue((int)t his.CurrentSale.Row["SaleID"]); rpt.Parameter_TaxValue.CurrentValues.AddValue(tax) ; rpt.PrintOptions.PrinterName = "SAMSUNG SRP270"; rpt.SetDataSource(this.salesDataSet); rpt.PrintToPrinter(1, false, 0, 0); In my report I'm using parameter fields to set the record selection formula and to apply taxes. Every line works fine, except for the last one, which rises the exception IndexOutOfRangeException that idicates that the index doesn't fit in the matrix (I don't know why). If I use the report viewer to show a preview of the sale receipt, I can print it from the tool bar, but I don't want to use the viewer. I'd really appreciate your help... Thank you all... Nov 16 '05 #1 Post Reply Share this Question 2 Replies P: n/a Bruce Wood Can you post the exact text of the error message that you're getting? As in, make it happen, then copy and paste it here? Nov 16 '05 #2 P: n/a Alx Sharp Hello group!!! I'm going to reply to myself... :) I can call the PrintToPrinter method if I set the PrintOptions.PageMargins data before: CrystalDecisions.Shared.PageMargins pageMargins = new CrystalDecisions.Shared.PageMargins(1, 1, 1, 1); rpt.PrintOptions.ApplyPageMargins(pageMargins); rpt.PrintOptions.PrinterName = "SAMSUNG SRP270"; rpt.PrintToPrinter(1, false, 0, 0); Now my application is working fine... Anyway... thank you all... Nov 16 '05 #3 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. Similar topics Crystal Reports Printing Question - VB .NET Pleas help, desperate problem with Crystal Reports Crystal "PrintToPrinter" will not print to Zebra Label Printer... HELP! Printing Crystal Reports in a Windows Forms App Crystal Reports printing error Crystal Reports PrintT