Last post Apr 01, 2013 05:40 AM by oneonesip2
Sep 04, 2012 12:15 PM|geeknout|LINK
I have seen this several times around the forum and still no working answer that I can find, maybe its something I'm doing not sure. Basically whenever I load a report from an aspx page it asks for aditional information EVEN THOUGH its set in the code
behind. Has anyone run into this? Or have any idea why?
This one looked promising, but still the same thing happened:
Here is my code:
protected void getReportDDL_SelectedIndexChanged(object sender, EventArgs e)
Panel1.Visible = true;
protected void RefreshButton_Click(object sender, EventArgs e)
private void ConfigureCrystalReports()
ReportDocument rpt = new ReportDocument();
string reportPath = Server.MapPath("~/reporting/reports/" + getReportDDL.SelectedValue);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "database"; //changed for security
connectionInfo.UserID = "user"; //changed for security
connectionInfo.Password = "password"; //changed for security
connectionInfo.IntegratedSecurity = false;
reportViewer.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;
Sep 05, 2012 07:07 AM|Ajay2707|LINK
As said in the above forum.
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 Once.
Give same credentials of above code to design time of crystal report again and save it.
Then execute your code, it will definately work.
Is there parameter in sp? then give it.
Sep 05, 2012 12:49 PM|geeknout|LINK
Wow with all do respect Ajay, do you honestly think I would post before trying that over and over in a fit of insanity? :) Yes I already tried that and it doesn't work.
Any other ideas please?
Side note: yes I do know users on here post before working on it themselves, but I have been fighting this for months now before this post.. I have read every tutorial I could find, every forum I could find, and still nothing..
Sep 06, 2012 01:10 AM|Ajay2707|LINK
I not blaim you. But the error show that something is mismatch in your credendial. Crystal report store the credential when you save it, at runtime if you give credential then it replace else it required the same credential which it is store.
Are you getting my point. So now you just again open and save with that credential where you want to connect. If you not connect to database then give your credential at design time, not refresh the report and save it. So it store that credential.
May be this help you.
Sep 06, 2012 01:17 AM|Ajay2707|LINK
plase see what is the flow of connection of crystal report.
Sep 06, 2012 12:14 PM|geeknout|LINK
As much as I'd like to say this is the answer, its not. I have tried everything you just said, more than once. If you do the same thing more than once and expect a different outcome thats a sign of insanity. I have tried with and without FQDN in the
servername, in the page_load and in the page_init.. all sorts of different configurations.., I even created a report following the guidelines and still no joy, etc. It can not possibly be this difficult and if it is then SAP and VS need pull their heads
out and get it together.
I appreciate your attempt to help, but I'm sorry that solution just isn't getting it.
Sep 06, 2012 12:33 PM|makwei88|LINK
I remember having the same problem when report on postback. I having hard time fixing it. so I change the button function to redirect back to the same page and save some parameters in sessions. load the report base on those parameters. Without postback,
everything work ok for me. This is not a solution, but can use as workaround.
Sep 19, 2012 09:41 AM|geeknout|LINK
Here is the working code for this solution:
put this in your Page_Init so that if the page is refreshed it doesn't blow up the report:
private ReportDocument reportDocument;
protected void Page_Init(object sender, EventArgs e)
reportDocument = (ReportDocument)Session["reportDocument"];
reportViewer.ReportSource = reportDocument;
Then this is code that actually sets the user/server information. I have noticed that whatever is in the report does not seem to matter:
private void LoadCrystalReports(string reportName)
ConnectionInfo myConnectionInfo = new ConnectionInfo();
ReportDocument myReport = new ReportDocument();
// name of the crystal report
Tables myTables = myReport.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in myTables)
TableLogOnInfo myTableLogonInfo = myTable.LogOnInfo;
myConnectionInfo.ServerName = "Servername"; //Your server
// <SQL servername>
myConnectionInfo.DatabaseName = ""; //Leave DB Blank
// leave database name blank
myConnectionInfo.UserID = "Username"; //Your User
myConnectionInfo.Password = "Password"; //Your Users Password
myTableLogonInfo.ConnectionInfo = myConnectionInfo;
Session["reportDocument"] = myReport;
reportViewer.ReportSource = myReport;
I wanted to add that I have all my reports running from the same page with a dropdownlist that is populated via Active Directory groups... So this will work with different reports that run off different DB's etc. as long as the server/username/password are
the same for each report.
Sep 28, 2012 12:49 PM|ryliu|LINK
I'd get help on this issue even it has been discussed before:
I have a Crystal Report which retrieves the data from an Oracle database. The goal is to suppress the login prompt. I used Visual Studio 2010 and use the code below. It worked fine. However, when I deployed it into the web server, I'm having the login prompt
again. I am lost and seeking for the help:
connectionInfo = new
tableLogonInfo = new
edmsdsm = rootWebConfig.AppSettings.Settings["edmsdsn"];
edmsuid = rootWebConfig.AppSettings.Settings["edmsuid"];
edmspwd = rootWebConfig.AppSettings.Settings["edmspwd"];
connectionInfo.ServerName = edmsdsn.Value.ToString();
connectionInfo.UserID = edmsuid.Value.ToString();
connectionInfo.Password = edmspwd.Value.ToString();
tableLogonInfo = rptTable.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
CrystalReportViewer1.ReportSource = edmsUserRoleList;
The login prompt is asking for a UID and PWD for login to the Oracle database. I am not sure I need to do anything about the account on to the web server side. The web server is Windows 2008 server in 64 bit.
Thanks for the help!
Sep 28, 2012 03:43 PM|geeknout|LINK
I am pretty unfamiliar with how crystal reports connects to oracle, but I know that with SQL server the connection type has to be ADO or it will continue to ask for information no matter what you do.
Sep 28, 2012 05:49 PM|ryliu|LINK
Yes. I have checked the Crystal Report with the Oracle connection, it is using the OLE DB (ADO) type and crdb_ado.dll assembly.
Oct 01, 2012 03:03 PM|ryliu|LINK
I am giving more of my findings:
The issue comes from after I published the web Crystal Report to a remote server. Since it worked before the publishing, i.e. no login prompt. For example, before publish, you run the application within Visual Studio 2010, you see it works in
http://localhost:port/AppName with no login prompt. However, when I published it into the Default Web Site, i.e.
http://localhost/AppName, it is no longer working. It prompt the login. In addition, at this moment, even you enter the correct user name and password, it still prompt you. It looks like the permission problem. But I am
not sure where it gets broken. Any hints are appreciated.
Apr 01, 2013 05:40 AM|oneonesip2|LINK
Hi, i have same problem, and try access the port but stille request login form, any other clue?