Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RDLC Export will render on development but not production 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I'm using a rdlc reportviewer to render a report directly to excel. the below code works on my development but not once I publish the app. can't figure out what the problem is. I get no errors

any help would be appreciated

Thanks

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 fs As New FileStream("c:\Export_Reports\MyReport.xls", FileMode.OpenOrCreate)

rv1.ProcessingMode = ProcessingMode.Local
rv1.LocalReport.ReportPath = Server.MapPath("~/Reports_rdlc/MyReports.rdlc")
Dim dsReleased2 As sp_1 = sp()
Dim datasource As New ReportDataSource("sp_1", dsReleased2.Tables(0))
rv1.LocalReport.DataSources.Clear()
rv1.LocalReport.DataSources.Add(datasource)

bytes = rv1.LocalReport.Render("Excel", Nothing, mimeType, encoding, extension, streamids, warnings)
fs.Write(bytes, 0, bytes.Length)
fs.Close()


 
Yeah, I finally figured that out.... how do I get this to work on the client machine ? I've been searching and really can't find a straight answer.

Thanks

 
The straightforward answer: you can't. You cannot access the client PC for security reasons
You will have to create a folder on a server drive that the provider let's you access.

Another issue is that if you are allowing users to write a file to the filesystem, you will need to generate unique file names, otherwise they will be overwritten. That is not a big deal because you can come up with some sort of naming convention like username + filename + extension.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top