Last post Jul 18, 2012 12:09 AM by gnoix
Nov 15, 2006 12:58 PM|regwood79|LINK
I have a web application that will take in user data and go to a sql server database run the query, create a dataset from the query, and then create a report from that data. On my development machine with VS 2005 running winXP it works fine. However on
the win server 2003 machine it does not. I am loading the report using the Crystalreport.LOAD(server.mappath.("~/Filename.rpt")). Like i said it works on my development machine however on the server it gives me this error screen:
Line 37: Private Sub ConfigureCrystalReports()
Line 38: Dim rptA As ReportDocument = New ReportDocument()
Line 39: rptA.Load(Server.MapPath("") & "\FormA.rpt")
Line 40: Dim rptds As DataSet = ReportADSXconfig.ReportADataSet(PreviousPage.PatientID, PreviousPage.Doctor, PreviousPage.Start, PreviousPage.EndDte, Page.User.Identity.Name)
Line 41: rptA.SetDataSource(rptds)
[COMException (0x800001fb): Invalid file name.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +87
[Exception: Load report failed.]
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +964
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +73
ReportA.ConfigureCrystalReports() in C:\Inetpub\WebSite1\ReportA.aspx.vb:39
ReportA.Page_Init(Object sender, EventArgs e) in C:\Inetpub\WebSite1\ReportA.aspx.vb:16
System.Web.UI.Control.OnInit(EventArgs e) +2072076
System.Web.UI.Page.OnInit(EventArgs e) +9
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692
I would like to know how to fix this error so that it will run on my server. I have used the merge modules to run this. could that be the problem do i need to install the crystal reports server on the windows server. Just wondering if that could be the
issue. thanks for any help you can give
Nov 15, 2006 03:07 PM|albertpascual|LINK
Check the Server.MapPath("") I am sure is not returning the folder you want or where the file is
You should do this
string checkthivalue = Server.MapPath("") + @"\FormA.rpt"; //C#
Nov 15, 2006 03:13 PM|regwood79|LINK
I did check the string that it is returning:
it points to the directory which holds the report. c:/inetpub/website/FormA.rpt
does the @ symbol works for vb?
Nov 15, 2006 03:23 PM|albertpascual|LINK
Are you sure that the file is there? c:/inetpub/website/FormA.rpt
And do you have all properties to load the file? Remember if you are using IIS, maybe is running with a user that does not have properties in the directory website. Can you move it somewhere else to test it?
You don't need @ in VB is only C# I believe as \ character is an escape character
Nov 15, 2006 03:29 PM|regwood79|LINK
Nov 15, 2006 03:38 PM|albertpascual|LINK
Nov 15, 2006 03:42 PM|regwood79|LINK
I checked the string that the server.mappath shows it goes to the directory that holds the file it still gives the same error.
Then i moved the report to another folder on the server. Still gives an error now it say "INvalid Filename"
Nov 17, 2006 02:48 PM|pmmeyer1|LINK
I have a similar error but for a different reason. To help you, I suggest avoid using files. If you have a strongly typed Crystal Report, or can make one, this code will render it on the fly and send it to the client without creating a file.
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)
Response.ContentType = "application/pdf";
This works in my development enviornment and doesn't use files. I have a different problem on my target machine that causes it not to work. But I haven't given up. Anyone know why a target machine with the framework and using the code above will give
me a Load Report Failure. I think it's a crystal dll somewhere. It's a windows 2000 server.
Show Crystal report
Crystal to PDF ASP.NET 1.1
Jul 12, 2012 12:25 AM|dinhtuvu|LINK
I have a same problem. When I checked Server.MapPath ("~ report / crystalreport.rpt"), it returns
D:\domains\storemanager.com\reports\crystalreport.rpt. The file still exists. I think the problem is in
storemanager.com. because it have a dot. features it should have been misunderstood as
How do you solve this problem?
Jul 18, 2012 12:09 AM|gnoix|LINK
in IIS -> ASP, please enable parent path