dip s

dip s

  • NA
  • 256
  • 82.6k

How to Print/ Show crystal report in crystal viewer from Angular 6

Sep 17 2020 5:54 AM
Hello,
 
We have a cloud based application with angular 6(client) and asp.net (back end).
Currently, we are printing various accounting reports using crystal report. Actually, what we are doing like we take the output of crystal report and converting it to base64 string and we are returing this string to front end that is angular. Then we are printing this output string into a new tab in chrome. Code is as follows.
  1. const pdfWindow = window.open("");  
  2.                 pdfWindow.document.write("<html<head><title>Discharge Summary</title><style>body{margin: 0px;}iframe{border-width: 0px;}</style></head>");  
  3.                 pdfWindow.document.write("<body><embed width='100%' height='100%' src='data:application/pdf;base64, " +  
  4.                   encodeURI(data) + "#toolbar=0&navpanes=0&scrollbar=0'></embed></body></html>");  
 Now what we want to do like, We have a component called accounts. On this account component; we have multiple tabs(ngb-tab). In one of the tab I have to show crystal report (bill summary). Is is possible to show report in crystal viewer in tab? On is there any other way to show report?
Thank you in advance.