Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 28, 2011 02:52 AM by necro_mancer
Jan 16, 2008 12:01 PM|LINK
Whenever I open my Crystal Report page, I am taken to the Database Authentication page where I am asked for
Is there a way to avoid this and I save these authentication in my page once.
I am using VS2005, C#.
Any Help will be appriciated.
Jan 16, 2008 12:11 PM|LINK
did you use Typed DataSet to generate Crystal Report ??
if so, then make sure that the Name or the DataTable in "Typed DataSet" and the
Name DataTable that you assign as "RecordSource" to crystal reprort must be same...
hope it helps./.
Jan 17, 2008 07:58 AM|LINK
I used "Field Explorer window" to create Ole Db (ADO) Connection.
and I provided all information Server Name, ID, Password and DB name during the connection Creation Process.
but when I open the crystal report page. It ask all these info again.
It is anoying to enter this information again and again.
any solution that we save this information some where during connection creation once.
and we don't need to enter it again and again while accessing the crystal report pages.
Jan 17, 2008 11:20 AM|LINK
Set the logon information in you code as shown below. Use this code approach instead.
public partial class _Default : System.Web.UI.Page
private ReportDocument rpt;
private void Page_Init(object sender, EventArgs e)
protected void Page_Load(object sender, EventArgs e)
private void ConfigureCrystalReports()
rpt= new ReportDocument();
string reportPath = Server.MapPath("youreportname.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "Northwind";
connectionInfo.UserID = "user";
CrystalReportViewer1.ReportSource = rpt;
private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
If my post helped you please MARK AS ANSWER.
Jan 17, 2008 12:24 PM|LINK
I also used Typed Dataset. but could not solve the problem.
I am beginner to asp.net so guide me in details.
Jan 17, 2008 12:32 PM|LINK
Even though You have included the logon information when creating the connection(in wizards) you also have to provide the logon information in your code. As u are using vs 2005 which uses crystal reports 10 a logon screen is automatically displayed. If u
would have used crystal reports in vs 2003 an exception would have raised. So to get rid of the login screen include the user id and [password in your code as well as I have shown you in the code sample above.
If my post helped you please MARK AS ANSWER
Thanks and Regards,
Jan 18, 2008 07:50 AM|LINK
I did exactly as you mentioned above.
but Login screen is still asking for the details except one change that now I can see the user ID in my User ID field. but other fields (db name, password) are still showing empty, Although I added the information correctly in the code.
Please Advise what is the Possible problem and how can i fix it.
Thanks so much for you help
Jan 18, 2008 08:50 AM|LINK
Please check once again whether you have given the user credentials both while designing the crystal report and in the code. AFAIK it should work. The logon credentials which you give in the wizards should also match the logon credentials in your code. Check
if my post helped you please MARK AS ANSWER
Jan 18, 2008 09:50 AM|LINK
Thanks very much for your prompt reply.
My problem is Solved (using Ole Db connection and Crystal report) by using ur code.
But Still there is something in which you can help me.
I am trying to do this by Typed DataSet(using existing connection in my Web.config ConnectionString) and it does not work with the DataSet. Same problem asking for the authentication....
Can you guide me in this case.
Because I want to use my existing project's db connection which is in my web.config file for reports to avoid repeating.
Thanks in advance.
Jan 18, 2008 10:07 AM|LINK
Instead of binding the dataset try binding the DataTable it should work. I did this and it worked for me.
Sreekanth Reddy. L