Hi,
I have developed payroll application (C# winform) with RDLC report. I generated the payslip using List control of RDLC to distribute payslip to every employee. But I can’t include the other table details with List control. The Timesheet and allowance table details may vary for each employee.
- I did't bind the dataset with tables
- Am using tableAdapter to select records and Programmatically assigning Dataset to reports. I am having lot of dynamic condtions on sql query
I have used three following tables
DTpayslip ( salID,empId,Datefrom,DateTo ,ect.. )
DTtimeSheet (SlNo, empID,Attend_Date, TimeIn, TimeOut)
DTallow _table (salID, empID, allowanceName, amount)

Dataset

Expected

Delpin Susai RajPosted Sep 29, 2016, 8:51 AM
Prem Anandh JPosted Oct 1, 2016, 6:19 AM
Delpin Susai RajPosted Sep 29, 2016, 8:50 AM
ReportDataSource dataSource = new ReportDataSource();
string reportTitle = "AuditReport"; ReportViewer12.LocalReport.ReportPath = Server.MapPath("../Reports/Report.rdlc");ReportViewer12.LocalReport.DisplayName = reportTitle;
ReportViewer12.LocalReport.Refresh();
ReportViewer12.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(ItemsSubreportProcessingEventHandler);
//The above event will fire for each sub report included in ur RDLC, u just need to supply datasorce according to ur sub report
public void ItemsSubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e){
switch (e.ReportPath){
case "CarrierDistributionReport":objCust._CustomerID = Convert.ToInt32(hfCustomerId1.Value);
DataSet ds1 = new DataSet();ds1 = objCust.AuditReport();
ReportDataSource dataSource = new ReportDataSource();dataSource.Name = "DataSet12_AuditReport";dataSource.Value = ds1.Tables[0];
e.DataSources.Add(new ReportDataSource("DataSet12_AuditReport", ds1.Tables[0]));
break;case "CostPerUserReport":
objCust._CustomerID = Convert.ToInt32(hfCustomerId1.Value);ds1 = new DataSet();ds1 = objCust.Get_CostPerUser();
dataSource = new ReportDataSource();
dataSource.Name = "DataSet11_Get_CostPerUser";dataSource.Value = ds1.Tables[0];
e.DataSources.Add(new ReportDataSource("DataSet11_Get_CostPerUser", ds1.Tables[0]));break;
case "PlanAndMinuteReport":objCust._CustomerID = Convert.ToInt32(hfCustomerId1.Value);
ds1 = new DataSet();ds1 = objCust.Get_CostPerUser();
dataSource = new ReportDataSource();dataSource.Name = "DataSet12_AuditReport";dataSource.Value = ds1.Tables[0];
e.DataSources.Add(new ReportDataSource("DataSet12_AuditReport", ds1.Tables[0]));
break;default:
break;}
}
Delpin Susai RajPosted Sep 29, 2016, 8:49 AM