Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

my code is

C#
function printopbill() {
          if ($('[id*="txtBillNo"]').val() != "") {
          document.getElementById('<%=HiddenField4.ClientID %>').value = 0;
         // qz.append("\x1B\x40"); // 1
        //  qz.append("\x1B\x21\x08"); // 2

          qz.append("                       45465465                           \r\n");
          qz.append("            48878787              \r\n");
          qz.append("                        45454545                                \r\n");
          qz.append(" OP REGISTRATION \r\n");
          qz.append("----------------------------------------------------------------------------\r\n");

          qz.append("Bill No    :" + $('[id*="txtBillNo"]').val() + "    Date:" + $('[id*="txtBillDate"]').val() + " \r\n");
          qz.append("OP No      :" + $('[id*="txtFileNo"]').val() + "\r\n");
          qz.append("Patient    :" + $('[id*="txtFirstName"]').val() + "                       \r\n");
          qz.append("Doctor     :" + $('[id*="ddlDoctor"]').find(":selected").text() + " \r\n");
          qz.append("----------------------------------------------------------------------------\r\n");
          qz.append("|Sl NO   |Particulars                                  |AMount            \r\n");
          qz.append("----------------------------------------------------------------------------\r\n");
          qz.append("|   1    |Registration Charge                          |" + $('[id*="txt_RegstnFee"]').val() + "\r\n");
          qz.append("|   2    |Consultation fee                             |" + $('[id*="txt_ConsultationFeeS"]').val() + "\r\n");
          qz.append("----------------------------------------------------------------------------\r\n");
          qz.append("                                        Total amount     :" + $('[id*="txtPatientTotal"]').val() + "\r\n");
          qz.append("                                        Round off        :" + $('[id*="txtRoundOff"]').val() + "\r\n");
          qz.append("                                        Recived amount   :" + $('[id*="txtPatientReceived"]').val() + "\r\n");
          qz.append("                                        Balance          :" + $('[id*="txtPatientShareBalance"]').val() + "\r\n");
          qz.append("----------------------------------------------------------------------------\r\n");
          qz.append("\r\n");
          var param1 = new Date();
          var param2 = param1.getDate() + '/' + (param1.getMonth() + 1) + '/' + param1.getFullYear() + ' ' + param1.getHours() + ':' + param1.getMinutes() + ':' + param1.getSeconds();
          qz.append("End of report. Printed on" + param2 + " ,User:" + '<%= Session["UserName"] %>' + ".Medismart");
          qz.append("\x1B\x21\x01"); // 3
          qz.append(" \r\n");
          qz.append(" \r\n");
          qz.append(" \r\n");
          qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");
              qz.append(" \r\n");

          qz.append("\x1D\x56\x41"); // 4
          qz.append("\x1B\x40"); // 5

         // window.setTimeout(function () {
              // this will execute 1 second later

              printHTML();
              window.location.href = "OPBilling.aspx";
          //}, 1000);




          return true;
          }
          else {
              return false;
          }
      }



I am getting an exception like
qz.exception.NullPrintServiceException: qz.PrintRaw.print() failed.


how can i solve that
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900