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

Problems running CR.NET web reports

Status
Not open for further replies.

BobWman

Programmer
Jan 7, 2002
169
0
0
US
I am trying to install some reports on a web server, 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.
 
Did you figure out how to fix your problem ? I have the same one. Thank you in advance
 
No, I never did. This was posted on another thread, but I didn't get any help. You are the 3rd person who responded that they have the same problem. So, I guess 4 of us are stuck on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top