Showing results for 
Search instead for 
Did you mean: 

ADO.NET(XML) Logon failed in CR for Visual Studio

0 Kudos


I have a service which generates report output in requested format. All reports use ADO.NET (XML) as their data source during design and run-time.

The code is very simple. I just set location of XML:

                // load report template

                crReportDocument = new ReportDocument();

                crReportDocument.Load(templateFilePath, OpenReportMethod.OpenReportByTempCopy);

                if (crReportDocument.Database.Tables.Count > 1)


                    throw new Exception("Invalid report template. Report " + templateName + " contains " +

                        crReportDocument.Database.Tables.Count + " tables.");


                // Point a report to XML file

                crReportDocument.Database.Tables[0].Location = xmlFilePath;

                foreach (ReportDocument crSubReport in crReportDocument.Subreports)


                    crSubReport.Database.Tables[0].Location = xmlFilePath;


                //Export the report               


The service works fine on my workstation and on DEV server. But on QA server I keep on getting the following error for all reports:

Logon failed.

Error in File aacmpb_edk521mz.dii 4428_1268_{16C82480-29EB-4089-9927-1A15668F592B}.rpt:

Unable to connect: incorrect log on parameters.

at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable)

   at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)

   at myCFO.Services.CRGService.GenerateOutput(String templateName, Byte[] xmlData, ExportFormatType exportFormat)

XML file exist.

I verified XML files against template in Crystal Reports designer. No issues.

I'm lost. I cannot figure out why the same code works on one server and does not on another.

I use CRforVS_redist_install_64bit_13_0_16.

Please HELP!!!



Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Your App.config file is likely missing on that PC.

You also need this in it:

<startup useLegacyV2RuntimeActivationPolicy="true">

And check permissions, make sure the output folder has full read/write permission for IIS to access the folder.


0 Kudos

<startup useLegacyV2RuntimeActivationPolicy="true"> did the trick.

Thank you Don.

Answers (0)