Issue with ejPrint when printing HTML

Hi,

I have been trying to print HTML content after excluding some content. I have been doing as follows:

$('.print').click(function(){
            var ele = $("#id-print-element");
            if (!ele.hasClass("e-print")) {
                $("#id-print-element").ejPrint({ excludeSelector: ".print-exclude" });
            } else {
                var obj = $("#id-print-element").ejPrint("instance");
                obj.option("excludeSelector", ".print-exclude");
                obj.option("printInNewWindow",true);
                obj.print();
            }
         });

The HTML is like as follows:

<div class="row" id="id-print-element">
      <div class="col-md-7">
              <div class="row">
                  <div class="col-md-3 name">
                      Name
                  </div>
                  <div class="col-md-9 value">
                      Value
                  </div>
              </div>
               <div class="row print-exclude">
                        <button type="button" name="button" class="btn btn-label btn-primary print"><label><i class="ti-printer"></i></label>Print This Data</button>
               </div>
     </div>
</div>

When I click the button, the print opens up with the desired HTML content, but the print preview display's empty content. Please help.

Also, I would like to point out the fact that, in the documentation - https://help.syncfusion.com/js/print/features the option properties are mentioned like variables instead of string:

obj.option(printInNewWindow,true);
instead of 
obj.option("printInNewWindow",true);

1 Reply

VK Vinoth Kumar Sundara Moorthy Syncfusion Team December 15, 2017 07:07 AM UTC

Hi Ron, 
 
Thank you for using Syncfusion products. 
 
Query 1: Print preview displays empty content 
 
We have checked the reported issue and we are unable to reproduce it in our end. We have prepared a sample based on the inputs that you have provided to demonstrate your scenario. 
 
 
Could you please check and replicate your issue in the above JS playground sample and send back to us with more information such as if you did any other customization or if possible provide issue reproducible sample. So, that we could able to proceed further. 
 
Query 2: Print option properties are mentioned like variables instead of string 
 
Sorry for the inconvenience. We will check and update the documentation in our upcoming release. 
 
Regards, 
Vinoth Kumar S 


Loader.
Up arrow icon