Crystal Reports "Load Failed" from web form Grrrrr


J

Jeff_Mac

Hi there. I'm a bit of a newbie, and I would appreciate any help that
anyone can give me on an error I'm getting with Crystal Reports.

Every time I attempt to view a report using the Crystal Report Viewer,
I get a "Load Report Failed" error, and I'm not sure what I can do to
resolve it.

I know it's not the connection to the data -- I'm able to get a
datagrid to display the data just fine after filling a dataset. I
tried searching the Crystal Decisions support site, and all of their
"load failed" info has to do with DLLs not being in the right place,
or permissions on the actual .RPT file, but all of that seems to be
in order.

These are the lines of code that keep kicking on me.


crReportDocument.Database.Tables(0).SetDataSource(DS)
CrystalReportViewer1.ReportSource =
crReportDocument

DS and crReportDocument are Dim-ed earlier like this:

[i:8f42c70c71] Dim crReportDocument As New CrystalReport1
Dim DS As DataSet[/i:8f42c70c71]

Any help would be greatly appreciated.

Thanks,

Jeff
 
Ad

Advertisements

M

Martin Ho

This is the message I found on other forum:

--------------------------------
Hello.

I think I have the same problem, and am pretty sure I have it narrowed
down. While the CrystalReportViewer object has the correct login
information set, the ReportDocument object does not have the password
set. For some reason it never gets set even if I explicitly set it.

I'm ready to call Crystal Decisions on this one...

Erik
--------------------------------

Looks like it's not only you having this problem.
Martin

also check here:

http://groups.yahoo.com/group/CrystalReportsDotNet/message/680
 
Ad

Advertisements

J

Jeff_Mac

Thanks for the quick reply. Actually I'm not having logon issues. Mine
seems to be failing to load the report document itself. As I said,
logon to the database seems to work, since I can absolutely get the
very same dataset to populate a datagrid.

Here's the code on the page, in case anyone can see where I'm going
wrong. (I've XXXXX'd out the server and initial catalog names in the
connection string.)

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource
Imports System.Data
Imports System.Data.OleDb

Public Class WebForm1
Inherits System.Web.UI.Page
Dim crReportDocument As New CrystalReport1
Dim DS As DataSet
Dim MyConnection As OleDbConnection
Dim MyCommand As OleDbDataAdapter


#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents MyDataGrid As
System.Web.UI.WebControls.DataGrid
Protected WithEvents CrystalReportViewer1 As
CrystalDecisions.Web.CrystalReportViewer

'NOTE: The following placeholder declaration is required by the
Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()

MyConnection = New
OleDbConnection("Provider=SQLOLEDB;workstation id='XXXXX';packet
size=4096;Trusted_Connection=Yes;data source=(local);persist security
info=False;initial catalog=XXXXX")
MyCommand = New OleDbDataAdapter("select * FROM
vw_RPT_Fiscal", MyConnection)

DS = New DataSet
crReportDocument = New CrystalReport1
MyCommand.Fill(DS, "vw_RPT_Fiscal")


crReportDocument.Database.Tables(0).SetDataSource(DS)
CrystalReportViewer1.ReportSource = crReportDocument

End Sub

#End Region

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


End Sub

End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top