While I'm still developing reports I often need to 'design/save/view' the report. However both Chrome and FireFox don't ALWAYS force load the mrt but instead serve up the old mrt from cache.
This probably isn't a Stimulsoft Reports problem but if anyone has already solved this then I would be very grateful for an answer please.
Thanks
How to force load an .mrt in Viewer?
Re: How to force load an .mrt in Viewer?
I should have explained that I have a generic html file which creates a viewer and then takes the parameter from the viewer url to get the .mrt file. However due to the cacheing I often got the old .mrt file. So after a bit of googling I found that if I include a dummy random variable value after my report.loadFile("/path/to/mrtfile/repname.mrt") command by changing it to :
report.loadFile("path/to/mrtfile/repname.mrt?randomvar")...then because it was a new URL my latest repname.mrt would get loaded.
The JS function that I 'took' from someone else was:
So now my report.loadFile looks like this:
report.loadFile("/reports/mrt/"+repname+".mrt?"+randomvar());
.....And my latest .mrt report is ALWAYS loaded!!
report.loadFile("path/to/mrtfile/repname.mrt?randomvar")...then because it was a new URL my latest repname.mrt would get loaded.
The JS function that I 'took' from someone else was:
Code: Select all
function randomvar()
{
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 7; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
report.loadFile("/reports/mrt/"+repname+".mrt?"+randomvar());
.....And my latest .mrt report is ALWAYS loaded!!
Re: How to force load an .mrt in Viewer?
Hello,
Ok.
Could you clarify that issue is solved?
Thank you.
Ok.
Could you clarify that issue is solved?
Thank you.