Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove DATABASE LOGIN window 1

Status
Not open for further replies.

LOGGIECROFT

Programmer
Joined
Oct 1, 2001
Messages
5
Location
CA
I Can't figure out how to remove the login window that displays for database connection.
Also, I don't understand why there is one, since my report is displaying data from a XML schema.
But since the XML schema is tied to a datasource, which is tied to the dataadapter, which contains the connection to my server... this must be why! Not sure....

Using CR9 and VB.NET.
A windows form with a crystal report viewer control on it to preview the report on screen.
I manually populate a dataset then save it as a XML schema.

Dim ldaInfo As SqlDataAdapter = New SqlDataAdapter(lcSQL, pconSQLDB)
Dim ldsInfo As DataSet = New DataSet()
ldaInfo.Fill(ldsInfo, "DATA1")
ldsInfo.WriteXml("C:\TEMP\DATA\DATA1XML.xml", XmlWriteMode.WriteSchema)

Dim oRpt As crReport
oRpt = New crReport()
oRpt.SetDataSource(ldsInfo)
crvReport.DisplayGroupTree = False
crvReport.ReportSource = oRpt
crvReport.BringToFront()
crvReport.Visible = True

A database login window appear asking for Server name, database name, username & password.

How can I disregard this database login window?
Since the user is already signed on my app at the beginning, I don't want this login to appear.

It was not displayed before.
Only after I upgraded from CR8.5 to CR9, changed my reference in my project from 1 to 2 for crystal reports.
Also installed Hot Fix from crystal reports to fix other problems they had(invalid datasource...)

Any help would be greatly appreciated,
Arsene
 
I FINALLY FOUND THE PROBLEM...Ironically, I developed the same bug at about the same time you did. After much testing here is what I have found:
The Client Probably has cr10netwin_en_sp1.exe installed (latest service pack). I applied it to my development machine and discovered the same problem.

It appears that the Crystal Engine has problems using more than one table from a DataSet. The workaround is to create a new DataSet with a single table. This table then contains all fields required for your report. Uset the DataSet's WriteXMLSchema method to generate a new schema.

Then, redo your report based on the single table DataSet.
Then, in your report you need to do something like the following:

MonitorReport report = new MonitorReport();
//Add some parameters?
report.SetParameterValue("VideoSource",vid);
report.SetParameterValue("StartDate",startDate);
report.SetParameterValue("EndDate",endDate);
//This is routine to generate the DataSet and DataTable
DataSet resultSet =
CreateDataView(reportData,monitorReport);
//Important Note: DataSource is a Table and not the DataSet.
report.SetDataSource(resultSet.Tables[0]);
repViewerMonitor.ReportSource = report;

I hope this helps.
Dave Girvitz, MCAD.
 
To solve the problem,you ONLY need to reset DataSource.
Just change it from Dataset to DataTable:

report1.SetDataSource(DataSet1.tables(0))

report2.SetDataSource(DataSet1.tables(1))

...

I'm pretty sure this bug is caused by some hot fixes.(I don't know which one). The difference is that the newer engine needs more detailed datasoure definition: not DataSet level but DataTable level. However, it can still handle dataset with multiple tables.

Hope this will help.
Gang Ma
Oracle DBA


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top