using FastReport.Preview; using FastReport.Table; using System; using System.IO; using System.Net; using System.Text; using System.Collections.Generic; using Microsoft.Extensions.Primitives; using System.Linq; using System.Globalization; using FastReport.Web.Services; using FastReport.Export.Html; using FastReport.Web.Infrastructure; namespace FastReport.Web { public partial class WebReport { internal StringBuilder ReportBody() { #if DIALOGS if (Mode == WebReportMode.Dialog) { StringBuilder sb = new StringBuilder(); Dialog.ProcessDialogs(sb); return sb; } else #endif return ReportInHtml(); } internal StringBuilder ReportInHtml() { PictureCache.Clear(); var sb = new StringBuilder(); using (HTMLExport html = new HTMLExport()) { html.ExportMode = HTMLExport.ExportType.WebPreview; //html.CustomDraw += this.CustomDraw; html.StylePrefix = $"fr{ID}"; //html.StylePrefix = Prop.ControlID.Substring(0, 6); html.Init_WebMode(); html.Pictures = Pictures; //html.Pictures = Prop.Pictures; html.EmbedPictures = EmbedPictures; //html.EmbedPictures = EmbedPictures; html.OnClickTemplate = "fr{0}.click(this,'{1}','{2}')"; html.ReportID = ID; //html.ReportID = Prop.ControlID; html.EnableMargins = EnableMargins; //html.EnableMargins = Prop.EnableMargins; // calc zoom //CalcHtmlZoom(html); html.Zoom = Zoom; html.Layers = Layers; //html.Layers = Layers; html.PageNumbers = SinglePage ? "" : (CurrentPageIndex + 1).ToString(); //html.PageNumbers = SinglePage ? "" : (Prop.CurrentPage + 1).ToString(); //if (Prop.AutoWidth) // html.WidthUnits = HtmlSizeUnits.Percent; //if (Prop.AutoHeight) // html.HeightUnits = HtmlSizeUnits.Percent; //html.WebImagePrefix = WebUtils.ToUrl(FastReportGlobal.FastReportOptions.RouteBasePath, controller.RouteBasePath, ID, "picture") + "/"; //html.WebImagePrefix = String.Concat(context.Response.ApplyAppPathModifier(WebUtils.HandlerFileName), "?", WebUtils.PicsPrefix); html.WebImagePrefix = WebUtils.ToUrl(FastReportGlobal.FastReportOptions.RoutePathBaseRoot, FastReportGlobal.FastReportOptions.RouteBasePath, $"preview.getPicture?reportId={ID}&pictureId="); html.SinglePage = SinglePage; //html.SinglePage = SinglePage; html.CurPage = CurrentPageIndex; //html.CurPage = CurrentPage; html.Export(Report, (Stream)null); //sb.Append("