Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I try sap Crystal Reports. before i install the sap exe. i get one error. i post that here also. But one guy delete that. its ok.

Now i reach 75%.

I am using Model1.edmx for my program. But crystal reports want one dataset.xsd. so i added that also.

CrystalReport2 cr2 = new CrystalReport2();
CrystalReportViewer rpt = new CrystalReportViewer();
WindowsFormsHost host = new WindowsFormsHost();
rpt.ReportSource = cr2;
host.Child = rpt;
reportGrid.Children.Add(host);


In viewing Crystal Report, Login window is appering. my server name is 192.168.1.100 but it show mcs_kioskDataSet.

my connection string is
<add key="Connection String" value="SERVER=192.168.1.100;DATABASE=mcs_kiosk;UID=root;PASSWORD=;" />


if i put manualy,. it gave login failed window.

how can i implement this connection string in dataset for crystal report.

pls help me.

and code project guys,. pls dont delete this question. this is different question. first you read fully, and take action. dont think you only intelligent.

Update -

My Code -

private void Window_Loaded(object sender, RoutedEventArgs e)
{            
            CrystalReport2 cr2 = new CrystalReport2();
                CrystalReportViewer rpt = new CrystalReportViewer();

                ConnectionInfo ci = new ConnectionInfo();                
                ci.ServerName = "192.168.1.100";
                ci.DatabaseName = "mcs_kiosk";
                ci.UserID = "root";
                ci.Password = "";
                SetDBLogonForReport(ci, cr2);

                WindowsFormsHost host = new WindowsFormsHost();
                rpt.ReportSource = cr2;
                host.Child = rpt;
                reportGrid.Children.Add(host);
}


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;
               table.ApplyLogOnInfo(tableLogonInfo);
           }
       }


In Running time,. the crystal report loading,.. after some time one Database login window is open,.

it ask servername, database name, loginId, Password. I give correct anwser to that. but login Faild please try again information was thrown.

i am using vs 2010, my sql.
Posted
Updated 7-Apr-11 19:02pm
v6
Comments
Sandeep Mewara 7-Apr-11 9:54am    
...first you read fully, and take action. dont think you only intelligent
:) :) :)
Do you really think the last part was necessary? Is that going to help you out?

I guess lets see should be the answer.
thatraja 7-Apr-11 10:03am    
what's the full error message? mention it clearly in your question.
Sagotharan Jagadeeswaran 8-Apr-11 0:52am    
@ Sandeep Mewara.
Ya, That part is necessary. Otherwise Someone delete my question.
Sagotharan Jagadeeswaran 8-Apr-11 1:04am    
@thatraja,
now i add some more information. its enough. or what i give to get solution,.
Sagotharan Jagadeeswaran 8-Apr-11 1:32am    
http://stackoverflow.com/questions/2812494/crystal-reports-failed-database-login

This is my error also.,

1 solution

Here you go

C# Crystal Reports Dynamic Logon parameters[^]

Free attachment

Understanding the Login Failed Error in Crystal Reports[^]

Troubleshooting Database Login Errors using Crystal Reports with .NET[^]

Sagotharan Jagadeeswaran wrote:
and code project guys,. pls dont delete this question. this is different question. first you read fully, and take action. dont think you only intelligent.

BTW now what about Code project guys? :-)
 
Share this answer
 
Comments
Sagotharan Jagadeeswaran 8-Apr-11 3:35am    
dear thatraja,
i already visited those sites. but they cannot solve my problem. i update here also,..

ci.ServerName = "192.168.1.100";
ci.DatabaseName = "mcs_kiosk";
ci.UserID = "root";
ci.Password = "";
but report viewer asking loin again and again., and i wrote those line who delete my previous question. dodnt mis understand.
:-).
thatraja 8-Apr-11 11:21am    
Actually I gave you perfect link(Here before it solved almost 7-10 enquirers questions in CP). Anyway what's the error message? But try the code from the link page in my answer & then come.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900