Error exporting reports to sharepoint from VS2019 RRS feed

  • Question

  • I am having an issue exporting some reports to a sharepoint url from a VS 2019 windows form project. Previously the .exe was being run from a 2008 citrix platform and the exports ran successfully. We have recently moved it to an RDS 2019 server and now I am getting the error 'Network name cannot be found" when trying to export. See code below. I am assuming I need to modify my path to some other type of syntax etc but not sure what it would be.

                Dim warnings As Warning() = Nothing
                Dim streamids As String() = Nothing
                Dim mimeType As String = Nothing
                Dim encoding As String = Nothing
                Dim extension As String = Nothing
                Dim bytes As Byte()
                Dim viewer As New ReportViewer
                ExportRptPath = "//"


                bytes = ReportViewer1.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, warnings)
                Dim fs As New FileStream(ExportRptPath, FileMode.Create)
                fs.Write(bytes, 0, bytes.Length)

    Tuesday, February 25, 2020 1:28 PM

All replies

  • Hi,

    In my opinion, there is no problem with your code syntax, most likely your path is wrong.

    ExportRptPath = "//"

    Please check it carefully.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, March 2, 2020 12:58 AM