Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I am using SQL 2005 as the database server which required authentication.
When i tried to open a crystal report in a client browser it prompts and asks for user name and password of the sql database. I have already filled these information in the CrystalReport "database expert" windows. I don't want this authentication prompt in the client.
How should I prevent this?
Posted 17-Mar-10 22:34pm
Edited 17-Mar-10 23:03pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I had this same trouble in a program that I worked on a while back, but I use an Access database. I had designed a database to use for printing but never actually planned to use it to put data into it. It was just so I could design a report, and then in the program I would create an in-memory dataset that matched the database design and pass it to the crystal report. The problem seemed to come down to the fact that the program is expecting the machine it's running on to have that database in the same location as my computer when I designed it. So what I had to do was include that design database as part of my deployment and then in code point the ReportDocument object to where it would be located on the users machine. Something like this:
Dim strSchemaPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & System.IO.Path.DirectorySeparatorChar & "MySchemaDatabase.mdb"
Dim cdReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cdReportDocument.DataSourceConnections.Item(0).SetConnection(strSchemaPath, "", False)
cdReportDocument.SetDataSource(dsMyDataSet)
 
I have a feeling there must be a better way to get around this issue, but after searching for quite a while and finding nothing I just went with this. Hopefully this will at least help you continue your search if it doesn't work for SQL 2005 or for your specific program requirements.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.150326.1 | Last Updated 19 Mar 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100