cancel
Showing results for 
Search instead for 
Did you mean: 

Database log in dialogue pops up in clients machine

Former Member
0 Kudos

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()

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Try updating all of your reports to CR 2016, log onto the DB server and then verify Database from the menu and then Preview each one.

You can get CR 2016 Trial here:

https://www.sap.com/products/crystal-reports.html

Fix any errors or field mappings etc.

Purchase a single case and then send me the reports and I'll do some testing.

https://www.sapstore.com/

Don

Answers (20)

Answers (20)

Former Member
0 Kudos

Hi Don

Do you have any further suggestion regarding this problem? I think this is crystal report's compatibility issue. Is there any fix for it?

Thanks

Former Member
0 Kudos

Hi Don

Finally I know why we have DB Login pop up error.

We have some reports that are created on visual studio 2005 and CR 10 version. If I run one of these old version reports and close it then I run a report created on latest version of CR then this error comes up.

Most of our projects are still in visual studio 2005 and CR10. Our user run both old and new reports everyday.

How would I solve this problem?

Thanks

Former Member
0 Kudos

I have mentioned earlier these reports do not have sub reports and in development environment we do not have any problem at all. Only our user when they run these reports have problem intermittently and it is not a web project. If you read my first post i have described it clearly.

Former Member
0 Kudos

Please see these attached images of set datasource location.

original-rpt.jpg -- this one from my report that is currently used

reportwithdata-after-exporting.jpg -- this one after exporting it to RPT format then opened in design mode.

First one has link to .xsd file but exported one does not have. Is there any problem?

I have checked my old report that was running on windows XP machine it has also same scenario but did not have any problem .

My previous answer i have mentioned that data set has a field type System.Byte() that is used to display image on these reports and while testing with your test project it gave me "no data Mr. Dumas, must log on" message due to error "Type 'System.String' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.".

Is new version of CR can not handle System.Byte() properly?

Can I send you my report with saved data and somebody can look into it?

According to you DB log on prompt is popping up because some data source for the report is failing.

One last question Why all our reports after converting to CR 13 version on windows 10 machine are having this problem ? Whey didn't they have problem when they are on CR 10 version and running on XP?

Please send me the link where we can open up a ticket.

Thanks

Former Member
0 Kudos

Hi Don,

On your test project i got "no data Mr.Dumnas, must log on" message because it fails on line where it says "if (rpt.Rows.Count > 0)".

I found actual error while debugging it.

Error is "Type 'System.String' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed."

In my data set i have a field whose datatype System.Byte(). and this field is used to display image on the report.

If i remove this field from my report i do not get that "no data Mr. Dumas" msg and i could see report with saved data.

This report does not have any formula fields and data set has just one table.

Our other reports have also 'database login' pop up problem but they do not have image field.

0 Kudos

One last note, the ONLY reason the DB log on prompt is popping up is because some data source for the report is failing so CR Viewer needs the info before it can show the results.

Check your report, log on and then export to RPT format and then in CR Designer look at the Connection properties. One of them should be showing a connection to the DB source, now fix your code or XML source so it matches the XML or Dataset file you are now using.

Open the report also and delete/remove any formula fields not used and tables etc. Even if the DB is in the report the SDK will need to connect to it.

Don

Former Member
0 Kudos

Hi Don,

I ran your test application using one of my report that was saved with data. When I click 'View Report' button it gave me

'no data Mr.Dumnas, must log on' message but i could see my report with data. If I run my report with no data it pops up same msg then prompt for parameter if report has one then blank report. I understand why it is blank because no data has been pushed in to it. There is no SQL statement or login info attached to it on design mode so how do I test it?

Could you please provide me the link to Estore.

Thanks

0 Kudos

Yes, go to the EStore and purchase a support case. I'll pick it up when I see it in the backlog.

Did you try it using my Parameter test app? You'll have to modify the log on click button and remove the parameter calls:

https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

Don

0 Kudos

Start removing parts of the report, subreports then whole sections until it starts working and see if you can find the cause.

I don't see code to log onto the subreport, is there one in your report? If so you need to set location for each also.

Former Member
0 Kudos

Hi Don,

Is it possible to have a ticket on this problem since it is not yet solved.

Thanks

Former Member
0 Kudos

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?

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Don

Former Member
0 Kudos

Hi don,

DSS matches the Report database info.

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.