【问题标题】:How to embed/render SSRS report in a ReactJS + .Net core Web API application如何在 ReactJS + .Net 核心 Web API 应用程序中嵌入/呈现 SSRS 报告
【发布时间】:2021-07-09 10:58:59
【问题描述】:

我有一个在 .Net core 5 中开发的应用程序用于后端和 React JS 用于前端。我还有一些现有的 SSRS 报告需要在应用程序中呈现。如何在 ReactJS 应用程序中嵌入/呈现这些 SSRS 报告?

【问题讨论】:

    标签: reactjs .net-core reporting-services


    【解决方案1】:

    我已经通过生成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()}`;
    }
    

    【讨论】:

    • 谢谢尼尔。这个想法奏效了。我试图将 SSRS 报告嵌入到 reactjs 应用程序的 Iframe 中,为此我们需要添加 rs:Embed:true 参数。
    • 但是通过这种方式,我们如何处理对报告服务器的身份验证?
    • 父应用无法控制身份验证。 SSRS 可能会提示他们输入用户名/密码。
    • 知道了。感谢您的帮助@neal-burns
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 2013-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多