Issue: Image not updated on re-render
Issue: Image not updated on re-render
If report contains two images, bound using dataURL, the second one(maybe even all, not tested this) is cached somewhere in report global code. If then another instance of same report is rendered in same browser session, the newly rendered report will contain old image.
Our real word scenario, we have ability for user to see and sign an order report on-screen. We should re-render it after it's signed (or re-signed). Due to this bug the first rendered signature image is cached forever, even if opened with another order data.
The attached archive contains designer and viewer for the issue. Just hit render multiple times. For sake of this example unique image is generated using canvas and counter.
Each canvas is left in document for debug purposes, this shows that image rendered on report is not same as image provided via report data.
There is also a repro without issue, when the first (in this case static) image is removed from report definition, the second image is updated fine on every re-render.
Hope it will help to fix the issue. Thanks!
Our real word scenario, we have ability for user to see and sign an order report on-screen. We should re-render it after it's signed (or re-signed). Due to this bug the first rendered signature image is cached forever, even if opened with another order data.
The attached archive contains designer and viewer for the issue. Just hit render multiple times. For sake of this example unique image is generated using canvas and counter.
Each canvas is left in document for debug purposes, this shows that image rendered on report is not same as image provided via report data.
There is also a repro without issue, when the first (in this case static) image is removed from report definition, the second image is updated fine on every re-render.
Hope it will help to fix the issue. Thanks!
- Attachments
-
- cached-image-repro.zip
- Repro
- (2.09 MiB) Downloaded 214 times
Re: Issue: Image not updated on re-render
Hello,
Please try to use the async methods for rendering and exporting:
Thank you.
Please try to use the async methods for rendering and exporting:
Code: Select all
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/test.mrt");
report.render();
var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
// Create an PDF service instance.
var service = new Stimulsoft.Report.Export.StiPdfExportService();
// Create a MemoryStream object.
var stream = new Stimulsoft.System.IO.MemoryStream();
// Export PDF using MemoryStream.
service.exportToAsync(function () {
var data = stream.toArray();
// Get report file name
var fileName = String.isNullOrEmpty(report.reportAlias) ? report.reportName : report.reportAlias;
// Save data to file
Object.saveAs(data, fileName + ".pdf", "application/pdf");
}, report, stream, settings);
Re: Issue: Image not updated on re-render
Hi Aleksey, thanks for the reply.
Still no luck. I'm getting the same results with async. Here is my rendering code:
Repro attached, see no-issue_viewer.html.
Still no luck. I'm getting the same results with async. Here is my rendering code:
Code: Select all
function renderViaAsyncExport(report) {
var settings = new Stimulsoft.Report.Export.StiHtmlExportSettings();
var service = new Stimulsoft.Report.Export.StiHtmlExportService();
var textWriter = new Stimulsoft.System.IO.TextWriter();
var htmlTextWriter = new Stimulsoft.Report.Export.StiHtmlTextWriter(textWriter);
report.render();
service.exportToAsync(function () {
var html = textWriter.getStringBuilder().toString();
document.getElementById("viewer-content").innerHTML = html;
}, report, htmlTextWriter, settings);
}
- Attachments
-
- repro.zip
- (2.13 MiB) Downloaded 211 times
Last edited by lega on Mon Jun 26, 2017 12:27 pm, edited 1 time in total.
Re: Issue: Image not updated on re-render
Just thinking now ... I'm not sure how doing async would have helped in the first place. Only if async methods were more maintained than the sync ones. Which would be weird, wouldn't it?
Re: Issue: Image not updated on re-render
Hello,
Sorry for the delay with response.
We need some additional time to investigate the issue.
Thank you.
Sorry for the delay with response.
We need some additional time to investigate the issue.
Thank you.
Re: Issue: Image not updated on re-render
Hi Aleksey, sure, take your time. Hope it will get fixed soon.
Thanks for the response.
Thanks for the response.
Re: Issue: Image not updated on re-render
Hello,
Thank you for the detailed information.
We have found some bugs. We will try to fix it fast as possible.
Thank you.
Thank you for the detailed information.
We have found some bugs. We will try to fix it fast as possible.
Thank you.
Re: Issue: Image not updated on re-render
Hi guys,
It's been almost 6 months. We recently tried with the new (2018.1) version, but sadly the issue still exists. Attached is simplified reproduction of the issue.
Can someone take another look please?
To use it, just run
And navigate to http://127.0.0.1:8125
The reproduction is as isolated and minimal as possible.
Thanks
It's been almost 6 months. We recently tried with the new (2018.1) version, but sadly the issue still exists. Attached is simplified reproduction of the issue.
Can someone take another look please?
To use it, just run
Code: Select all
node server.js
The reproduction is as isolated and minimal as possible.
Thanks
- Attachments
-
- image-not-updated-repro.zip
- (1.3 MiB) Downloaded 620 times
Re: Issue: Image not updated on re-render
Hello.
We are very sorry for such delay with answer.
We have reproduced the issue and can't find where is comes from.
We will look at this issue more deeper and will let you know about results.
Thank you.
Ticket reference: #4505
We are very sorry for such delay with answer.
We have reproduced the issue and can't find where is comes from.
We will look at this issue more deeper and will let you know about results.
Thank you.
Ticket reference: #4505
Re: Issue: Image not updated on re-render
Hello.
It will be fixed from next version (2018.1.9).
Plase clear cache before rendering
It will be fixed from next version (2018.1.9).
Plase clear cache before rendering
Code: Select all
...
Stimulsoft.Report.StiFileImageCache.clear();
report.render();