I have a report that works fine when running it from Visual Studio or Crystal Reports designer. When I loaded it to Select, it was throwing a "Logon Failed" error before it got to the parameters screen. I then did a "Verify Database" in the designer, save the report and loaded it to Select again - it then loaded fine for about 24 hours. Today it stopped working again with the same error.
When we look at the logs on our Select server, this is the error that we see:
Log on failed.
at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()
at SoftPro.CrystalReports.Runtime.Analyzer.LoadReport(String filePath, String connectionString)
at SoftPro.CrystalReports.Runtime.Analyzer.<>c__DisplayClass1.<BeginLoadReport>b__0()
I've tried reloading the report, reverifying, etc, but nothing works anymore. Any ideas?
Logon Error when loading report - Cameron
Moderator: Lisa Ennis
-
- Posts: 84
- Joined: Thu Sep 11, 2008 1:57 pm
Re: Logon Error when loading report - Cameron
Most reports have a parameter for the ProfileId in the stored procedure. The Select program does a verify database on the report the first time it is run in the user's session. When that verify happens, it has to be passed a guid for the verify to work correctly. If your stored procedure has the parameter for the profile, then you need this at the beginning of the stored procedure. Any guid will work, as this is only being used for the verify database.
Hope this helps!
Code: Select all
--Set to an ID for pre-loading of the report
IF @ProfileID IS NULL
SET @DAProfileID = 'F92D82EE-5D96-43EF-9F8C-8E403776F3AC'
ELSE SELECT @DAProfileID = core.GetProfileDataValueRecord(@ProfileID,'Data access filter')
Lisa Ennis
Senior Report Developer
SoftPro
Senior Report Developer
SoftPro
Re: Logon Error when loading report - Cameron
Lisa,
Thanks, I added that to the stored procedure then re-verified the database in the Crystal designer and re-uploaded the report to Select and it worked. It is strange that the the original report's stored procedure did not have the code in 2.6 and worked fine - and also that this report worked fine for a day in 3.0 before stopping with that error again. I'll let you know if it happens again.
Thanks!
Thanks, I added that to the stored procedure then re-verified the database in the Crystal designer and re-uploaded the report to Select and it worked. It is strange that the the original report's stored procedure did not have the code in 2.6 and worked fine - and also that this report worked fine for a day in 3.0 before stopping with that error again. I'll let you know if it happens again.
Thanks!