Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CrystalReports ask for user and password for database, but not using one

Hi all

I designed a crystal reports report in .net 2005 professional. This report has an XML file as database so I choose the xml file in the designer and get the fields from there.The xml file is written to disk by a dataset in the same form.

So I have the rpt file already linked to the xml. After that I create an instance of ReportDocument object, load the xml file and assign this reportdocument to the CrystalReportViewer.ReportSource.

Everything works fine in the development machine, but when I install the application in other machine a dialog comes up asking for user and password in order to connect to a database, but i'm not using any.

Here's a piece of the code, I hope someone can help. Thanks!


//dataSet1 has been already loaded with data: now write the xml file:

dataSet1.WriteXml("barcodes.xml", XmlWriteMode.WriteSchema);

string filename = "barcodeslayout.rpt";//this is the report already designed and linked to the xml file

ReportDocument document = new ReportDocument();

document.Load(filename);

crystalReportViewer1.ReportSource = document;//Here is when it asks for user and password

Thanks

Victor

Not what you were looking for? View more on this topic or Ask a question