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.