public ActionResult GetReportSnapshot1(long id = 0) { if (id != 0) { StiReport report = new StiReport(); string path = Server.MapPath("~/Reports/cfs-factor.mrt"); report.Load(path); report.Dictionary.Databases.Clear(); string con = System.Configuration.ConfigurationManager.ConnectionStrings[Session["ReportConnection"].ToString()].ConnectionString; report.Dictionary.Databases.Add(new StiSqlDatabase("Maase", con)); //string con = System.Configuration.ConfigurationManager.ConnectionStrings["MaaseDBEntities"].ConnectionString; //report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Maase", con)); Image img = Image.FromFile(Server.MapPath(@"~/Images/logomaster.png")); report.Compile(); string p = Server.MapPath(@"~/TFont"); report["fontPath"] = p; report["logo"] = img; report["CFSID"] = " where ConsumerFinancialStatementID =" + id.ToString(); //report.Render(); report.Render(); return(StiMvcViewer.GetReportSnapshotResult(report)); } else { return(RedirectToAction("index")); } }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employee_report1") { string pa = Server.MapPath("~/Penfad_Reports/SCHEME_LEVEL_BENEFIT_SUMMARY.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SCHEME_ID"] = GlobalValue.Report_Param_1; My_Report[":P_MAKER_ID"] = GlobalValue.User_ID; //My_Report[":P_DATE"] = GlobalValue.Report_Param_2; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { X.Mask.Hide(); return(this.Direct()); } } catch (Exception ex) { X.Mask.Hide(); throw ex; } }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employee_retirement") { string pa = Server.MapPath("~/Penfad_Reports/Retirement_List.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_YEAR"] = GlobalValue.Report_Param_1; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { return(this.Direct()); } } catch (Exception ex) { string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReportSnapshotTruck(long ProducerID, long ConsumerID, long ProduceID, string FromDate, string ToDate) { if (ProducerID != 0 || ConsumerID != 0 || ProduceID != 0 || FromDate != null || ToDate != null) { StiReport report = new StiReport(); string path = Server.MapPath("~/Reports/bi-listTruck.mrt"); report.Load(path); report.Dictionary.Databases.Clear(); string con = System.Configuration.ConfigurationManager.ConnectionStrings[Session["ReportConnection"].ToString()].ConnectionString; report.Dictionary.Databases.Add(new StiSqlDatabase("Maase", con)); //string con = System.Configuration.ConfigurationManager.ConnectionStrings["MaaseDBEntities"].ConnectionString; //report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Maase", con)); Image img = Image.FromFile(Server.MapPath(@"~/Images/logomaster.png")); report.Compile(); string p = Server.MapPath(@"~/TFont"); report["fontPath"] = p; report["logo"] = img; String where = ""; if (ProducerID != 0) { where += " and ProducerID =" + ProducerID.ToString(); } if (ProduceID != 0) { where += " and ProduceID =" + ProduceID.ToString(); } if (ConsumerID != 0) { where += " and ConsumerID =" + ConsumerID.ToString(); } if (FromDate != null) { where += " and SUBSTRING (UnLoadDateTime,1,10) >='" + FromDate + "'"; } if (ToDate != null) { where += " and SUBSTRING (UnLoadDateTime,1,10) <='" + ToDate + "'"; } where += " and TruckID =" + db.T_Users.Where(m => m.UserName.Equals(User.Identity.Name)).ToList()[0].PublicID.ToString(); report["cnd"] = where; //report.Render(); report.Render(); return(StiMvcViewer.GetReportSnapshotResult(report)); } else { return(RedirectToAction("index")); } }
public ActionResult getsnapshotviwer() { if (Convert.ToInt32(Session["TA_TahvilType"]) == 1) { DataLayer.AtsTotalNewDataContext context = new DataLayer.AtsTotalNewDataContext(); Sell.Contract.Report repo = new Sell.Contract.Report(); var TA_Recevier = Convert.ToInt32(Session["TA_Recevier"]); var model = repo.GetGhateiDeliveredReport(1, Convert.ToInt32(Session["TA_RecevierType"]), "", Session["TA_FromDate"].ToString(), Session["TA_ToDate"].ToString(), TA_Recevier); StiReport stireport2 = new StiReport(); stireport2.RegBusinessObject("AmaniDeliverdCar", model); stireport2.Load(Server.MapPath("/Content/report/AmaniDeliverdCar.mrt")); stireport2.Dictionary.Variables["FRomDate"].Value = BAL.StaticData.DateNow.Date; stireport2.Dictionary.Variables["FromTime"].Value = BAL.StaticData.DateNow.Time; return(StiMvcViewer.GetReportSnapshotResult(this.HttpContext, stireport2)); } else { DataLayer.AtsTotalNewDataContext context = new DataLayer.AtsTotalNewDataContext(); Sell.Contract.Report repo = new Sell.Contract.Report(); var TA_Recevier = Convert.ToInt32(Session["TA_Recevier"]); var model = repo.GetGhateiDeliveredReport(0, Convert.ToInt32(Session["TA_RecevierType"]), "", Session["TA_FromDate"].ToString(), Session["TA_ToDate"].ToString(), TA_Recevier); StiReport stireport2 = new StiReport(); stireport2.RegBusinessObject("GhatiDeliveredReport", model); stireport2.Load(Server.MapPath("/Content/report/ghatii.mrt")); stireport2.Dictionary.Variables["FRomDate"].Value = BAL.StaticData.DateNow.Date; //stireport2.Dictionary.Variables["FromTime"].Value = BAL.StaticData.DateNow.Time; return(StiMvcViewer.GetReportSnapshotResult(this.HttpContext, stireport2)); } }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employee_report1") { string pa = Server.MapPath("~/Penfad_Reports/Employer_List_Scheme.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); // My_Report.Dictionary.Databases.Add(new StiOracleDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SID"] = GlobalValue.Report_Param_1; My_Report[":P_DATE"] = GlobalValue.Report_Param_2; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { return(this.Direct()); } } catch (Exception ex) { string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReport() { try { Database db = new Database(); var userid = int.Parse(Session["userid"].ToString()); var currentUser = db.tbl_users.Where(u => u.Id == userid).FirstOrDefault(); var year = int.Parse(Request.QueryString["y"]); var month = int.Parse(Request.QueryString["m"]); var bakhshId = int.Parse(Request.QueryString["a"]); var sematId = int.Parse(Request.QueryString["p"]); var checklist = db.tbl_checklist.Where(x => x.year == year && x.month == month && x.bakhshId == bakhshId && x.sematId == sematId ).ToList(); if (!currentUser.admin && currentUser.anbarId != currentUser.anbarId) { return(null); } var report = new StiReport(); var path = Server.MapPath("~/reports/arzyabi.mrt"); report.Load(path); report.Dictionary.Variables.Add("date", tools.toShamsiMonthName(month) + " " + year.ToString()); var dt = new DataTable("DataSource1"); dt.Columns.Add("row"); dt.Columns.Add("question"); dt.Columns.Add("name"); dt.Columns.Add("rate"); for (int i = 0; i < checklist.Count; i++) { var rate = (int)checklist[i].rate; var pid = checklist[i].personId; var qid = checklist[i].questionId; var person = db.tbl_personel.Where(x => x.id == pid).FirstOrDefault(); var question = db.tbl_question.Where(x => x.id == qid).FirstOrDefault(); dt.Rows.Add(i + 1, question.question, person.name + " " + person.family, checklist[i].rate); } var dataSet = new DataSet("DataSource1"); dataSet.Tables.Add(dt); report.RegData(dataSet); return(StiMvcViewer.GetReportSnapshotResult(report)); } catch (Exception ex) { return(null); } }
public ActionResult GetReportSnapshot() { StiReport report = new StiReport(); report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc")); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshotCheques(long TruckID, int PayStateID, int PayTypeID, string FromDate, string ToDate) { StiReport report = new StiReport(); string path = Server.MapPath("~/Reports/tfs-pay-cheque.mrt"); report.Load(path); report.Dictionary.Databases.Clear(); string con = System.Configuration.ConfigurationManager.ConnectionStrings[Session["ReportConnection"].ToString()].ConnectionString; report.Dictionary.Databases.Add(new StiSqlDatabase("Maase", con)); //string con = System.Configuration.ConfigurationManager.ConnectionStrings["MaaseDBEntities"].ConnectionString; //report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Maase", con)); Image img = Image.FromFile(Server.MapPath(@"~/Images/logomaster.png")); report.Compile(); string p = Server.MapPath(@"~/TFont"); report["fontPath"] = p; report["logo"] = img; String where = ""; if (PayStateID != 0) { where += " and PayStateID =" + PayStateID.ToString(); } if (TruckID != 0) { where += " and TruckID =" + TruckID.ToString(); } if (PayTypeID != 0) { where += " and PayTypeID =" + PayTypeID.ToString(); } if (FromDate != null) { where += " and SUBSTRING (PayDate,1,10) >='" + FromDate + "'"; } if (ToDate != null) { where += " and SUBSTRING (PayDate,1,10) <='" + ToDate + "'"; } report["condition"] = where; report["FromDate"] = FromDate; report["ToDate"] = ToDate; //report.Render(); report.Render(); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult report() { var report = new StiReport(); report.Load(Server.MapPath("/Reports/Report.mrt")); report.Compile(); report.RegBusinessObject("dt", db.FactorDetails.ToList()); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult Exam() { var report = new StiReport(); report.Load(Server.MapPath("/Content/Reports/Report.mrt")); report.Compile(); report.RegBusinessObject("dt", new ESLEntities().Tbl_Menu.ToList()); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult PrintExamInPersonCertificate() { var report = new StiReport(); report.Load(Server.MapPath("/Reports/ExamInPersonCertificate.mrt")); report.Compile(); report.RegBusinessObject("dt", data); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employee_report1") { string pa = Server.MapPath("~/Penfad_Reports/MM_TBILL_BOND_COUPON.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SF_ID"] = GlobalValue.Report_Param_1; My_Report[":P_DATE"] = GlobalValue.Report_Param_2; My_Report[":P_DATE2"] = GlobalValue.Report_Param_1_date; X.Mask.Hide(); //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employee_report2") { string pa = Server.MapPath("~/Penfad_Reports/EC_PV.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SF_ID"] = GlobalValue.Report_Param_1; My_Report[":P_DATE"] = GlobalValue.Report_Param_2; My_Report[":P_DATE2"] = GlobalValue.Report_Param_1_date; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { X.Mask.Hide(); return(this.Direct()); } } catch (Exception ex) { X.Mask.Hide(); string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReportSnapshotViewer() { StiReport report = new StiReport(); string path = Server.MapPath("~/App_Data/Reports/ApprovalSheet.mrt"); report.Load(path); report.Compile(); report.CompiledReport.DataSources[0].Parameters[0].ParameterValue = 1024; return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshotITypedList() { StiReport report = new StiReport(); report.Load(Server.MapPath("~/Content/Reports/BusinessObjects_ITypedList.mrt")); report.RegData("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees()); CheckReference(report); return(StiMvcViewer.GetReportSnapshotResult(report)); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="viewModel"></param> /// <returns></returns> public virtual async Task <ActionResult> DetailReport(Guid?id, ReportParameterViewModel viewModel) { if (id == null) { throw new ArgumentNullException(nameof(id)); } viewModel = (ReportParameterViewModel)TempData[id.ToString()]; var report = await _reportService.GetReportAsStiReportAsync(id.Value, viewModel); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshotSearch(string TruckIDS, string FromDate, string ToDate) { //if (TruckIDS != null || FromDate != null || ToDate != null) //{ StiReport report = new StiReport(); string path = Server.MapPath("~/Reports/tfsSearch.mrt"); report.Load(path); report.Dictionary.Databases.Clear(); string con = System.Configuration.ConfigurationManager.ConnectionStrings[Session["ReportConnection"].ToString()].ConnectionString; report.Dictionary.Databases.Add(new StiSqlDatabase("Maase", con)); //string con = System.Configuration.ConfigurationManager.ConnectionStrings["MaaseDBEntities"].ConnectionString; //report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Maase", con)); Image img = Image.FromFile(Server.MapPath(@"~/Images/logomaster.png")); report.Compile(); string p = Server.MapPath(@"~/TFont"); report["fontPath"] = p; report["logo"] = img; String where = ""; if (TruckIDS != null) { where += " where TruckID IN (" + TruckIDS + ")"; } if (FromDate != null) { where += " and SUBSTRING (FromDate,1,10) >='" + FromDate + "'"; } if (ToDate != null) { where += " and SUBSTRING (ToDate,1,10) <='" + ToDate + "'"; } report["TFSID"] = where; //report.Render(); report.Render(); return(StiMvcViewer.GetReportSnapshotResult(report)); //} //else //{ // return RedirectToAction("index"); //} }
public ActionResult GetReportSnapshot() { StiReport report = new StiReport(); report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt")); DataSet data = new DataSet("Demo"); data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml")); report.RegData(data); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employee_ledger") { string pa = Server.MapPath("~/Penfad_Reports/LEDGER_ACCOUNT_CONSOLIDATED.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":GL_NO"] = GlobalValue.Report_Param_1; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } //else if (GlobalValue.Report_Index_Id == "employee_ledgerAll") //{ // string pa = Server.MapPath("~/Penfad_Reports/LEDGER_ACCOUNT_ALL.dll"); // System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); // StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); // //////asign constring // My_Report.Dictionary.DataStore.Clear(); // //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); // My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); // My_Report[":SF_ID"] = GlobalValue.Report_Param_1; // //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; // return StiMvcViewer.GetReportSnapshotResult(My_Report); //} else { return(this.Direct()); } } catch (Exception ex) { string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReportSnapshot() { try { var report = new StiReport(); TempData["dataExportFileTres"] = report; report.Load(Server.MapPath(ReportTempFolder + "Report.mrt")); //report.RegData("dtRoom", _roomService.GetAll()); return(StiMvcViewer.GetReportSnapshotResult(report)); } catch (Exception ex) { throw ex; } }
public ActionResult GetReportSnapshot() { try { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); // param.Add("P_FM", GlobalValue.Report_Param_3_string, DbType.String, ParameterDirection.Input); // con.GetConnection().Execute("REPORT_INSERT_PORT_SUM_FM", param, commandType: CommandType.StoredProcedure); if (GlobalValue.Report_Index_Id == "employee_report1") { string pa = Server.MapPath("~/Penfad_Reports/MM_TBILL_BOND_PV_FM.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SF_ID"] = GlobalValue.Report_Param_1; My_Report[":P_DATE"] = GlobalValue.Report_Param_2; My_Report[":P_USER"] = GlobalValue.Report_Param_2_string; My_Report[":P_FM"] = GlobalValue.Report_Param_3_string; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { X.Mask.Hide(); return(this.Direct()); } } catch (Exception ex) { X.Mask.Hide(); string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReportSnapshot() { // Create the report object StiReport report = new StiReport(); report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt")); // Load data from XML file for report template DataSet data = new DataSet("Demo"); data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml")); report.RegData(data); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshot(int?id) { // Create the report object StiReport report = new StiReport(); switch (id) { // Dynamic sorting case 1: report.Load(Server.MapPath("~/Content/Reports/DrillDownSorting.mrt")); break; // Drill down case 2: report.Load(Server.MapPath("~/Content/Reports/DrillDownListOfProducts.mrt")); break; // Collapsing case 3: report.Load(Server.MapPath("~/Content/Reports/DrillDownGroupWithCollapsing.mrt")); break; // Bookmarks case 4: report = new StiMasterDetail(); break; // Parameters case 5: report = new StiParametersSelectingCountryReport(); break; default: report.Load(Server.MapPath("~/Content/Reports/DrillDownSorting.mrt")); break; } // Load data from XML file for report template DataSet data = new DataSet("Demo"); data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml")); report.Dictionary.Databases.Clear(); report.RegData(data); return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult FromLoadFileReport() { var formValues = StiMvcViewer.GetFormValues(this.HttpContext); CarModels cm = new CarModels(); if (formValues.Count != 0) { cm.Vin = formValues.GetValues("vin").GetValue(0).ToString(); } else { cm.Vin = "NAS0"; } try { Qccastt qccastt = new Qccastt(); qccastt.Vin = cm.GetVin(); DataSet dsCardInfo = new DataSet(); if (!string.IsNullOrEmpty(cm.Vin)) { Object[] obj = null; dsCardInfo = QccasttUtility.GetCarDefect(qccastt, out obj); dsCardInfo.Tables[0].TableName = "CarDefects"; } StiReport report = new StiReport(); report.Load(Server.MapPath("/Content/ReportsFile/QCCard2.mrt")); StiText stitxtVin = (StiText)report.GetComponentByName("txtVin"); stitxtVin.Text = cm.GetVin(); // BCVin StiBarCode stiBCVin = (StiBarCode)report.GetComponentByName("BCVin"); stiBCVin.Code = new StiBarCodeExpression(cm.GetVin()); //report.RegBusinessObject("driverReport", dsCardInfo.Tables[0]); //int i = dsCardInfo.Tables[0].Rows.Count; //report.Compile(); report.RegData(dsCardInfo); return(StiMvcViewer.GetReportSnapshotResult(HttpContext, report)); } catch (Exception ex) { // lblVinMessage.Text = "خطا در دریافت اطلاعات"; return(View()); } }
public ActionResult GetReportSnapshot(int?id) { // Create the report object StiReport report = new StiReport(); // Load report switch (id) { // Load report snapshot case 1: report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc")); break; // Load report template case 2: report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt")); break; // Load compiled report class case 3: report = new StiMasterDetail(); break; // Load compiled report class case 4: report = new StiParametersSelectingCountryReport(); break; // Load report snapshot default: report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc")); break; } // Load data from XML file for report template if (!report.IsDocument) { DataSet data = new DataSet("Demo"); data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml")); report.RegData(data); } return(StiMvcViewer.GetReportSnapshotResult(report)); }
public ActionResult GetReportSnapshotAccountant(long id = 0) { if (id != 0) { T_ProducerFinancialStatements pfs = db.T_ProducerFinancialStatements.Find(id); StiReport report = new StiReport(); string path = Server.MapPath("~/Reports/pfs-pay.mrt"); report.Load(path); report.Dictionary.Databases.Clear(); string con = System.Configuration.ConfigurationManager.ConnectionStrings[Session["ReportConnection"].ToString()].ConnectionString; report.Dictionary.Databases.Add(new StiSqlDatabase("Maase", con)); //string con = System.Configuration.ConfigurationManager.ConnectionStrings["MaaseDBEntities"].ConnectionString; //report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Maase", con)); Image img = Image.FromFile(Server.MapPath(@"~/Images/logomaster.png")); report.Compile(); string p = Server.MapPath(@"~/TFont"); report["fontPath"] = p; report["logo"] = img; report["PFSID"] = " where ProducerFinancialStatementID =" + id.ToString(); report["kol"] = decimal.Parse(pfs._BurdonsSumPrices.ToString()); report["albaghi"] = decimal.Parse(pfs._Creditor.ToString()); //report.Render(); report.Render(); return(StiMvcViewer.GetReportSnapshotResult(report)); } else { return(RedirectToAction("index")); } }
public override ActionResult GetReportSnapshot() { var documentoId = int.Parse(ParametrosReport["TablaId"]); TablaRegistroDTO entity = new TablaRegistroDTO(); entity.Id = documentoId; var tablaregistro = MapperHelper.Map <TablaRegistroDTO, TablaRegistro>(entity); var dataTabla = TablaRegistroBL.Instancia.GetById(tablaregistro); var dataBtabladetablle = TablaRegistroBL.Instancia.GetAllPagingDetalle(new PaginationParameter <int> { AmountRows = 100, WhereFilter = "WHERE tbpd_flag_estado=1 AND tbpc_iid_tabla_opciones =" + tablaregistro.Id + "", Start = 0, OrderBy = "", }); var report = new StiReport(); report.Load(Server.MapPath("~/Prints/M_Administrador/TablaRegistro/TablaOpciones.mrt")); report.RegBusinessObject("tabla", "tabla", dataTabla); report.RegBusinessObject("tabladetalle", "tabladetalle", dataBtabladetablle); return(StiMvcViewer.GetReportSnapshotResult(HttpContext, report)); }
public ActionResult GetReport() { try { Database db = new Database(); var userid = int.Parse(Session["userid"].ToString()); var currentUser = db.tbl_users.Where(u => u.Id == userid).FirstOrDefault(); var oid = int.Parse(Request.QueryString["o"]); var order = db.tbl_order.Where(x => x.Id == oid).FirstOrDefault(); if (!currentUser.admin && !currentUser.anbardar && order.anbar2 != currentUser.anbarId) { return(null); } var anbardarUser = db.tbl_users.Where(x => x.admin == true).FirstOrDefault(); var bakhshUser = db.tbl_users.Where(x => x.anbarId == order.anbar2).FirstOrDefault(); var report = new StiReport(); var path = Server.MapPath("~/reports/darkhastAnbar.mrt"); try { var size = Request.QueryString["size"].ToString(); if (size == "4") { path = Server.MapPath("~/reports/darkhastAnbar_A4.mrt"); } } catch (Exception) { } report.Load(path); report.Dictionary.Variables.Add("date", persianDateClass.strToDate(order.date.ToString())); report.Dictionary.Variables.Add("orderId", order.Id); report.Dictionary.Variables.Add("bakhsh", db.tbl_anbar.Where(x => x.Id == order.anbar2).FirstOrDefault().subject); report.Dictionary.Variables.Add("person1", bakhshUser.name + " " + bakhshUser.family); report.Dictionary.Variables.Add("semat1", db.tbl_semat.Where(x => x.Id == bakhshUser.sematId).FirstOrDefault().subject); if (bakhshUser.pic != null && bakhshUser.pic != "") { report.Dictionary.Variables.Add("emza1", getImage(bakhshUser.pic)); } else { report.Dictionary.Variables.Add("emza1", getImage("no.jpg")); } report.Dictionary.Variables.Add("bakhsh2", db.tbl_anbar.Where(x => x.Id == order.anbar1).FirstOrDefault().subject); report.Dictionary.Variables.Add("person2", anbardarUser.name + " " + anbardarUser.family); report.Dictionary.Variables.Add("semat2", db.tbl_anbar.Where(x => x.Id == anbardarUser.anbarId).FirstOrDefault().subject); if (anbardarUser.pic != null && anbardarUser.pic != "" && order.state > 1) { report.Dictionary.Variables.Add("emza2", getImage(anbardarUser.pic)); } else { report.Dictionary.Variables.Add("emza2", getImage("no.jpg")); } var dt = new DataTable("DataSource1"); dt.Columns.Add("row"); dt.Columns.Add("subject"); dt.Columns.Add("number"); dt.Columns.Add("numberF"); dt.Columns.Add("description"); var products = db.tbl_orderProduct.Where(x => x.orderId == order.Id).ToList(); for (int i = 0; i < products.Count; i++) { var pid = (int)products[i].productId; var product = db.tbl_product.Where(x => x.Id == pid).FirstOrDefault(); dt.Rows.Add(i + 1, product.name, products[i].numberDarkhasti, products[i].number, products[i].description); } var dataSet = new DataSet("DataSource1"); dataSet.Tables.Add(dt); report.RegData(dataSet); return(StiMvcViewer.GetReportSnapshotResult(report)); } catch (Exception ex) { return(null); } }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employer_report1") { ////Recalculate employer bal //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_ESID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("STATEMENT_ES", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/Employer_Scheme_Con_Monthly_1.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_ES_ID"] = GlobalValue.Report_Param_1; // GlobalValue.Rep_Cust_No; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report2") { ////Recalculate employer bal //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_ESID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("STATEMENT_ES", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/Employer_Scheme_Con_Annual_2.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_ES_ID"] = GlobalValue.Report_Param_1; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report3") { string pa = Server.MapPath("~/Penfad_Reports/Employer_Scheme_Payment_3.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_ES_ID"] = GlobalValue.Report_Param_1; //My_Report.Dictionary.DataSources["con"].Parameters["P_CUSTNO"].Value = GlobalValue.Rep_Cust_No; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { X.Mask.Hide(); return(this.Direct()); } } catch (Exception ex) { X.Mask.Hide(); string ssss = ex.ToString(); return(this.Direct()); } }
public ActionResult GetReportSnapshot() { try { if (GlobalValue.Report_Index_Id == "employer_report1") { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("REPORT_INSERT_CINAAFB", param, commandType: CommandType.StoredProcedure); //load report string pa = Server.MapPath("~/Penfad_Reports/CINAAFB.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SFID"] = GlobalValue.Report_Param_1; My_Report[":P_ID"] = GlobalValue.Report_Param_2_string; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report2") { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("REPORT_INSERT_NAAFB", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/NAAFB.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SFID"] = GlobalValue.Report_Param_1; My_Report[":P_ID"] = GlobalValue.Report_Param_2_string; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report3") { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("REPORT_INSERT_TB_MONTHLY", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/MTB.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SFID"] = GlobalValue.Report_Param_1; My_Report[":P_ID"] = GlobalValue.Report_Param_2_string; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report4") { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("REPORT_INSERT_TB", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/YTB.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SFID"] = GlobalValue.Report_Param_1; My_Report[":P_ID"] = GlobalValue.Report_Param_2_string; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else if (GlobalValue.Report_Index_Id == "employer_report5") { ////load report table //var con = new AppSettings(); //var param = new DynamicParameters(); //param.Add("P_SCHEMEFUNDID", GlobalValue.Report_Param_1, DbType.String, ParameterDirection.Input); //param.Add("P_DATE", GlobalValue.Report_Param_2, DbType.DateTime, ParameterDirection.Input); //param.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input); //con.GetConnection().Execute("REPORT_INSERT_CASHFLOW", param, commandType: CommandType.StoredProcedure); string pa = Server.MapPath("~/Penfad_Reports/CASHFLOW.dll"); System.Reflection.Assembly assembly_1 = System.Reflection.Assembly.LoadFrom(pa); StiReport My_Report = StiReport.GetReportFromAssembly(assembly_1); //////asign constring My_Report.Dictionary.DataStore.Clear(); //My_Report.Dictionary.Databases.Add(new StiSqlDatabase("TekSolPenfad", GlobalValue.ConString)); My_Report.Dictionary.Databases.Add(new StiOracleDatabase("con", GlobalValue.ConString)); My_Report[":P_SFID"] = GlobalValue.Report_Param_1; My_Report[":P_ID"] = GlobalValue.Report_Param_2_string; X.Mask.Hide(); return(StiMvcViewer.GetReportSnapshotResult(My_Report)); } else { X.Mask.Hide(); return(this.Direct()); } } catch (Exception ex) { X.Mask.Hide(); string ssss = ex.ToString(); return(this.Direct()); } }