PDA

Click to See Complete Forum and Search --> : Crystal Report error


vlntine82
Jan 23rd, 2007, 12:55 PM
I am trying to access a Crystal 10 report from a VB.NET web application. If I hardcode the path as C:\reportname.rpt, then the report opens fine. However, I need the path to be based off of the server the application is running off of as it could be multiple servers. I am using the function LCase(Request.ServerVariables("SERVER_NAME")) to get the server name, so to get the path I am using
"http:// LCase(Request.ServerVariables("SERVER_NAME")) & "\reportname.rpt"
This is giving me an "unspecified error".

Does anyone know what would cause this?

si_the_geek
Jan 23rd, 2007, 01:21 PM
Try these changes to make it a valid string (and hopefully address too):
"http://" & LCase(Request.ServerVariables("SERVER_NAME")) & "/reportname.rpt"

vlntine82
Jan 23rd, 2007, 01:36 PM
Sorry, that was a typo in my original post. It does have the "http" & ....

si_the_geek
Jan 23rd, 2007, 02:29 PM
And the / (instead of \ )?

What does Request.ServerVariables("SERVER_NAME") actually contain? ..is it something that would work in the address bar of IE?

vlntine82
Jan 31st, 2007, 09:53 AM
I was able to use crDoc.Load(Server.MapPath(HttpRuntime.AppDomainAppVirtualPath) & "\pr\prGraphMean.rpt") to get the report to load; however, instead of the graph displaying it is just listing the name of the crystal report object like below

CrystalReportViewer - CrystalReportViewer1

Any thoughts?