Skip to Content
0

Database log in dialogue pops up in clients machine

Mar 30, 2017 at 01:06 PM

244

avatar image

I have already posted this question under the tag SAP crystal report but not much help.

I have a report that is developed in windows 10 using Visual studio 2013 , Crystal report 13.0.17.2096 and SQL server 2012. Report is populated using dataset and it has one table. On development environment it works fine. This report is called from a menu item. Every day our client login to our main program then print this report many times in a day. When they print this report first time for the day, a database login dialogue box pops up and does not let them print report . They close this program and try it again and it works for rest of the day without any problem. Everyday client close our main program before they leave. This problem occurs everyday. Our clients use windows 10 and they have both 32 and 64 bit runtime. I also tried providing login info but did not work. All those reports are converted using Crystal report 13.0.17.2096 have same problem. Please help.

Here is my code:

'---these variables are defined at the beginning of the form

Dim sConnStr As String = _

"User ID=" & EntryPoint.ssUser & _

";Password=" & EntryPoint.ssPassword & _

";Initial Catalog=" & EntryPoint.ssDatabase & _

";Data Source=" & EntryPoint.ssServer

Dim mConn As New SqlConnection(sConnStr)

'---------------------------------------------------

'-----Code below is in button click event------------

Dim da As New SqlDataAdapter(sql, mConn)

Dim ds As New DataSet1

mConn.Open()

da.Fill(ds, "datatable1")

mConn.Close()

Dim objRpt As New SalesByContact '------report

objRpt.SetDataSource(ds.Tables("datatable1"))

CrystalReportViewer1.ReportSource = objRpt

CrystalReportViewer1.Refresh()

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

20 Answers

Don Williams
Mar 30, 2017 at 03:06 PM
0

Don't use this :

CrystalReportViewer1.Refresh()

That causes the DB log on to pop up because it does not use the Dataset.

Are there any subreports in the report? Requires setting the data source to the DS also.

And the only reason it would fail is because the DSS does not match the Reports database info.

Don

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Williams

I forgot to mention that our project is windows project not web project. Thought it runs on windows 10 machine we complile them on .Net Framework 2.0 .

These reports are initially created on windows xp, using visual studio 2005 and crystal report 10.2.36 and were running without any problem for years. Since we converted them using crystal report 13.0.17.2096 this problem stared. Everyday our user complain about this.

CrystalReportViewer1.Refresh() is not in all reports and still they have this problem.

0
S Nayak Mar 30, 2017 at 04:03 PM
0

Regarding 'CrystalReportViewer1.Refresh()' I will remove that line from this report and try it. but i have another report where .Refresh () function is not used and still it has same problem and they do not have subreports.

Share
10 |10000 characters needed characters left characters exceeded
S Nayak Mar 30, 2017 at 04:41 PM
0

How do i check whether DSS match the Reports database info or not?

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Mar 31, 2017 at 07:39 PM
0

Export your DS to XML and then set location in CR Designer to the XML file, it may complain right away, if not then Verify DB in CR Designer.

something like this:

ds.WriteXml("c:\\reports\\sc2.xml", XmlWriteMode.WriteSchema);

Don

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Don

As per your suggestion I exported data set to xml and attached it to my report at design time. It did not give any warning and i could view date on design time by clicking Report preview tab. I also compared datatype in xml with that of my dataset they do match. As you know my report does not connect to database why do user get database log in dialogue?

Everyday user complains about it. I do not know what to do. I checked all online suggestion nothing works.

0
S Nayak Apr 10, 2017 at 01:15 PM
0

No it did not complain when I set location to xml file in CR designer and verify DB in CR designer.

Share
10 |10000 characters needed characters left characters exceeded
S Nayak Apr 11, 2017 at 04:42 PM
0

Hi don,

DSS matches the Report database info.

I removed CrystalReportViewer1.Refresh() line from my code still user gets database login dialogue.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 18, 2017 at 04:19 PM
0

OK, check runtime then and compare the DB drivers, it could be CR cannot find the MDAC drivers.

Don

Share
10 |10000 characters needed characters left characters exceeded
S Nayak Apr 19, 2017 at 01:26 PM
0

As I mentioned before user machines have latest run time both 32 and 64bit.

As per your suggestion I exported data set to xml and attached it to my report at design time. It did not give any warning and i could view date on design time by clicking Report preview tab. I also compared datatype in xml with that of my dataset they do match.

My report does not use any MDAC drivers it uses disconnected data set.Report is designed using .xsd file. Dataset in that file has just one table with fields.There is no data-adapter attached to that dataset. On my code I have a function that retrieves data from database then closes connection and returns dataset and that dataset is pushed in to report. Why do we need MDAC drivers?

Which folder I should check and what dll i need to check? Do I need to check registry?

Before I have mentioned that this problem is intermittent.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 21, 2017 at 08:26 PM
0

Ah, if it's intermittant then make sure you are closing the reports once done, coudl be youa re running out of contiguous memory space.

Don

Share
10 |10000 characters needed characters left characters exceeded
S Nayak Apr 24, 2017 at 05:12 PM
0

Yes I use rpt.Dispose().

As I mentioned before these reports were initially created on windows xp, using visual studio 2005 and crystal report 10.2.36 and were running without any problem for years. If it is a memory problem then why did not it happen before?

Share
10 |10000 characters needed characters left characters exceeded