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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Load Report Failed"

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
ASP.NET /
VB.NET 7.1


Not sure why I'm getting this error message. I have a Crystal Report Viewer on my .aspx page (named 'ReportViewer'), a crystal report, and during the page_load event I have the following code:

ReportViewer.ReportSource = "CrystalReport1.rpt"

It is the name of my report, any ideas why I keep getting this in IE:


Load report failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load report failed.

Source Error:


Line 46: cr = New CrystalReport1
Line 47:
Line 48: ReportViewer.ReportSource = "CrystalReport1.rpt"
Line 49:
Line 50: 'Connection


Source File: c:\inetpub\ Line: 48

Stack Trace:


[LoadSaveReportException: Load report failed.]
CrystalDecisions.Web.ReportAgent.h() +328
CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object value) +224
CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value) +16
CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object value) +37
WebSchedule.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\ System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731




Any help or comments would be greatly appreciated!

Thanks in advance,
Jason
 
ASP.NET
VB.NET
Crystal Reports

After countless hours of reading help files, postings, etc... I finally found it. I could be wrong, but it seems to me that information about using Crystal Reports in .NET framework is poorly documented, at best. So here's what I did.

1. Add a new Crystal Report to the project, name it 'CrystalReport1.rpt'
2. Add a new .aspx page to the project
3. Add a report viewer to the .aspx page (CrystalReportViewer), name it 'ReportViewer'
4. Add the following code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim Cr As New CrystalReport1
cr = New CrystalReport1

ReportViewer.DataBind()
cr.SetDatabaseLogon("username", "password", "server", "database")
ReportViewer.ReportSource = cr
End Sub
 
Almost Forgot:

After Step 3 add "ReportDocument" to the aspx. It's in the toolbox under "Components". Be sure to select your report and uncheck the "cashed" checkbox.

...sorry for any confusion.

--Jason
 
jason, You don't know how happy I was to find this post. I've been looking all over the place for help.

Maybe since I am still learning, everything went way over my head...but the help section on the crystal site and the one provided with .NET was terrible.

Do you have any suggestions for other sites that may help me with making the report more dynamic, like taking user parameters and making the report look a little nicer?

Thank you again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top