Caching Problem

Stimulsoft Reports.JS discussion
Post Reply
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Caching Problem

Post by peda »

1. We use JS version and when we change a Report and reopen the report its load a old version from the Report.
The file is saved correct. But on reopen he uses the old version of the Report.
I think its a caching Problem. The Problem is only on Google Chrome

Thanks Peter
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Re: Caching Problem

Post by Jan »

Hello, Peter!

We made some test, but we cannot reproduce this problem now. I have the question. If you save your report file with the new name it loads correctly?

Thank you.
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Re: Caching Problem

Post by peda »

Yes when i save with a new name it work correctly. It also works better with Internet Explorer as in Chrome
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Caching Problem

Post by Andrew »

Hello,

One more question. What web server are you using?

Waiting for your reply.
Thank you.
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Re: Caching Problem

Post by peda »

On my testsystem i use Xampp (Apache) and on LiveSystem i use an Apache on ubuntu Linux

Thanks Peter
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Caching Problem

Post by Andrew »

Hello,

Could you, please explain how do you save/load the report template?

Waiting for your reply.
Thank you.
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Re: Caching Problem

Post by peda »

Hello Thanks

I save the Report in a Json String and in php i save it to the file

Thanks Peter

Load

report.loadFile(reportfile);


save file
var jsonstring = designer.report.saveToJsonString();


$.post("index.php?controller=pjAdminReports&action=pjActionSaveReport", {
reportfile: reportfile,
reportjson: jsonstring
}).done(function (data) {
// alert (data);
if (data.status == 'OK') {
// designer.close();
dialog.close();

}
});

public function pjActionSaveReport()
{
$this->setAjax(true);
if ($this->isAdmin()){
if (isset($_POST['reportfile'])){
file_put_contents($_POST['reportfile'], $_POST['reportjson']);
pjAppController::jsonResponse(array('status' => 'OK', 'code' => 200, 'text' => 'Reports erfolgreich gespeichert'));
} else
{
pjAppController::jsonResponse(array('status' => 'ERROR', 'code' => 100, 'text' => 'Reports nicht gefunden'));
}
}

}
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Caching Problem

Post by Vladimir »

Hello,

Please try to use the random parameter in report URL to avoid the problem with browser cache:

Code: Select all

var n = Stimulsoft.System.Guid.newGuid().toString().substr(0, 8);
report.loadFile(reportfile + "?n=" + n);
Thank you.
peda
Posts: 39
Joined: Fri Feb 12, 2016 9:24 am

Re: Caching Problem

Post by peda »

Thanks,

Now it works

regards Peter
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Caching Problem

Post by HighAley »

Hello, Peter.

We are always glad to help you.
Let us know if you need our help.

Thank you.
Post Reply