Skip to Content
0

Why Database log in dialogue pops up in clients machine?

Mar 28, 2017 at 08:25 PM

31

avatar image

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. 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.

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.

2 Answers

Brian Dong Mar 28, 2017 at 10:19 PM
0

Hi,

Does your report only have 1 table in it? You should be calling SetDataSource for each table.

Brian

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

Data are retrieved from different tables using one Sql query but dataset has one table.

0
S Nayak Mar 29, 2017 at 02:46 PM
0

Data are retrieved from different tables using one Sql query but dataset has one table.

Client also have SAP Crystal Reports runtime engine for .Net Framework (64 - bit)

Share
10 |10000 characters needed characters left characters exceeded