cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all and thanks for your answers

I have solved the problem assigning the ReportDocument object's DataSource just after loading the report document and it works. Here are the two lines, maybe it can help someone else:

document.Load(filename);
document.SetDataSource(dataTable1);

DataTable1 is a table in a datasource created in the same form as the crystalreportviewer object.

So thanks to all again and hope my post can help!

Former Member
0 Kudos

Hi Victor,

Please recreate the dataset and check if the issue persists.

The reason for this issue are:

1-When the schema changes.

2-When the dataset gets corrupted.

Regards,

Hitesh Mangtani

Former Member
0 Kudos

Hi Victor

Please visit the below link

If it is not what you are looking for, I would suggest you to please post your question to the Forums for

Business Objects SDK Application Development » .NET Development - Crystal Reports.

Hope this helps!!

Regards

Sourashree