Results 1 to 5 of 5

Thread: Crystal Report error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    90

    Crystal Report error

    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?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Crystal Report error

    Try these changes to make it a valid string (and hopefully address too):
    VB Code:
    1. "http://[u]" &[/u] LCase(Request.ServerVariables("SERVER_NAME")) & "[u]/[/u]reportname.rpt"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    90

    Re: Crystal Report error

    Sorry, that was a typo in my original post. It does have the "http" & ....

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Crystal Report error

    And the / (instead of \ )?

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

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    90

    Re: Crystal Report error

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width