private DataTable exporttoexcel(string SubDivision, string CounterName, string fromdate, string todate, string userid) { report_Prop reportProp = new report_Prop(); reportProp.SubDivision = SubDivision; reportProp.CounterName = CounterName; reportProp.fromdate = fromdate; reportProp.todate = todate; reportProp.UserId = userid; report_bal reportbal = new report_bal(); DataTable dt = reportbal.ReportDailyPCSheet(reportProp); return(dt); }
private string DailyPCSheet(string SubDivision, string CounterName, string fromdate, string todate, string userid) { report_Prop reportProp = new report_Prop(); reportProp.SubDivision = SubDivision; reportProp.CounterName = CounterName; reportProp.fromdate = fromdate; reportProp.todate = todate; reportProp.UserId = userid; report_bal reportbal = new report_bal(); DataTable dt = reportbal.ReportDailyPCSheet(reportProp); StringBuilder sb = new StringBuilder(); if (reportbal.ErrMessage != "" && reportbal.ErrMessage != null) { return("0#" + reportbal.ErrMessage + "$"); } else { sb.Append("<tr>"); sb.Append("<th colspan=9>" + "Daily Payment ControlSheet" + "</th>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<th>" + "Sr No" + "</th>"); sb.Append("<th>" + "ACCNo" + "</th>"); sb.Append("<th>" + "PAYDATE" + "</th>"); sb.Append("<th>" + "COUNTERNO" + "</th>"); sb.Append("<th>" + "ReceiptNo" + "</th>"); sb.Append("<th>" + "AMOUNT" + "</th>"); sb.Append("<th>" + "CASH/CHEQUE" + "</th>"); sb.Append("<th>" + "CHEQUENO" + "</th>"); sb.Append("<th>" + "USER" + "</th>"); sb.Append("</tr>"); if (dt.Rows.Count > 0) { sb.Append("$"); for (int i = 0; i < dt.Rows.Count; i++) { sb.Append("<tr>"); sb.Append("<td>" + dt.Rows[i]["SrNo"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["ACCNo"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["PAYDATE"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["COUNTERNO"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["ReceiptNo"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["AMOUNT"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["CASH/CHEQUE"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["CHEQUENO"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["USER"].ToString() + "</td>"); sb.Append("</tr>"); } } else { sb.Append("<tr><td>No Record Found</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"); } //sb.Append("<tr><td colspan='9'>No Record Found</td></tr>"); } return(sb.ToString()); }