on 09-12-2008 11:48 AM
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.