Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public DataTable GetARCustomerPaymentsReportDetailed(String LocationID, String UserID, String PaymentType, DateTime FrDate, DateTime ToDate, int Type, int ReportType)
- {
- var table = new DataTable();
- var conn = new SqlConnection(connString);
- var command = new SqlCommand();
- command.CommandType = System.Data.CommandType.StoredProcedure;
- command.CommandText = "sp_Rpt_GetBankDepositByManagerForClient";
- command.Parameters.Add(new SqlParameter("@RegionID", 2));
- command.Parameters.Add(new SqlParameter("@LocID", LocationID));
- command.Parameters.Add(new SqlParameter("@UserID", UserID));
- command.Parameters.Add(new SqlParameter("@PaymentType", PaymentType));
- command.Parameters.Add(new SqlParameter("@Type", Type));
- command.Parameters.Add(new SqlParameter("@ReportType", ReportType));
- command.Parameters.Add(new SqlParameter("@FrDate", FrDate));
- command.Parameters.Add(new SqlParameter("@Todate", ToDate));
- command.Connection = conn;
- using (conn)
- using (command)
- using (var da = new SqlDataAdapter(command))
- {
- command.CommandType = CommandType.StoredProcedure;
- da.Fill(table);
- }
- conn.Close();
- return table;
- }
- if (ReportMode == '1') {
- url = '@Url.Action("ARCustomerPaymentsDetailedReport", "Report")';
- var strParams = '?LocationID=' + LocationID + '&Date1=' + FromDate + '&Date2=' + ToDate + '&ReportType=' + ReportType + '&PaymentType=' + PaymentTypeStr;
- var win = window.open(url + strParams);
- if (win) {
- //Browser has allowed it to be opened
- win.focus();
- }
- }
- public ActionResult ARCustomerPaymentsDetailedReport(String LocationID, DateTime Date1, DateTime Date2, int ReportType, String PaymentType)
- {
- ReportViewer reportViewer = new ReportViewer();
- reportViewer.SizeToReportContent = true;
- var DT = new ReportingDataService().GetARCustomerPaymentsReportDetailed(LocationID, "%", PaymentType, Date1, Date2, 0, ReportType);
- var DS = new DataSet();
- DS.Tables.Add(DT);
- reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\ReportFiles\ARCustomerPaymentsDetailed.rdlc";
- reportViewer.LocalReport.DataSources.Add(new ReportDataSource("ARCustomerPaymentsDetailedDS", DS.Tables[0]));
- ViewBag.ReportViewer = reportViewer;
- return View();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement