dip s

dip s

  • 1.4k
  • 256
  • 76.6k

What is a good Data reporting tool in angular 8 to show reports.

Dec 7 2020 4:00 AM
Hello,
We have a cloud application in angular 8 and mvc 5.
Currently, I am displaying report in angular 8 using crystal report at backend.
I am doing following steps to display data.
1.  I am retrieving required data/fields from database to show in report.
2.  Setting that data as crystal report source.
3.   Converting it to Base64 string and returing it to front end means angular.
  1. ReportDocument reportDocument = new ReportDocument();  
  2.  objcmd.CommandText = "rpReport";  
  3. objcmd.CommandType = CommandType.StoredProcedure;  
  4. objcmd.Parameters.AddWithValue("ID", ResultID);  
  5.  MySqlDataAdapter da = new MySqlDataAdapter(objcmd);  
  6.  DataTable dt = new DataTable();  
  7. da.Fill(dt);  
  8.  ReportDocument cryRpt = new ReportDocument();  
  9.  cryRpt.Load("C:/Report/PatientReport.rpt");  
  10.  cryRpt.SetDataSource(dt);  
  11.  cryRpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "C:/Report/PatientReport.pdf");  
  12. byte[] bytes = File.ReadAllBytes("C:/Report/PatientReport.pdf");  
  13. result = Convert.ToBase64String(bytes);  
 4. In angular, I am printing this data as follows
  1. const pdfWindow = window.open("");  
  2.                pdfWindow.document.write("Patient Reportbody{margin: 0px;}iframe{border-width: 0px;}");  
  3.                pdfWindow.document.write(" +  
  4.                    encodeURI(result) + "#toolbar=0&navpanes=0&scrollbar=0'>");  
 But here the problem is data from database contains html tag like , and crystal report does not support these tags. so data does not displayed in tabular format. it gets displayed as simple text.
So is there any other way or tool to display such report. Or display data in tabular format. 
Thank you in advance. 
,

Answers (1)