简体   繁体   中英

TaskCanceledException: a task was cancelled while rendering jsreport

I'm trying to render a jsreport that contains too much data and when it takes too long to render shows me this message:

TaskCanceledException: a task was cancelled.

If I load less data the report works well.

My question is, there is a way to avoid TaskCanceledException and let the rendering time take what it has to take to render the report?

Thanks Ankit Vijay for your response, the answer has to be with the time out as you mention, my solution was the next one

I was using the jsreport embbedserver and i set the time out like this

embeddedReportingServer.ReportingService.HttpClientTimeout = TimeSpan.FromMinutes(40);

With this line of code i stop recieving this error: TaskCanceledException: a task was cancelled while rendering jsreport

Then when i was testing again i got this error with the phanton process:

Unable to render template. Error during rendering report: Timeout when executing in phantom.

At the end i solved it by adding configuration to my embbed server like this

Helper.embeddedReportingServer.Configuration = new
            {

                phantom = new
                {
                    timeout = 900000,
                    numberOfWorkers = 2
                },


                tasks = new
                {
                    numberOfWorkers = 2,
                    timeout = 900000,


                }

            };

The TaskCanceledException most likely should be coming due to timeout.

Try increase timeout through jsreport configuration. You can read more about jsreport configuration here . I have not tried it myself but it should be tasks.timeout property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM