Link to home
Create AccountLog in
Avatar of imstac73
imstac73

asked on

Crystal Reports viewer database login issues

I have a website in which a user enters a date and clicks a button which has code that runs a crystal report to an excel file.  The data source for the report is an odbc connection which uses an IBM i series data driver.  I have taken the code from another project which uses a sql database connection. I tried to update the settings for SetDatabaseLogin for my other data source but I keep getting a "Database Login Failed
 CrystalReportViewer - CrystalReportViewer1
Error: Object reference not set to an instance of an object. " Error

I'm not sure if I just have the value incorrect in the SetDatabaseLogin or if because my datasource is not a sql database if I have to use a different method to connect.  Can someone help me with this. I have included my backend code and also screen shots of my ODBC connection.

Thanks.
crystalreport.txt
datasource.docx
Avatar of Mike McCracken
Mike McCracken

WHat code are you using now?

Where are the spreadsheets?

mlmcc
Avatar of imstac73

ASKER

I attached the code to the question - crystalreport.txt.  I don't know what you mean by spreadsheets?  The data source I'm connecting to is our Accounting system which is a flat file system on an ibm machine; thus the iSeries odbc driver.
SOrry, I saw the export to Excel as the source of the report rather than the destination of the data.

Does the ODBC connection exist on the machine?

If you create the same ODBC connection on the machine (same name) then there shouldn't be an issue with changing the datbase connection.

Are you using the version of Crystal that comes with VS2008 or a stand alone version?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of imstac73
imstac73

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I figured it out before anyone provided a solution.  I didn't want to just delete the question in case someone else ran into the same problem.