omacron
Technical User
- Feb 5, 2002
- 149
Trying to created a vb.net program to run some existing crystal reports. Doing a test program this code correctly ran the report;
The issue being that it requires the user to enter in the database logon information. As you can guess this is a big no no...
So found this extremely helpful FAQ (please do not link to this as the answer)
The problem is the Crystal Reports uses a stored procedure. so when report is run it returns an error on this line;
With the error;
Before you ask "Is the stored procedure there?", it is. The report can be run from the database in Crystal Reports and stated above if the logon is not passed the report works correctly. If it helps this is what that line of code is exciting;
Code:
Dim cryRpt As New ReportDocument
cryRpt.Load("C:\MyCrystalReport1.rpt")
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
So found this extremely helpful FAQ (please do not link to this as the answer)
The problem is the Crystal Reports uses a stored procedure. so when report is run it returns an error on this line;
Code:
table.Location = crConnectionInfo.DatabaseName & ".dbo." & table.Location.Substring(table.Location.LastIndexOf(".") + 1)
Code:
The table 'MyStoredProcedure;1' could not be found. Error in File My Report {DB40FA45-0294-4C59-AD34-703FED5BBF76}.rpt: The table could not be found.
Before you ask "Is the stored procedure there?", it is. The report can be run from the database in Crystal Reports and stated above if the logon is not passed the report works correctly. If it helps this is what that line of code is exciting;
Code:
"MyDatabase.dbo.Proc(MyStoredProcedure;1)"