Getting the relative path to the rdlc report in my winform app

后端 未结 5 604
说谎
说谎 2021-01-02 08:55

I am automatically creating a PDF from some of our reports in a month-end process. I am running into a problem where ReportViewer.LocalReport can\'t find my rep

5条回答
  •  北海茫月
    2021-01-02 09:31

    You can store the reports in a "resources" file, and by using an Assembly reader of the given .dll / .exe where the "resource" file is embedded, can read as a streaming reference. Then set your report to the embeded stream to get the report definition.

    Special note. If your report has nested sub-reports, the report will fail unless you also set in your LocalReport subreport definition another such reference to your subreport .rdlc file.

提交回复
热议问题