locked
asp.net c# crystal report button click and print RRS feed

  • Question

  • User1127247806 posted

    hi frd,

    i use win 7 vs2008 . when i click button crystal report will print

    this is my code

    using CrystalDecisions.CrystalReports.Engine;

    using CrystalDecisions.Shared;
    //using System.IO;

    public partial class BookingReceiptList : System.Web.UI.Page
    {
        public ReportDocument crystalReport = new ReportDocument();
        protected void Page_Load(object sender, EventArgs e)
        {

          
            crystalReport.Load(Server.MapPath("BookingMoneyRe.rpt"));
            crystalReport.SetDatabaseLogon
                ("", "", @"MONIR-PC\SQLEXPRESS", "afrindb");

            string project1 = Convert.ToString(Session["BokingMoney"]);


            crystalReport.SetParameterValue("bookid", project1);

            CrystalReportViewer1.ReportSource = crystalReport;
            crystalReport.PrintToPrinter(1, false, 0, 0);

    }

    its not workiny any help

    its getting error

    No printers are installed.

    Saturday, February 23, 2013 8:40 AM

Answers

  • User371383779 posted

    The error is pretty obvious that tells that no printer has been configured on the current machine. You add a printer on the machine and make it default, so this method will always try to connect to a default printer and get the report print.

    What is your case when no printer is actually connected to the machine, and/or configured on the machine?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 25, 2013 4:25 AM
  • User1291589676 posted

    Hi,

    Check whether printer is installed in your system. If you like to check whether it prints the data or not you just use export option of crystal report and then check the exported file.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 25, 2013 4:37 AM

All replies

  • User371383779 posted

    The error is pretty obvious that tells that no printer has been configured on the current machine. You add a printer on the machine and make it default, so this method will always try to connect to a default printer and get the report print.

    What is your case when no printer is actually connected to the machine, and/or configured on the machine?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 25, 2013 4:25 AM
  • User1291589676 posted

    Hi,

    Check whether printer is installed in your system. If you like to check whether it prints the data or not you just use export option of crystal report and then check the exported file.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 25, 2013 4:37 AM