当我更改报告文件的内容并要在浏览器中加载时,即使删除报告文件,然后在浏览器中加载stimulsoft报告,浏览器仍会使用旧的(缓存的)报告文件。
如何在不使用缓存方法的情况下强制stimulsoft加载>
这是我用于加载和显示报告文件的代码。
$('#takereport').on( 'click', function () {
StiOptions.WebServer.url = "/js/stimulsoft/handler.php";
var options = new Stimulsoft.Viewer.StiViewerOptions();
options.appearance.fullScreenMode = false;
options.toolbar.showSendEmailButton = true;
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/js/stimulsoft/fa.xml",true);
var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
viewer.onBeginProcessData = function (event, callback) {
<?php StiHelper::createHandler(); ?>
};
viewer.onBeginExportReport = function (args) {};
viewer.onEndExportReport = function (event) {
event.preventDefault = true;
<?php StiHelper::createHandler(); ?>
};
viewer.onEmailReport = function (event) {
<?php StiHelper::createHandler(); ?>
};
// Load and show report
var date_from=$('#date_from').val();
var date_to=$('#date_to').val();
var report = new Stimulsoft.Report.StiReport();
if($('#report_name option:selected').val()==='xyz')
{report.loadFile("/reports/xyz.mrt");
}
else if($('#report_name option:selected').val()==='pqr')
{
report.loadFile("/reports/pqr.mrt");
}
report.dictionary.variables.getByName('date_from').valueObject=date_from; report.dictionary.variables.getByName('date_to').valueObject=date_to;
viewer.report = report;
viewer.renderHtml("content");
});