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

Problems running Crystal web reports

Status
Not open for further replies.

BobWman

Programmer
Jan 7, 2002
169
US
I am trying to install some reports on a web server using CR.NET, and can't get them to run using SQL Server. If I use an Access database, they run fine. I have tried 2 different methods of coding, and I get different errors. Here are the 2 code methods.

------------------------------------------------------
' This code generates "Logon Failed" message
Dim rpt As New CrystalReport1

SqlConnection1.ConnectionString = "user id=myuser;password=mypassword;data source=myserver;persist security info=False;initial catalog=mydatabase"

SqlDataAdapter1.Fill(DataSet1, "AddressType")
rpt.SetDataSource(DataSet1)
CrystalReportViewer1.ReportSource = rpt ' Error occurs here - "Logon Failed"
'DataGrid1.DataSource = DataSet1 ' I can successfully display the
'DataGrid1.DataBind() ' dataset in a datagrid

'Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

NOTE: If I comment out the line where I set the ReportSource, I can successfully display the dataset in a datagrid.

--------------------------------
This is the second method used
----------------------------------

' This code generates an "Invalid Table Number" error on test server.
' It works in IDE.
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
Dim crReportDocument As New CrystalReport1

'Set the ConnectionInfo properties for logging on to the Database
With crConnectionInfo
.ServerName = "myserver"
.DatabaseName = "mydatabase"
.UserID = "myuser"
.Password = "mypassword"
End With

CrTables = crReportDocument.Database.Tables

For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)

CrTable.Location = "CMTP_TEST.dbo." & CrTable.Location.Substring(CrTable.Location.LastIndexOf(".") + 1)
Next

'Set the viewer to the report object to be previewed.

CrystalReportViewer1.ReportSource = crReportDocument

' Exception Details: CrystalDecisions.CrystalReports.Engine.InvalidArgumentException:
' Error in File C:\DOCUME~1\WEBTEST\ASPNET\LOCALS~1\Temp\temp_555bef2a-0da7-4fbb-9704-80a6ab8fe44e.rpt: Invalid table number.

-----------------------

Thanks
 
I, too, am stuck on this error.

I googled the error and found some threads, but not one of them helped me solve the problem.

If anyone knows the solution, please post it!

Thx.
 
Why not just bind the report to a dataset and then the report becomes insulated from any underlying database. You can then fill the dataset from whatever datasource(s) that you want using the in-built system.data libraries and datadapters. Will be much easier working out what is going wrong and will make your application more robust as the report is not directly bound to a database.

James :)

James Culshaw
james@miniaturereview.co.uk
 
I may have part of the solution. I installed the latest service packs for both Crystal Enterprise 8 and Crystal Reports 8.5. Then I updated the viewer files (npviewer.exe, ActiveXViewer.cab, etc.) which my users can download from the server. When the updated viewer was downloaded, the problem was gone. This was done successfully on 2 servers. However, on one of the servers, it came back.

We are also trying to install some reports using CR9, and having other problems. Some of them seem to be related to Windows 2003.

Very frustrating. Wondering if we will ever be able to rely on Crystal for our reporting needs.
 
"Invalid Table Number" :

make sure Database Driver match 'Server Name'.
For ODBD connection ServerName is supposed to be DSN name.

I have no problem using pdssql.dll (SQL server).


yuhui
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top