My Crystal Report is using VB.NET and Sql server 2005.
The report can be displayed but everytime it will prompt me to key in the Username n Password..

is there anyway to automatically pass the login information to reports?


Recommended Answers

All 13 Replies

Member Avatar for iamthwee

An idea but not necessarily the best,

you could write it to the registry.

thanks for your reply, but could u guide me to how to achieve that?
cos im kinda new to all this

thanks lots!

ok i solved the problem myself..
i shall paste the code here if somebody met the same problem as me..

just need a simple code :

report.SetDatabaseLogon(user, pwd)

u need to declare the "report" and the user, pwd before this line of code..

Hi have tried this but no luck can anybody help with this

ok i solved the problem myself..
i shall paste the code here if somebody met the same problem as me..

just need a simple code :

report.SetDatabaseLogon(user, pwd)

u need to declare the "report" and the user, pwd before this line of code..

Thanks potatochips
command " report.SetDatabaseLogon(user, pwd)"
works for me.
Thanks & regards.

report.SetDatabaseLogon(user, pwd)report.SetDatabaseLogon(user, pwd)

u need to declare the "report" and the user, pwd before this line of code..

what does the dim statment look like?

commented: do you realise this thread is almsot 3 years old. -3

i a encountering this problem too
in my ms access databse in vb.net

I used report.SetDatabaseLogon(user, pwd)
but i dont know what to set in my user and pwd because i didnt set a username and password.

i declare report as
Dim report As New ReportDocument
is that correct?
help me.

I am not sure how this occured, I did not reply to this thread.
I use the report viewer and I feed the report parameters. I am building a web page that will have a dynamic menu and dynamic report viewer.
I gave up on attempting to send a user's credentials from the IIS server hosting a web page to the Report server. ( try that one on the fourm world. so many items where a person says Dynamic and people answer with a static solution or the one where someone suggests using Bacis Auth. no! )
However I realized all I needed to do was pass the user id to the report parameters and that works fine.
I do not need to log on to the data base, since that issue is taken care on the Report Server side.
I hope you resolve your issue.
P.S. I still use Crystal reports for Incident reporting. Crystal is used by Heat ( FrontRange ) and LanDesk.

try that open field explorer---> database field --->Right Click -->current Data source --->reports connection----->report ----->property ----> set Property as---

Data Source: .\Databasename.accdb

and code on viewer form load as

Dim cryRpt As New ReportDocument

Dim Report1 As New rptItemWise

Dim strServerName As String
strServerName = Application.StartupPath

rptItemWise.SetDatabaseLogon("admin", "", strServerName, "dastabasename.accdb", True)

cryRpt.Load(Application.StartupPath + "\rptItemWise.rpt")

also change the report connection same as data source i think that code work for you ....

hi friends just to project -right click--on project property---change .netframework4.5 to .netframework 3.5

Visual FoxPro d/b. Same issue.
I get this issue connecting to Visual FoxPro database from a ClickOnce Crystal Report App.
I just can't populate the Report as I have no idea what the UserID and Password for .DCT database
So I can't Parse the parameters in c# code as that is what I am using in Visual Studio 2012.

9 Oct 2016

When Crystal Reports prompts for a username and password while loading, it typically indicates that the report's data source requires authentication. This authentication is necessary to establish a connection and retrieve the data needed for the report.

Here are a few steps you can take to address the username and password prompt in Crystal Reports:

  1. Verify Database Credentials: Double-check the username and password you are entering to ensure they are correct. Ensure that you have the necessary credentials to access the database or data source associated with the report.

  2. Integrated Security: Crystal Reports supports various methods of authentication, including integrated security. If your database is configured to use integrated security, you can try connecting without providing explicit credentials. In this case, Crystal Reports will use the Windows credentials of the user running the report to establish the connection.

  3. Saved Credentials: Crystal Reports allows you to save database credentials within the report file. If you have previously saved the credentials, Crystal Reports will use them to connect automatically. However, if the saved credentials have changed or expired, you will be prompted for the updated username and password.

  4. Connection Properties: Check the connection properties within Crystal Reports to ensure they are accurately configured. Verify that the connection type, server address, port, database name, and other details match the requirements of your data source.

  5. ODBC or OLE DB Settings: If you are using an ODBC or OLE DB connection, review the settings in your data source's configuration. Ensure that the correct credentials are specified there, and update them if necessary.

  6. Network and Security Settings: Verify that there are no network or security restrictions preventing Crystal Reports from establishing a connection to the data source. Check firewall settings, network permissions, and database access controls to ensure they allow the necessary communication.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.