Click here to Skip to main content
15,890,282 members

Comments by iceprincess50 (Top 5 by date)

iceprincess50 28-Feb-12 6:18am View    
i made crystal report to retrivte data between two dates
but it show only column name
iceprincess50 8-Feb-12 5:46am View    
thanx i solved it
iceprincess50 8-Feb-12 5:08am View    
thanx but i have another error

The name 'mDBHelper' does not exist in the current co

DataTable mDT_Report = new DataTable();
ReportDocument cryRpt = new ReportDocument();
mDT_Report=mDBHelper.GetTable("select * from emp");
cryRpt.Database.Tables[0].SetDataSource(mDT_Report);
MessageBox.Show("Generating Report", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
crystalReportViewer1.ReportSource = cryRpt;
iceprincess50 8-Feb-12 4:27am View    
i tried this solution but i have another error

DataTable mDT_Report = new DataTable();
ReportDocument cryRpt = new ReportDocument();

cryRpt.Load(@"G:\\WindowsApplication2\\WindowsApplication2\\CrystalReport1.rpt");
foreach (CrystalDecisions.CrystalReports.Engine.Table table in cryRpt.Database.Tables)
{
table.LogOnInfo;
LogOnInfo.ConnectionInfo.ServerName = "server";
LogOnInfo.ConnectionInfo.DatabaseName = "f_library";
LogOnInfo.ConnectionInfo.UserID = "sa";
LogOnInfo.ConnectionInfo.Password = "ahmed";
table.ApplyLogOnInfo(LogOnInfo);
}
cryRpt.Database.Tables[0].ApplyLogOnInfo(LogInfo);

mDT_Report = mDBHelper.GetTable("select * from emp");
cryRpt.Database.Tables[0].SetDataSource(mDT_Report);
MessageBox.Show("Generating Report", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
crystalReportViewer1.ReportSource = cryRpt;


}

Error 1 Only assignment, call, increment, decrement, and new object expressions can be used as a statement G:\WindowsApplication2\WindowsApplication2\frm_report.cs 45 17 WindowsApplication2


i already make crystal report and choose data from sql connection

Data Source=server;Initial Catalog=f_library;User ID=sa;Password=ahmed
iceprincess50 31-Jan-12 6:46am View    
thannnnnnnnnnnnnnnnnnnnnnnnnnnnnnx