Font size does not work with html tag
Posted: Sun Jun 21, 2020 9:22 am
I have html text that I want to display as below
I generate StiText programmatically in c# and set AllowHtmlTags to true
Then I generate the rendered report as string and send them to frontend (Angular)
Frontend
The font size does not get set correctly. It seems like it's using the default font of StiText to set. But I look at the rendered string sent from backend, the "Font" property does not get assigned. So I'm sure it's because of frontend. (see picture attached)
I'm using Stimulsoft.Reports.Web.NetCore 2018.2.3
Thank you in advance
Code: Select all
string htmlText = "<p style=\"text-align: center;\"><strong><span style=\"font-size: 20px;\">Text <span style=\"text-decoration: underline; font-family: 'times new roman', times, serif;\">dfdsf</span></span></strong></p>\n<p style=\"text-align: center;\"> </p>\n<p style=\"text-align: center;\"><strong><span style=\"font-size: 20px;\"><span style=\"text-decoration: underline; font-family: 'times new roman', times, serif;\">dfdf</span></span></strong></p>\n<p style=\"text-align: center;\"><span style=\"color: #ba372a; background-color: #f1c40f;\"><strong><span style=\"font-size: 20px; background-color: #f1c40f;\"><span style=\"text-decoration: underline; font-family: 'times new roman', times, serif;\">aaa</span></span></strong></span></p>";
Code: Select all
stiText.Text.Value = htmlText;
stiText.AllowHtmlTags = true;
Code: Select all
report.Dictionary.Databases.Clear();
report.RegData(dataSet);
report.Dictionary.Synchronize();
report.Render();
return report.SaveDocumentJsonToString();
Code: Select all
this.viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false);
this.report = new Stimulsoft.Report.StiReport();
this.report.loadDocument(data); // data is the rendered report string from backend
this.viewer.report = this.report;
this.viewer.renderHtml('viewer');
I'm using Stimulsoft.Reports.Web.NetCore 2018.2.3
Thank you in advance