Skip to Content
0

"Logon failed" error after update from 13.0.15 to 13.0.17

Jan 11, 2017 at 12:34 PM

300

avatar image

Hi

I am allowed fix this problem.
https://archive.sap.com/discussions/thread/3946493

I have following idea. Bevor I open the report with the old logic convert the report connection and save the convertet report. But I have still the same failur.

My code:

using (CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument())
{
    rpt.Load(this.m_Model.ReportFilePath, OpenReportMethod.OpenReportByDefault);
    CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rcd;

    rcd = rpt.ReportClientDocument;
    rcd.DatabaseController.LogonEx(m_Model.DirPath + @"\RDReport.mdb", "", "", "");

    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag logonProperties =
        new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    logonProperties.Add("Database Name", m_Model.DirPath + @"\RDReport.mdb");
    logonProperties.Add("Database Type", "Access");

    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag connectionAttributes =
        new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    connectionAttributes.Add("Database DLL", "crdb_dao.dll");
    connectionAttributes.Add("QE_DatabaseName", m_Model.DirPath + @"\RDReport.mdb");
    connectionAttributes.Add("QE_DatabaseType", "Access/Excel (DAO)");
    connectionAttributes.Add("QE_LogonProperties", logonProperties);
    connectionAttributes.Add("QE_ServerDescription", m_Model.DirPath + @"\RDReport.mdb");
    connectionAttributes.Add("QE_SQLDB", true);
    connectionAttributes.Add("SSO Enabled", false);

    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo newConnInfo =
        new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo oldConnInfo;
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos oldConnInfos;

    oldConnInfos = rcd.DatabaseController.GetConnectionInfos(null);
    for (int I = 0; I < oldConnInfos.Count; I++)
    {
        oldConnInfo = oldConnInfos[I];
        newConnInfo.Attributes = connectionAttributes;
        newConnInfo.Kind =
            CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
        rcd.DatabaseController.ReplaceConnection(oldConnInfo, newConnInfo, null,
            crDBOptionUseDefault:
            CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB);
    }

    rpt.VerifyDatabase();
    rpt.SaveAs(this.m_Model.ReportFilePath, false);
}

rpt.VerifyDatabase(); have still the same error. What am I doing wrong?

Exception:

CrystalDecisions.CrystalReports.Engine.LogOnException: Fehler bei Anmeldung. ---> System.Runtime.InteropServices.COMException: 
Kein Fehler.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.VerifyDatabase()
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.VerifyDatabase()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()
   --- End of inner exception stack trace ---
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()
   at Main.Forms.CristalReportForm.ConvertReport() in P:\SBASTFSV02_Git\RelationDesk3 Core\Source\Main\Forms\CristalReportForm.xaml.cs:line 129
   at Main.Forms.CristalReportForm.PrintReports() in P:\SBASTFSV02_Git\RelationDesk3 Core\Source\Main\Forms\CristalReportForm.xaml.cs:line 138

I don't want to customize 200 reports by hand. :-(

Any idea?

10 |10000 characters needed characters left characters exceeded

Hi Roland,

Can you send me a report?

Don

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Roland Schumacher Jan 13, 2017 at 08:33 AM
0

Hi Don

I've you a little demo project with a rpt and a db.

https://drive.google.com/file/d/0B4M3wSiL0GcFa25xb1habE1xV0k/view?usp=sharing

Share
10 |10000 characters needed characters left characters exceeded
Roland Schumacher Jan 18, 2017 at 08:44 AM
0

Hi Don

Did you have time to take a look at my sample?

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Mar 21, 2017 at 05:06 PM
0

I can't, file won't come down...

Try using my Parameter app, it has log on abilities and see if that works.

https://launchpad.support.sap.com/#/notes/2281780

Don

Share
10 |10000 characters needed characters left characters exceeded