Skip to Content
avatar image
Former Member

"Logon failed" error after update from 13.0.15 to 13.0.17

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 21, 2017 at 05:06 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2017 at 08:33 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 18, 2017 at 08:44 AM

    Hi Don

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

    Add comment
    10|10000 characters needed characters exceeded