【发布时间】:2021-07-09 10:58:59
【问题描述】:
我有一个在 .Net core 5 中开发的应用程序用于后端和 React JS 用于前端。我还有一些现有的 SSRS 报告需要在应用程序中呈现。如何在 ReactJS 应用程序中嵌入/呈现这些 SSRS 报告?
【问题讨论】:
标签: reactjs .net-core reporting-services
我有一个在 .Net core 5 中开发的应用程序用于后端和 React JS 用于前端。我还有一些现有的 SSRS 报告需要在应用程序中呈现。如何在 ReactJS 应用程序中嵌入/呈现这些 SSRS 报告?
【问题讨论】:
标签: reactjs .net-core reporting-services
我已经通过生成URL Access urls 并链接到它们来解决这个问题。您也可以将它们放在 iframe 中。
const makeReportLink = (reportPath, reportParams = {}, zoom = 100) => {
const reportViewerUrl = 'http://report-server-host/ReportServer_SSRS/Pages/ReportViewer.aspx';
const reportParamDefaults = {
'rs:Command': 'Render',
'rc:Parameters' : 'false',
'rc:Zoom': zoom,
};
let reportSP = new URLSearchParams({...reportParamDefaults, ...reportParams});
return `${reportViewerUrl}?${reportPath}&${reportSP.toString()}`;
}
【讨论】: