timeout issue in production environment with pdf-utils
-
Hi I am running jsreport in my web application on production (iis 7, .net 4.0 integrated app pool, windows server 2008 R2) and I am getting this error whenever trying to run a report.
Error rendering report: instance has been daemonized and initialized successfully (pid: 182492)A critical error occurred while trying to execute the render command: Timeout during evaluation of pdf-utils operations (1).
Here is the code the is not working. If I run each report by themselves without any pdf util ops they come out, but it does not work when I combine them. The chrome timeout is set to 260000 ms but it times out sooner than that. This report runs fine and very quick in the local environment. Any ideas?
var rs = new LocalReporting().UseBinary(JsReportBinary.GetBinary()).Configure(cfg => { cfg.HttpPort = 3000; cfg.Chrome = new ChromeConfiguration { Timeout = 260000 }; return cfg; }).AsUtility().Create(); StudentReportViewModel overviewModel = //code omitted; StudentReportViewModel studentReportModel = //code omitted; Template template = new Template() { Recipe = Recipe.ChromePdf, Engine = Engine.None, Content = this.RenderViewToString("Overview", overviewModel), Chrome = new Chrome { Landscape = true, Format = "A4", MediaType = MediaType.Screen, MarginBottom = "80px", MarginLeft = "10px", MarginRight = "10px", MarginTop = "10px", Scale = "0.8", FooterTemplate = this.RenderViewToString("_FooterPartial", new { }), HeaderTemplate = "", DisplayHeaderFooter = true, PrintBackground = true, }, PdfOperations = new List<PdfOperation>() { new PdfOperation() { Type = PdfOperationType.Append, Template = new Template { Engine = Engine.None, Recipe = Recipe.ChromePdf, Content = this.RenderViewToString("StudentReport", studentReportModel), Chrome = new Chrome { Landscape = true, Format = "A4", MediaType = MediaType.Screen, MarginBottom = "80px", MarginLeft = "50px", MarginRight = "10px", MarginTop = "80px", Scale ="0.8", FooterTemplate = this.RenderViewToString("_FooterPartial", new { }), HeaderTemplate = this.RenderViewToString("_HeaderPartial", new HeaderViewModel{ CustomerLogo=overviewModel.StudentReport.CustomerLogo, LogoOnly=false, StudentName=overviewModel.StudentReport.StudentName }), DisplayHeaderFooter = true, PrintBackground = true } } } } }; var rpt = await rs.RenderAsync(new RenderRequest() { Template = template });
-
Please update jsreport.Types nuget to version 2.4.1
Then add this configuration.Configure(cfg => { cfg.TemplatingEngines.Timeout = 260000..... })
-
I had to instantiate a TemplatingEngineConfiguration and then set the timeout property but that seems to have done it. Much appreciated Jan!