用JS显示报告:如何检查报告是否存在?
Displaying a report with JS: How to check if a report exist?
是否有方便的方法是使用 JavaScript 检查是否存在具有给定报告名称的报告?
按照 this 关于如何显示报告的官方指南,我成功地显示了 URL 中给定名称的报告。如果给定的报告名称与报告不匹配,我会收到错误消息:
Could not open successfully the report 'fake-name' (The report '/shared/fake-name.icc-report (null)' does not exists.)
所以我想在报告不存在的情况下重定向用户,为此我需要一个类似函数的东西,它可以根据报告名称给出 true 或 false。
有什么办法可以做到吗?
谢谢。 :)
我建议使用这些选项来访问 openReport 回调:
var options = {
root: ic3root,
rootLocal: ic3rootLocal,
imagesPath: 'images',
//librariesMode:'dev',
callback: function () {
$('#intro').remove();
var ic3reporting = new ic3.Reporting(
{
noticesLevel: ic3.NoticeLevel.ERROR,
dsSettings: {
url: "http://<your_domain>/icCube/gvi"
}
});
ic3reporting.setupGVIConfiguration(function () {
ic3reporting.setupApplication(
{
mode: ic3.MainReportMode.REPORTING,
hideTopPanel: true,
noticesLevel: ic3.NoticeLevel.ERROR,
container: $("#container")
});
ic3reporting.openReport({
report: {
name: 'shared/report23'
}
}, function (reportState) {
var reportExists = _.isEmpty(ic3reporting.reportName());
})
});
}
};
ic3ready(options);
如果 "reportExists" 等于 false
,您可能需要重定向用户
是否有方便的方法是使用 JavaScript 检查是否存在具有给定报告名称的报告?
按照 this 关于如何显示报告的官方指南,我成功地显示了 URL 中给定名称的报告。如果给定的报告名称与报告不匹配,我会收到错误消息:
Could not open successfully the report 'fake-name' (The report '/shared/fake-name.icc-report (null)' does not exists.)
所以我想在报告不存在的情况下重定向用户,为此我需要一个类似函数的东西,它可以根据报告名称给出 true 或 false。
有什么办法可以做到吗?
谢谢。 :)
我建议使用这些选项来访问 openReport 回调:
var options = {
root: ic3root,
rootLocal: ic3rootLocal,
imagesPath: 'images',
//librariesMode:'dev',
callback: function () {
$('#intro').remove();
var ic3reporting = new ic3.Reporting(
{
noticesLevel: ic3.NoticeLevel.ERROR,
dsSettings: {
url: "http://<your_domain>/icCube/gvi"
}
});
ic3reporting.setupGVIConfiguration(function () {
ic3reporting.setupApplication(
{
mode: ic3.MainReportMode.REPORTING,
hideTopPanel: true,
noticesLevel: ic3.NoticeLevel.ERROR,
container: $("#container")
});
ic3reporting.openReport({
report: {
name: 'shared/report23'
}
}, function (reportState) {
var reportExists = _.isEmpty(ic3reporting.reportName());
})
});
}
};
ic3ready(options);
如果 "reportExists" 等于 false
,您可能需要重定向用户