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

后端 未结 5 605
说谎
说谎 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:20

    Simple Solution is..

    Default Path of project is projectname/bin/debug

    in Report Viewer code Reportpath = "../../folder1/report1.rdlc"

    The default path is projectname/bin/debug but if you create rdlc at root path for that you have to go at root but .net not provide such function so simply add ../ to change current directory to go perent directory.

    i place ../../ two time bcz my rdlc at the root path so i have to change debug then bin and finally i reach the root path. if you have separate folder for rdlc then make sure that you that to write the foldername and place / our their.

    Hope you like it..

提交回复
热议问题