public ActionResult GatePass() { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); string DealerCode = Session["DealerCode"].ToString(); string old = grl.GetStringValuesAgainstCodes("TransCode", Session["TransCode"].ToString(), "GatePassCode", "GatePassTemp", " and Module='Sales'", Session["DealerCode"].ToString()); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), new SqlParameter("@DONo", SqlDbType.VarChar) }; param[0].Value = DealerCode; param[1].Value = old; SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); if (sysFunc.ExecuteSP("SP_DeliveryOrderGatePass", param, ref rder)) { data.SP_DeliveryOrderGatePass.Load(rder); } RD.Load(Server.MapPath("~/Reports/rptGatePass.rpt")); //RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Delivery Order Gate Pass'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); try { Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "ProductReceiptReport.pdf")); } catch { throw; } }
public ActionResult CommisionDetailReport(string Enquiry, string FromDate, string ToDate, string Emp, string Service) { if (string.IsNullOrEmpty((string)Session["DealerCode"])) { return(RedirectToAction("Login", "Home")); } DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), // new SqlParameter("@FromDate", SqlDbType.VarChar), //1 new SqlParameter("@ToDate", SqlDbType.VarChar), //2 new SqlParameter("@Emp", SqlDbType.VarChar), //1 new SqlParameter("@Service", SqlDbType.VarChar), //2 }; param[0].Value = Session["DealerCode"].ToString(); param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = Emp; param[4].Value = Service == "0" ? "" : Service; try { SqlDataReader rder = null; sysfunc.ExecuteSP("SP_MonthlyCommisionDetailReport", param, ref rder); data.EnforceConstraints = false; data.SP_MonthlyCommisionDetailReport.Load(rder); RD.Load(Server.MapPath("~/Reports/MonthyCommisionDetailReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Monthly Commission Detail Report'"; RD.DataDefinition.FormulaFields["FromDate"].Text = "'" + FromDate + "'"; RD.DataDefinition.FormulaFields["ToDate"].Text = "'" + ToDate + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "DetailEnquiryReport.pdf")); } catch { throw; } }
public ActionResult Exports( ) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); string dealerCode = Session["DealerCode"].ToString(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), //new SqlParameter("@BuyingCode",SqlDbType.Char) }; param[0].Value = dealerCode; // param[1].Value = EnquiryId; SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); try { if (sysFunc.ExecuteSP("Select_DealFailYes", param, ref rder)) { data.EnforceConstraints = false; data.Select_DealFailYes.Load(rder); } RD.Load(Server.MapPath("~/Reports/Sale/DealFailReport.rpt")); // RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; //RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; //RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Deal Fail Evaluation Details'"; //RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; // RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; //RD.DataDefinition.FormulaFields["FrontImg"].Text = "'" + data.Select_BuyingCodeReport.Rows[0]["Pic01"].ToString() + "'"; //RD.DataDefinition.FormulaFields["BackImg"].Text = "'" + data.Select_BuyingCodeReport.Rows[0]["Pic02"].ToString() + "'"; //RD.DataDefinition.FormulaFields["LeftImg"].Text = "'" + data.Select_BuyingCodeReport.Rows[0]["Pic03"].ToString() + "'"; //RD.DataDefinition.FormulaFields["RightImg"].Text = "'" + data.Select_BuyingCodeReport.Rows[0]["Pic04"].ToString() + "'"; //RD.DataDefinition.FormulaFields["TopImg"].Text = "'" + data.Select_BuyingCodeReport.Rows[0]["Pic05"].ToString() + "'"; RD.Database.Tables[0].SetDataSource(data); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "InstallmentReceiptReport.pdf")); } catch { throw; } }
public ActionResult Export(string EnquiryId, string DealerCode) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), new SqlParameter("@CusCode", SqlDbType.VarChar) }; param[0].Value = DealerCode; param[1].Value = EnquiryId; SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); if (sysFunc.ExecuteSP("SP_InstallmentLedgerReport", param, ref rder)) { data.SP_InstallmentLedgerReport.Load(rder); } RD.Load(Server.MapPath("~/Reports/InstallmentLedgerReport.rpt")); RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'CUSTOMER INSTALLMENT LEDGER'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); try { Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "ProductReceiptReport.pdf")); } catch { throw; } }
public void InvoicePrint(string EnquiryId, string DealerCode) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), new SqlParameter("@EnquiryId", SqlDbType.VarChar) }; param[0].Value = DealerCode; param[1].Value = EnquiryId; SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); if (sysFunc.ExecuteSP("SP_EventDetail_Select", param, ref rder)) { data.SP_EventDetail_Select.Load(rder); } this.HttpContext.Session["rptSource"] = data; }
public ActionResult Export(string EnquiryId, string DealerCode) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), new SqlParameter("@EnquiryId", SqlDbType.VarChar) }; param[0].Value = DealerCode; param[1].Value = EnquiryId; SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); if (sysFunc.ExecuteSP("SP_Select_ProdRec_Print", param, ref rder)) { data.EnforceConstraints = false; data.SP_Select_ProdRec_Print.Load(rder); } // SqlParameter[] param2 = //{ // new SqlParameter("@DealerCode",SqlDbType.Char), // new SqlParameter("@DONo",SqlDbType.VarChar), // new SqlParameter("@Type",SqlDbType.VarChar) // }; // param2[0].Value = DealerCode; // param2[1].Value = EnquiryId; // param2[2].Value = "VR"; // if (sysFunc.ExecuteSP("SP_GetDeliveryCheckList", param2, ref rder)) // { // data.SP_GetDeliveryCheckList.Load(rder); // } RD.Load(Server.MapPath("~/Reports/VehicleReceipt.rpt")); RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Vehicle Receipt Report'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); try { Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "ProductReceiptReport.pdf")); } catch { throw; } }
public ActionResult DetailReport(string Enquiry, string FromDate, string ToDate) { if (string.IsNullOrEmpty((string)Session["DealerCode"])) { return(RedirectToAction("Login", "Home")); } DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), // new SqlParameter("@FromDate", SqlDbType.VarChar), //1 new SqlParameter("@ToDate", SqlDbType.VarChar), //2 }; param[0].Value = Session["DealerCode"].ToString(); param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); try { SqlDataReader rder = null; if (Enquiry == "Detail Expenditure") { sysfunc.ExecuteSP("Sp_ExpenditureDetail_DateWise", param, ref rder); data.EnforceConstraints = false; data.Sp_ExpenditureDetail_DateWise.Load(rder); RD.Load(Server.MapPath("~/Reports/Sale/ExpenditureDetail_DateWise.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Daily Expenditure Detail Report'"; } else if (Enquiry == "Vehicle Return") { sysfunc.ExecuteSP("SP_VehicleReturn_DetailReport", param, ref rder); data.EnforceConstraints = false; data.SP_VehicleReturn_DetailReport.Load(rder); RD.Load(Server.MapPath("~/Reports/VehicleReturnDetail.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Vehicle Return Detail Report'"; } else if (Enquiry == "Price Offer Negotiation") { sysfunc.ExecuteSP("SP_Report_DetailPriceOffer", param, ref rder); data.EnforceConstraints = false; data.SP_Report_DetailPriceOffer.Load(rder); RD.Load(Server.MapPath("~/Reports/Sale/PriceOfferDetail.rpt.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Price Offer/ Negociation Details '"; } else if (Enquiry == "Sales Target") { sysfunc.ExecuteSP("SP_SaleTargetReport", param, ref rder); data.EnforceConstraints = false; data.SP_SaleTargetReport.Load(rder); RD.Load(Server.MapPath("~/Reports/SalesTargetReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Sales Target'"; } else if (Enquiry == "Monthly Sale w.e.f Booking Order") { sysfunc.ExecuteSP("sp_Sales_CommisionReport", param, ref rder); data.EnforceConstraints = false; data.sp_Sales_CommisionReport.Load(rder); RD.Load(Server.MapPath("~/Reports/MonthlySale.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Monthly Sale From Booking Order'"; } else { sysfunc.ExecuteSP("SP_ConversionRatio_Report", param, ref rder); data.EnforceConstraints = false; data.SP_ConversionRatio_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/ConversionRatio.rpt")); } RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["FromDate"].Text = "'" + FromDate + "'"; RD.DataDefinition.FormulaFields["ToDate"].Text = "'" + ToDate + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; ////RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "DetailEnquiryReport.pdf")); } catch { throw; } }
public ActionResult ERExport(string EnquiryId, string EmpCode, string FromDate, string ToDate) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), // new SqlParameter("@FromDate", SqlDbType.VarChar), //1 new SqlParameter("@ToDate", SqlDbType.VarChar), //2 new SqlParameter("@Type", SqlDbType.VarChar) }; param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = EmpCode == "0" ? "" : EmpCode; try { SqlDataReader rder = null; if (EnquiryId == "Enquiry Detail") { sysfunc.ExecuteSP("SP_EnquiryDetailReport", param, ref rder); data.EnforceConstraints = false; data.SP_EnquiryDetailReport.Load(rder); RD.Load(Server.MapPath("~/Reports/EnquiryDetailReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Enquiry Detail Report'"; } else { sysfunc.ExecuteSP("SP_FollowUpDetailReport", param, ref rder); data.EnforceConstraints = false; data.SP_FollowUpDetailReport.Load(rder); RD.Load(Server.MapPath("~/Reports/FollowUpDetailReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'FollowUp Detail Report'"; } RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "DetailEnquiryReport.pdf")); } catch { throw; } }
public ActionResult Export(string EnquiryId, string Type, string FromDate, string ToDate) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), // new SqlParameter("@FromDate", SqlDbType.VarChar), //1 new SqlParameter("@ToDate", SqlDbType.VarChar), //2 new SqlParameter("@Type", SqlDbType.VarChar) }; param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = Type; try { SqlDataReader rder = null; if (EnquiryId == "Vehicle Receipt") { sysfunc.ExecuteSP("SP_ProdRecMaster_Report", param, ref rder); data.EnforceConstraints = false; data.SP_ProdRecMaster_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/crptProdRecMasterReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Vehicle Receipt Detail'"; } else if (EnquiryId == "Delivery Order") { sysfunc.ExecuteSP("SP_VehicleDeliveryMaster_Report", param, ref rder); data.EnforceConstraints = false; data.SP_VehicleDeliveryMaster_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/crptVehicleDeliveryReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Delivery Order Detail'"; } else if (EnquiryId == "Pending Booking Number") { sysfunc.ExecuteSP("SP_Select_PendingBookingNumber", param, ref rder); data.EnforceConstraints = false; data.SP_Select_PendingBookingNumber.Load(rder); RD.Load(Server.MapPath("~/Reports/PendingBookingNo.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Pending Booking Number'"; } else if (EnquiryId == "Pending Invoice Number") { sysfunc.ExecuteSP("SP_Select_PendingVehicleReceipt", param, ref rder); data.EnforceConstraints = false; data.SP_Select_PendingVehicleReceipt.Load(rder); RD.Load(Server.MapPath("~/Reports/PendingInvoice.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Pending Vehicle Receipt'"; } else if (EnquiryId == "Pending Payments") { sysfunc.ExecuteSP("SP_PendingPaymentsReport", param, ref rder); data.EnforceConstraints = false; data.SP_PendingPaymentsReport.Load(rder); RD.Load(Server.MapPath("~/Reports/PendingPaymentsReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Pending Payments'"; } else { sysfunc.ExecuteSP("SP_BookingOrderDetailReport", param, ref rder); data.EnforceConstraints = false; data.SP_BookingOrderDetailReport.Load(rder); RD.Load(Server.MapPath("~/Reports/BookingOrderDetailReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Booking Order Detail'"; } RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "ProductReceiptReport.pdf")); } catch { throw; } }
public ActionResult ExportBuyingDetail(string todate, string fromdate) { string dealerCode = Session["DealerCode"].ToString(); DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), new SqlParameter("@fromDate", SqlDbType.DateTime), new SqlParameter("@ToDate", SqlDbType.DateTime), }; param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(todate); param[2].Value = sysfunc.SaveDate(fromdate); SqlDataReader rder = null; SysFunction sysFunc = new SysFunction(); if (sysFunc.ExecuteSP("Select_ExchangeVehicle_DetailReportData", param, ref rder)) { data.EnforceConstraints = false; data.Select_ExchangeVehicle_DetailReportData.Load(rder); } RD.Load(Server.MapPath("~/Reports/VehicleExchangeDetail.rpt")); RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; //RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; //RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Exchange Details '"; //RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; // RD.DataDefinition.FormulaFields["Pic"].Text = "'C:\\Users\\u_ahm\\OneDrive\\Documents\\Visual Studio 2010\\Projects\\WebApplication1\\WebApplication1\\" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["FromDate"].Text = "'" + fromdate + "'"; RD.DataDefinition.FormulaFields["ToDate"].Text = "'" + todate + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); try { Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "InstallmentReceiptReport.pdf")); } catch { throw; } }
public ActionResult Export(string Type, string rptType, string FromDate, string ToDate) { DSReports data = new DSReports(); ReportDocument RD = new ReportDocument(); SqlDataReader rder = null; SqlParameter[] param = { new SqlParameter("@DealerCode", SqlDbType.Char), // new SqlParameter("@FromDate", SqlDbType.VarChar), //1 new SqlParameter("@ToDate", SqlDbType.VarChar), //2 new SqlParameter("@Type", SqlDbType.VarChar), new SqlParameter("@RptType", SqlDbType.VarChar) }; if (rptType == "VS") { param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = Type; param[4].Value = "VS"; sysfunc.ExecuteSP("SP_VehicleStock_Report_New", param, ref rder); data.EnforceConstraints = false; data.SP_VehicleStock_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/VehicleStockReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Vehicle Stock'"; } else if (rptType == "ID") { param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = Type; param[4].Value = "ID"; sysfunc.ExecuteSP("SP_VehicleStock_Report_New", param, ref rder); data.EnforceConstraints = false; data.SP_VehicleStock_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/VehicleStockReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Invoice Detail'"; } else { param[0].Value = dealerCode; param[1].Value = sysfunc.SaveDate(FromDate); param[2].Value = sysfunc.SaveDate(ToDate); param[3].Value = Type; param[4].Value = "PI"; sysfunc.ExecuteSP("SP_VehicleStock_Report_New", param, ref rder); data.EnforceConstraints = false; data.SP_VehicleStock_Report.Load(rder); RD.Load(Server.MapPath("~/Reports/VehicleStockReport.rpt")); RD.DataDefinition.FormulaFields["ReportTitle"].Text = "'Pending Invoice Detail'"; } try { RD.DataDefinition.FormulaFields["DealerDesc"].Text = "'" + Session["DealerDesc"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerAddress"].Text = "'" + Session["DealerAddress"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerPhone"].Text = "'" + Session["DealerPhone"].ToString() + "'"; RD.DataDefinition.FormulaFields["DealerEmail"].Text = "'" + Session["DealerEmail"].ToString() + "'"; RD.DataDefinition.FormulaFields["Terminal"].Text = "'" + Request.ServerVariables["REMOTE_ADDR"].ToString() + "'"; RD.DataDefinition.FormulaFields["UserId"].Text = "'" + Session["UserName"].ToString() + "'"; //RD.DataDefinition.FormulaFields["NTN"].Text = "'N.T.N # " + Session["DealerNTN"].ToString() + "'"; //RD.DataDefinition.FormulaFields["SalesTaxNo"].Text = "'Sales Tax No. " + Session["DealerSaleTaxNo"].ToString() + " '"; //rpt.DataDefinition.FormulaFields["UserCell"].Text = "'" + sysfunc.GetStringValuesAgainstCodes("CusCode", , "CellNo", "Customer") + "'"; RD.DataDefinition.FormulaFields["CompanyName"].Text = "'" + Session["DealerDesc"].ToString() + "'"; //RD.DataDefinition.FormulaFields["Pic"].Text = "'F:\CRM\CRM_V3\CRM_V3\assets\images" + Session["Logo"] + "'"; RD.DataDefinition.FormulaFields["Pic"].Text = "'" + Server.MapPath("~") + Session["Logo"] + "'"; RD.Database.Tables[0].SetDataSource(data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = RD.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "ProductReceiptReport.pdf")); } catch { throw; } }