Ejemplo n.º 1
0
        // preview for Designer
        internal async Task <IActionResult> DesignerMakePreview(HttpContext context)
        {
            string receivedReportString = GetPOSTReport(context);

            try
            {
                var previewReport = new WebReport();
                //previewReport.ID = webReport.ID + "-preview";
                previewReport.Report = Report;
                //previewReport.Prop.Assign(webReport.Prop);
                //previewReport.CurrentTab = CurrentTab.Clone();
                //previewReport.LocalizationFile = webReport.LocalizationFile;
                //previewReport.Width = "880px";
                //previewReport.Height = "770px";
                //previewReport.Toolbar.EnableFit = true;
                //previewReport.Layers = true;
                string reportString = PasteRestricted(receivedReportString);
                reportString = FixLandscapeProperty(reportString);
                previewReport.Report.ReportResourceString = reportString; // TODO
                //previewReport.ReportFile = String.Empty;
                previewReport.ReportResourceString = reportString;        // TODO
                //previewReport.Report.Prepare();
                //StringBuilder sb = new StringBuilder();
                //sb.Append("<script src=\"").Append(GetResourceTemplateUrl(context, "fr_util.js")).AppendLine("\" type=\"text/javascript\"></script>");
                //HtmlTextWriter writer = new HtmlTextWriter(new StringWriter(sb, System.Globalization.CultureInfo.InvariantCulture));
                //previewReport.ShowZoomButton = false;
                //previewReport.PreviewMode = true;
                previewReport.Mode = WebReportMode.Preview;
                //previewReport.Page = null;
                //previewReport.RenderControl(writer);
                //string responseText = WebReportGlobals.ScriptsAsString() + previewReport.Toolbar.GetCss() + sb.ToString();
                //context.Response.Write(responseText);

                return(new ContentResult()
                {
                    StatusCode = (int)HttpStatusCode.OK,
                    ContentType = "text/html",
                    Content = (await previewReport.Render()).ToString(),
                });
            }
            catch (Exception e)
            {
                return(new ContentResult()
                {
                    StatusCode = (int)HttpStatusCode.InternalServerError,
                    ContentType = "text/html",
                    Content = Debug ? e.Message : "",
                });
            }
        }
Ejemplo n.º 2
0
 public void Remove(WebReport webReport)
 {
     cache = cache.Where(item => item.WebReport2.TryGetTarget(out WebReport target) && target != webReport).ToList();
 }
Ejemplo n.º 3
0
 public Dialog(WebReport webReport)
 {
     WebReport = webReport;
 }
Ejemplo n.º 4
0
        internal static string GetHref(WebReport webReport)
        {
            string href = webReport.template_export_url(GetExtFromExportType(webReport.ExportType));

            return(href);
        }