private void نوبتدومToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgv1.RowCount > 0 && dgv1.SelectedRows.Count == 1)
         {
             string Student_id  = dgv1.CurrentRow.Cells["codeMelliDataGridViewTextBoxColumn"].Value.ToString();
             int    Years_id_FK = (from a in db.tbl_Years orderby a.id descending select a).FirstOrDefault().id;
             var    N2          = (from a in db.tbl_Karnameh where a.Student_id_FK == Student_id && a.Nobat == 2 && a.Years_id_FK == Years_id_FK select a).FirstOrDefault();
             var    N1          = (from a in db.tbl_Karnameh where a.Student_id_FK == Student_id && a.Nobat == 1 && a.Years_id_FK == Years_id_FK select a).FirstOrDefault();
             if (N2 != null)
             {
                 int?TosifAmalkard = (from a in db.tbl_Classes where a.id == Classid select a).FirstOrDefault().tbl_Payeh.TosifAmalkard_id_FK;
                 Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
                 if (TosifAmalkard != null)
                 {
                     Sti.Load(Application.StartupPath + "\\Reports\\rptNobat2TosifKarnameh.mrt");
                     Sti.Compile();
                     Sti["str_Student_id"]    = Student_id;
                     Sti["lng_Karnameh_id_1"] = N1.id;
                     Sti["lng_Karnameh_id_2"] = N2.id;
                     Sti.ShowWithRibbonGUI();
                 }
                 else
                 {
                     Sti.Load(Application.StartupPath + "\\Reports\\rptNobat2MarkKarnameh.mrt");
                     Sti.Compile();
                     Sti["str_Student_id"]    = Student_id;
                     Sti["lng_Karnameh_id_1"] = N1.id;
                     Sti["lng_Karnameh_id_2"] = N2.id;
                     Sti.ShowWithRibbonGUI();
                 }
             }
             else
             {
                 MessageBox.Show("کارنامه نوبت دوم ثبت نهایی نشده است", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show("لطفا یک سطر را انتخاب نمایید", "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (InstallmentPerLoanGridControl.ItemsSource as System.Collections.Generic.List <ViewModels.InstallmentViewModel>)
                          .Select(current => new
            {
                current.AmountRialFormat,
                current.PersianInstallmentDate,
                current.PersianPaymentDate,
                current.IsPayedDescription,
            })
                          .ToList();

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.InstallmentListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentLoan.Member.FullName.ToString());
            oStiReport.Dictionary.Variables.Add("LoanAmount", (new ViewModels.LoanViewModel {
                LoanAmount = Utility.CurrentLoan.LoanAmount
            }).LoanAmountRialFormat);
            oStiReport.Dictionary.Variables.Add("RefundAmount", (new ViewModels.LoanViewModel {
                RefundAmount = Utility.CurrentLoan.RefundAmount
            }).RefundAmountRialFormat);

            oStiReport.RegBusinessObject("InstallmentsList", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش لیست اقساط");
        }
Beispiel #3
0
    protected void SetandoRelExcel()
    {
        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();
        DataTable dt            = new DataTable();
        string    nomeRelatorio = string.Empty;

        if (Convert.ToString(Request.QueryString["Rel"]) == "frmFechamentoRel")
        {
            FechamentoFolhaSrv fechamentoFolhaSrv = new FechamentoFolhaSrv();
            dt            = new DataTable();
            dt            = fechamentoFolhaSrv.GetDadosImprimir(Request.QueryString["Mes"].ToString());
            nomeRelatorio = "FechamentoFolha.xls";
            Report.Load(Server.MapPath(@"~/Relatorio/STF/FechamentoFolha.mrt"));
            Report.Compile();
        }

        Report.RegData("DADOS", dt);
        Report.Render();
        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/xls";

        HttpContext.Current.Response.AddHeader(nomeRelatorio, "");
        Stimulsoft.Report.Export.StiExcelExportService ExportXSL = new Stimulsoft.Report.Export.StiExcelExportService();
        ExportXSL.ExportExcel(Report, memStream, Stimulsoft.Report.StiPagesRange.All, false, false, true, true);
        Response.ContentType = "application/xls";

        Response.AddHeader("content-disposition", "inline; filename=" + nomeRelatorio + "");
        Response.BinaryWrite(memStream.ToArray());
    }
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList =
                (GridControl.ItemsSource as System.Collections.Generic.List <ViewModels.MemberTransactionViewModel>)
                .OrderBy(current => current.Date)
                .Select(current => new
            {
                current.AmountRialFormat,
                current.PersianDate,
                current.TransactionDescription,
            })
                .ToList();

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.MemberTransactionsReport);
            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentMember.FullName.ToString());
            oStiReport.RegBusinessObject("Transactions", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش واریز اعضا");
        }
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varObject = new
            {
                LoansCount              = LoansCountLabel.Content,
                LoansAmount             = LoansAmountLabel.Content,
                PayedLoansCount         = PayedLoansCountLabel.Content,
                PayedLoansAmount        = PayedLoansAmountLabel.Content,
                InstallmentsCount       = InstallmentsCountLabel.Content,
                InstallmentsAmount      = InstallmentsAmountLabel.Content,
                PayedInstallmentsCount  = PayedInstallmentsCountLabel.Content,
                PayedInstallmentsAmount = PayedInstallmentsAmountLabel.Content,
            };

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.FundBalanceReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("FundBalance", Utility.CurrentFund.Balance.ToRialStringFormat());

            oStiReport.RegBusinessObject("MemberBalance", varObject);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            oStiReport.DoAction(action: reportType, fileName: "تراز مالی " + Utility.CurrentMember.FullName.ToString());
        }
Beispiel #6
0
        public virtual ActionResult GetReportSnapshot(string fileName, string sourceName, string sourceData)
        {
            PrintModel model = new PrintModel();

            model.fileName   = fileName;
            model.sourceName = "Source";
            model.sourceData = null;

            if (fileName == "packListB")
            {
                model.sourceData = BLLFactory <PackList_Head> .Instance.GetPrint(sourceData);

                model.sourceName = sourceName;
                model.fileName   = fileName;
            }

            // 创建报表对象
            Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
            //读取文件
            report.Load(Server.MapPath(string.Format("~/Content/reports/{0}.mrt", model.fileName)));
            //截止读取
            report.Compile();
            if (!string.IsNullOrEmpty(model.sourceName) && model.sourceData != null)
            {
                //注册数据源P
                report.RegData(model.sourceName, model.sourceData);
            }

            //返回报表
            return(Stimulsoft.Report.Mvc.StiMvcViewer.GetReportSnapshotResult(report));
        }
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = oUnitOfWork.UserRepository
                              .Get()
                              .OrderBy(current => current.Username)
                              .Select(current => new ViewModels.UserViewModel()
                {
                    Id                = current.Id,
                    Username          = current.Username,
                    RegisterationDate = current.RegisterationDate,
                    IsAdmin           = current.IsAdmin,
                    LastLoginTime     = current.LastLoginTime,
                })
                              .ToList();

                var varListToReport = varList
                                      .OrderBy(current => current.Username)
                                      .Select(current => new
                {
                    Username = current.Username,
                    PersianRegisterationDate = current.PersianRegisterationDate,
                    IsAdminDescription       = current.IsAdminDescription,
                    PersianLastLoginTime     = current.PersianLastLoginTime,
                })
                                      .ToList();

                Stimulsoft.Report.StiReport usersReport = new Stimulsoft.Report.StiReport();

                usersReport.Load(Properties.Resources.UsersViewReport);
                usersReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                usersReport.RegBusinessObject("Users", varListToReport);
                usersReport.Compile();
                usersReport.RenderWithWpf();

                usersReport.DoAction(reportType, "گزارش کاربران");

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Beispiel #8
0
 private void Form1_Load(object sender, System.EventArgs e)
 {
     using (var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomViewer.CustomPreview.mrt"))
     {
         Report.Load(stream);
     }
     Report.Compile();
     btRefresh_Click(sender, e);
 }
Beispiel #9
0
        private void OBackgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            this.Dispatcher.Invoke(() =>
            {
                EnterEmailPasswordWindow oEnterEmailPasswordWindow = e.Argument as EnterEmailPasswordWindow;

                var varList = (InstallmentPerLoanGridControl.ItemsSource as System.Collections.Generic.List <ViewModels.InstallmentViewModel>)
                              .Select(current => new
                {
                    current.AmountRialFormat,
                    current.PersianInstallmentDate,
                    current.PersianPaymentDate,
                    current.IsPayedDescription,
                })
                              .ToList();

                Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

                oStiReport.Load(Properties.Resources.InstallmentListReport);

                oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
                oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
                oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentLoan.Member.FullName.ToString());
                oStiReport.Dictionary.Variables.Add("LoanAmount", (new ViewModels.LoanViewModel {
                    LoanAmount = Utility.CurrentLoan.LoanAmount
                }).LoanAmountRialFormat);
                oStiReport.Dictionary.Variables.Add("RefundAmount", (new ViewModels.LoanViewModel {
                    RefundAmount = Utility.CurrentLoan.RefundAmount
                }).RefundAmountRialFormat);

                oStiReport.RegBusinessObject("InstallmentsList", varList);
                oStiReport.Compile();
                oStiReport.RenderWithWpf();

                System.IO.MemoryStream oMemoryStream = new System.IO.MemoryStream();

                oStiReport.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, oMemoryStream);
                oMemoryStream.Seek(0, System.IO.SeekOrigin.Begin);

                Utility.SendEmail
                (
                    senderEmail: Utility.CurrentUser.EmailAddress,
                    senderPassword: oEnterEmailPasswordWindow.EmailPassword,
                    displayName: Utility.CurrentUser.FullName.ToString(),
                    receiverEmail: Utility.CurrentMember.EmailAddress,
                    subject: Utility.CurrentFund.Name + " | " + "لیست اقساط " + Utility.CurrentMember.FullName.ToString(),
                    body: "لیست اقساط " + Utility.CurrentMember.FullName.ToString() +
                    System.Environment.NewLine +
                    new FarsiLibrary.Utils.PersianDate(System.DateTime.Now).ToString(),
                    attachment: oMemoryStream,
                    attachmentName: "لیست اقساط " + Utility.CurrentMember.FullName.ToString()
                );
            });
        }
        public ActionResult LoadReport()
        {
            var product = db.Products.OrderByDescending(p => p.Quantity).Take(8).ToList();
            var R       = new Stimulsoft.Report.StiReport();

            R.Load(Server.MapPath("/Reports/QtyReport.mrt"));
            R.Compile();
            R.RegBusinessObject("myData", product);

            return(Stimulsoft.Report.Mvc.StiMvcViewer.GetReportSnapshotResult(R));
        }
Beispiel #11
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptMoavenEjraei.mrt");
         Sti.Compile();
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error); }
 }
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("RenderInThread.MasterDetailSubdetail.mrt"))
            {
                report.Load(stream);
            }

            report.IsRendered = false;
            report.Compile();
            report.CompiledReport.Rendering += new EventHandler(CompiledReport_Rendering);
            report.Render(false);
        }
        private void OBackgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            this.Dispatcher.Invoke(() =>
            {
                EnterEmailPasswordWindow oEnterEmailPasswordWindow = e.Argument as EnterEmailPasswordWindow;

                var varObject = new
                {
                    LoansCount              = LoansCountLabel.Content,
                    LoansAmount             = LoansAmountLabel.Content,
                    PayedLoansCount         = PayedLoansCountLabel.Content,
                    PayedLoansAmount        = PayedLoansAmountLabel.Content,
                    InstallmentsCount       = InstallmentsCountLabel.Content,
                    InstallmentsAmount      = InstallmentsAmountLabel.Content,
                    PayedInstallmentsCount  = PayedInstallmentsCountLabel.Content,
                    PayedInstallmentsAmount = PayedInstallmentsAmountLabel.Content,
                };

                Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

                oStiReport.Load(Properties.Resources.FundBalanceReport);

                oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
                oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
                oStiReport.Dictionary.Variables.Add("FundBalance", Utility.CurrentFund.Balance.ToRialStringFormat());

                oStiReport.RegBusinessObject("MemberBalance", varObject);
                oStiReport.Compile();
                oStiReport.RenderWithWpf();

                System.IO.MemoryStream oMemoryStream = new System.IO.MemoryStream();

                oStiReport.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, oMemoryStream);
                oMemoryStream.Seek(0, System.IO.SeekOrigin.Begin);

                Utility.SendEmail
                (
                    senderEmail: Utility.CurrentUser.EmailAddress,
                    senderPassword: oEnterEmailPasswordWindow.EmailPassword,
                    displayName: Utility.CurrentUser.FullName.ToString(),
                    receiverEmail: Utility.CurrentMember.EmailAddress,
                    subject: Utility.CurrentFund.Name + " | " + "تراز مالی عضو  " + Utility.CurrentMember.FullName.ToString(),
                    body: "تراز مالی " + Utility.CurrentMember.FullName.ToString() +
                    System.Environment.NewLine +
                    new FarsiLibrary.Utils.PersianDate(System.DateTime.Now).ToString(),
                    attachment: oMemoryStream,
                    attachmentName: "تراز مالی " + Utility.CurrentMember.FullName.ToString()
                );
            });
        }
Beispiel #14
0
 private void buttonX4_Click(object sender, EventArgs e)
 {
     try
     {
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptClasses.mrt");
         Sti.Compile();
         Sti["lng_School_id"] = Frm_Main.School_id;
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #15
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("RenderInThread.Master-Detail-Subdetail.mrt"))
            {
                report.Load(stream);
            }

            DataSet data = new DataSet();

            data.ReadXmlSchema("..\\..\\Data\\demo.xsd");
            data.ReadXml("..\\..\\Data\\demo.xml");

            report.RegData(data);
            report.IsRendered = false;
            report.Compile();
            report.CompiledReport.Rendering += new EventHandler(CompiledReport_Rendering);
            report.Render(false);
        }
 private void toolStripButtonDesign_Click(object sender, EventArgs e)
 {
     if (treeViewReports.SelectedNode.Index != -1)
     {
         using (Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport())
         {
             report.Load(ReportsPath + treeViewReports.SelectedNode.Text + ".mrt");
             report.Dictionary.Databases.Clear();
             report.RegData("Demo", "Demo", dataSetInvoice);
             report.Compile();
             report.Design(true);
         }
     }
     else
     {
         MessageBox.Show("Select invoice first to proceed!");
     }
 }
Beispiel #17
0
 private void buttonDesign_Click(object sender, RoutedEventArgs e)
 {
     if (treeViewReports.SelectedItem != null)
     {
         using (Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport())
         {
             report.Load(ReportsPath + treeViewReports.SelectedItem.ToString() + ".mrt");
             report.Dictionary.Databases.Clear();
             report.RegData("Demo", "Demo", dataSetInvoice);
             report.Compile();
             report.DesignWithWpf();
         }
     }
     else
     {
         Stimulsoft.Report.Wpf.StiMessageBox.Show("Select invoice first to proceed!");
     }
 }
Beispiel #18
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (MembersLoanGridControl.ItemsSource as System.Collections.Generic.List <ViewModels.LoanViewModel>)
                          .OrderBy(current => current.StartDate)
                          .Select(current => new
            {
                current.LoanAmountRialFormat,
                current.RefundAmountRialFormat,
                current.PersianEndDate,
                current.PersianStartDate,
                current.InstallmentsCount,
                current.IsPayedDescrption,
                current.Description,
            })
                          .ToList();

            if (varList.Count == 0)
            {
                Infrastructure.MessageBox.Show
                (
                    caption: Infrastructure.MessageBox.Caption.Error,
                    text: "اطلاعاتی برای تهیه گزارش در جدول موجود نمی‌باشد. "
                );

                return;
            }

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.MembersLoansListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("MemberName", Utility.CurrentMember.FullName.ToString());
            oStiReport.Dictionary.Variables.Add("LoanStatus", LoanStatusComboBox.Text);
            oStiReport.RegBusinessObject("Loans", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            string fileName = string.Format("گزارش {0} {1}", LoanStatusComboBox.Text, Utility.CurrentMember.FullName.ToString());

            oStiReport.DoAction(action: reportType, fileName: fileName);
        }
Beispiel #19
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList = (LoansGridControl.ItemsSource as System.Collections.Generic.List <Models.Loan>)
                          .OrderBy(current => current.StartDate)
                          .Select(current => new ViewModels.LoanViewModel()
            {
                IsPayed           = current.IsPayed,
                IsActive          = current.IsActive,
                LoanAmount        = current.LoanAmount,
                RefundAmount      = current.RefundAmount,
                EndDate           = current.EndDate,
                StartDate         = current.StartDate,
                InstallmentsCount = current.InstallmentsCount,
                MemberId          = current.MemberId,
            })
                          .Select(current => new
            {
                current.LoanAmountRialFormat,
                current.RefundAmountRialFormat,
                current.PersianEndDate,
                current.PersianStartDate,
                current.InstallmentsCount,
                current.IsPayedDescrption,
                FullName = current.FullName.ToString(),
            })
                          .ToList();

            ;


            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.ConfirmedLoansListReport);

            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.RegBusinessObject("Loans", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();

            oStiReport.DoAction(action: reportType, fileName: "گزارش وام‌های پرداختی");
        }
Beispiel #20
0
    protected void SetandoRel()
    {
        //Report da stimulsoft

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        if (Convert.ToString(Request.QueryString["Rel"]) == "frmZuxa")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/EspelhoPonto.mrt"));
            Report.Compile();
            Report["DiasMes"]        = TotalDiasMes.ToString();
            Report["DiasCumpridos"]  = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]  = TotalHoraMes.ToString();
            Report["HorasCumpridas"] = HorasCumpridas.ToString();
        }

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";

        HttpContext.Current.Response.AddHeader("Pontoweb.pdf", "");

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true,
                         "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit40, false);

        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "inline; filename=Pontoweb.pdf");

        Response.BinaryWrite(memStream.ToArray());
    }
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         var Q       = (from a in db.tbl_Years orderby a.id descending select a).FirstOrDefault();
         int YearsId = 0;
         if (Q != null)
         {
             YearsId = Q.id;
         }
         Stimulsoft.Report.StiReport Sti = new Stimulsoft.Report.StiReport();
         Sti.Load(Application.StartupPath + "\\Reports\\rptStudentClasses.mrt");
         Sti.Compile();
         Sti["int_Yearsid"] = YearsId;
         Sti["lng_Classid"] = Classid;
         Sti.ShowWithRibbonGUI();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "اخطار", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #22
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            var varList =
                (GridControl.ItemsSource as System.Collections.Generic.List <ViewModels.TransactionViewModel>)
                .OrderBy(current => current.Date)
                .Select(current => new
            {
                current.AmountRialFormat,
                current.BalanceRialFormat,
                current.PersianDate,
                current.TransactionDescription,
                MemberFullName = current.MemberFullName.ToString(),
            })
                .ToList();

            if (varList.Count == 0)
            {
                Infrastructure.MessageBox.Show
                (
                    caption: Infrastructure.MessageBox.Caption.Error,
                    text: "اطلاعاتی برای تهیه گزارش در جدول موجود نمی‌باشد. " + System.Environment.NewLine + "لطفا بازه زمانی دیگری را انتخاب نمایید."
                );

                return;
            }

            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            oStiReport.Load(Properties.Resources.TransactionsReport);
            oStiReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
            oStiReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
            oStiReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
            oStiReport.Dictionary.Variables.Add("FromDate", varList.Select(current => current.PersianDate).FirstOrDefault());
            oStiReport.Dictionary.Variables.Add("ToDate", varList.Select(current => current.PersianDate).LastOrDefault());
            oStiReport.RegBusinessObject("Transactions", varList);
            oStiReport.Compile();
            oStiReport.RenderWithWpf();
            oStiReport.DoAction(action: reportType, fileName: "گزارش ریز حساب صندوق");
        }
Beispiel #23
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                var varList = oUnitOfWork.MemberRepository
                              .MembersToReport()
                              .ToList();

                Stimulsoft.Report.StiReport oReport = new Stimulsoft.Report.StiReport();

                oReport.Load(Properties.Resources.MembersViewReport);
                oReport.Dictionary.Variables.Add("Today", System.DateTime.Now.ToPersianDate());
                oReport.Dictionary.Variables.Add("FundName", Utility.CurrentFund.Name);
                oReport.Dictionary.Variables.Add("FundManagerName", Utility.CurrentFund.ManagerName);
                oReport.RegBusinessObject("Members", varList);
                oReport.Compile();
                oReport.RenderWithWpf();
                oReport.DoAction(reportType, string.Format("گزارش اعضا ({0}) ", Utility.CurrentFund.Name));

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Beispiel #24
0
        protected override bool WfExecReport(Stimulsoft.Report.StiReport pReport)
        {
            //DataSet ds;
            vw_invr215       invr215Model;
            StringBuilder    sbSql   = null;
            string           sqlBody = "";
            DataTable        dtMaster;
            List <QueryInfo> queryInfoList;
            QueryInfo        queryModel;
            string           strQueryRange, strWhere;
            StringBuilder    sbQuerySingle = null;

            List <SqlParameter> sqlParmList;
            List <Master>       resultList = null;

            try
            {
                invr215Model = DrMaster.ToItem <vw_invr215>();
                resultList   = new List <Master>();
                #region 處理類型
                queryInfoList = new List <QueryInfo>();
                #region range 處理
                if (!GlobalFn.varIsNull(invr215Model.icc01))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "icc_tb";
                    queryModel.ColumnName = "icc01";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["icc01"].DataType.Name;
                    queryModel.Value      = invr215Model.icc01;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(invr215Model.icc02))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "icc_tb";
                    queryModel.ColumnName = "icc02";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["icc02"].DataType.Name;
                    queryModel.Value      = invr215Model.icc02;
                    queryInfoList.Add(queryModel);
                }
                sqlParmList   = new List <SqlParameter>();
                strQueryRange = BoMaster.WfGetQueryString(queryInfoList, out sqlParmList);
                #endregion
                sbQuerySingle = new StringBuilder();
                strWhere      = strQueryRange + " " + sbQuerySingle.ToString();
                var strSecurity = WfGetSecurityString();        //取得權限字串
                if (!GlobalFn.varIsNull(strSecurity))
                {
                    strWhere += strSecurity;
                }

                //取得單頭
                if (invr215Model.show_warehouse_yn == "Y")
                {
                    sqlBody  = @"
                              SELECT 
                                icc01,icc02,icc03,icc05,
                                ica02,ica03,ica07,
                                bej03,'' as icc05_str
                              FROM icc_tb
                                    LEFT JOIN ica_tb ON icc01=ica01
                                    LEFT JOIN bej_tb ON ica07=bej01
                              WHERE ica05>0
                                ";
                    dtMaster = BoMaster.OfGetDataTable(string.Concat(sqlBody, strWhere), sqlParmList.ToArray());
                }
                else
                {
                    sqlBody = @"
                              SELECT 
                                icc01,'' AS icc02,icc03,sum(icc05) as icc05,
                                ica02,ica03,ica07,
                                bej03,'' as icc05_str
                              FROM icc_tb
                                    LEFT JOIN ica_tb ON icc01=ica01
                                    LEFT JOIN bej_tb ON ica07=bej01
                              WHERE ica05>0
                                ";
                    var sqlGroupBy = @"
                              GROUP BY
                                icc01,icc03,
                                ica02,ica03,ica07,
                                bej03";
                    dtMaster = BoMaster.OfGetDataTable(string.Concat(sqlBody, strWhere, sqlGroupBy), sqlParmList.ToArray());
                }

                dtMaster.TableName = "Master";
                if (dtMaster != null)
                {
                    resultList.AddRange(dtMaster.ToList <Master>());
                }
                #endregion

                if (resultList == null || resultList.Count == 0)
                {
                    WfShowErrorMsg("查無資料,請重新過濾條件!");
                    return(false);
                }

                foreach (Master masterModel in resultList)
                {
                    //數量處理
                    masterModel.icc05_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.icc05);//數量
                }

                pReport.RegData("master", resultList);
                pReport.CacheAllData = true;
                pReport.Compile();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #25
0
        private void ShowReport(Infrastructure.Report.ExportType reportType)
        {
            Stimulsoft.Report.StiReport oStiReport = new Stimulsoft.Report.StiReport();

            DAL.UnitOfWork oUnitOfWork = null;

            try
            {
                oUnitOfWork = new DAL.UnitOfWork();

                Models.Member oMember = oUnitOfWork.MemberRepository
                                        .GetById(CurrentId);

                ViewModels.MembershipCardViewModel oViewModel =
                    new ViewModels.MembershipCardViewModel();

                oViewModel.FirstName      = oMember.FullName.FirstName;
                oViewModel.LastName       = oMember.FullName.LastName;
                oViewModel.FatherName     = oMember.FatherName;
                oViewModel.Gender         = oMember.Gender;
                oViewModel.NationalCode   = oMember.NationalCode;
                oViewModel.EmailAddress   = oMember.EmailAddress;
                oViewModel.FundName       = oMember.Fund.Name;
                oViewModel.PhoneNumber    = oMember.PhoneNumber;
                oViewModel.MembershipDate = oMember.MembershipDate;

                if (oMember.Picture != null)
                {
                    System.IO.MemoryStream oMemoryStream = new System.IO.MemoryStream(oMember.Picture);
                    System.Drawing.Image   oImage        = System.Drawing.Image.FromStream(oMemoryStream);
                    oViewModel.Picture = oImage;
                }
                else
                {
                    System.Drawing.Image oImage = Properties.Resources.ImageNull;
                    oViewModel.Picture = oImage;
                }

                var varData =
                    new
                {
                    FirstName             = oViewModel.FirstName,
                    LastName              = oViewModel.LastName,
                    Picture               = oViewModel.Picture,
                    FatherName            = oViewModel.FatherName,
                    GenderDescription     = oViewModel.GenderDescription,
                    FundName              = oViewModel.FundName,
                    PhoneNumber           = oViewModel.PhoneNumber,
                    PersianMembershipDate = oViewModel.PersianMembershipDate,
                    EmailAddress          = oViewModel.EmailAddress,
                    NationalCode          = oViewModel.NationalCode,
                };

                oStiReport.Load(Properties.Resources.MembershipCardReport);
                oStiReport.RegBusinessObject("MembershipCard", varData);
                oStiReport.Compile();
                oStiReport.RenderWithWpf();

                oStiReport.DoAction(reportType, string.Format("{0} {1}", "کارت عضویت", oMember.FullName.FirstName + "" + oMember.FullName.LastName));

                oUnitOfWork.Save();
            }
            catch (System.Exception ex)
            {
                Infrastructure.MessageBox.Show(ex.Message);;
            }
            finally
            {
                if (oUnitOfWork != null)
                {
                    oUnitOfWork.Dispose();
                    oUnitOfWork = null;
                }
            }
        }
Beispiel #26
0
        protected override bool WfExecReport(Stimulsoft.Report.StiReport pReport)
        {
            //DataSet ds;
            vw_invr336       invr336Model;
            StringBuilder    sbSql   = null;
            string           sqlBody = "";
            DataTable        dtIlaTb;
            List <QueryInfo> queryInfoList;
            QueryInfo        queryModel;
            string           strQueryRange, strWhere;
            StringBuilder    sbQuerySingle = null;

            List <SqlParameter> sqlParmList;
            List <Master>       resultList = null;

            try
            {
                invr336Model  = DrMaster.ToItem <vw_invr336>();
                resultList    = new List <Master>();
                queryInfoList = new List <QueryInfo>();
                #region range 處理
                if (!GlobalFn.varIsNull(invr336Model.ifa01))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "ifa_tb";
                    queryModel.ColumnName = "ifa01";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ifa01"].DataType.Name;
                    queryModel.Value      = invr336Model.ifa01;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(invr336Model.ifa03))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "ifa_tb";
                    queryModel.ColumnName = "ifa03";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ifa03"].DataType.Name;
                    queryModel.Value      = invr336Model.ifa03;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(invr336Model.ifa04))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "ifa_tb";
                    queryModel.ColumnName = "ifa04";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ifa04"].DataType.Name;
                    queryModel.Value      = invr336Model.ifa04;
                    queryInfoList.Add(queryModel);
                }
                sqlParmList   = new List <SqlParameter>();
                strQueryRange = BoMaster.WfGetQueryString(queryInfoList, out sqlParmList);
                #endregion

                #region single 處理
                sbQuerySingle = new StringBuilder();
                if (!GlobalFn.varIsNull(invr336Model.ifa02_s))
                {
                    sbQuerySingle.AppendLine("AND ifa02>=@ifa02_s");
                    sqlParmList.Add(new SqlParameter("@ifa02_s", invr336Model.ifa02_s));
                }
                if (!GlobalFn.varIsNull(invr336Model.ifa02_e))
                {
                    sbQuerySingle.AppendLine("AND ifa02<=@ifa02_e");
                    sqlParmList.Add(new SqlParameter("@ifa02_s", invr336Model.ifa02_e));
                }

                if (invr336Model.conf_yn != "0")
                {
                    if (invr336Model.conf_yn == "1")
                    {
                        sbQuerySingle.AppendLine("AND ifaconf = 'Y'");
                    }
                    if (invr336Model.conf_yn == "2")
                    {
                        sbQuerySingle.AppendLine("AND ifaconf = 'N'");
                    }
                }
                #endregion

                strWhere = strQueryRange + " " + sbQuerySingle.ToString();
                var strSecurity = WfGetSecurityString();        //取得權限字串
                if (!GlobalFn.varIsNull(strSecurity))
                {
                    strWhere += strSecurity;
                }

                //取得單頭
                sqlBody = @"
                              SELECT 
                                ifa01,ifa02,ifa03,bec02 as ifa03_c ,
                                ifa04,beb03 AS ifa04_c,ifa05,ifaconf,
                                ifb02,ifb03,ifb04,ifb05,'' as ifb05_str,ifb06,
                                bej03,ifb07,
                                ifb08,'' as ifb08_str,ifb09,ifb10,
                                ica03
                              FROM ifa_tb
                                    LEFT JOIN ifb_tb ON ifa01=ifb01
                                    LEFT JOIN bec_tb ON ifa03=bec01
                                    LEFT JOIN beb_tb ON ifa04=beb01
                                    LEFT JOIN bej_tb ON ifb06=bej01
                                    LEFT JOIN ica_tb ON ifb03=ica01
                              WHERE ifa00='1'
                                AND ifb01 IS NOT NULL
                                ";

                dtIlaTb           = BoMaster.OfGetDataTable(string.Concat(sqlBody, strWhere), sqlParmList.ToArray());
                dtIlaTb.TableName = "Master";
                if (dtIlaTb != null)
                {
                    resultList.AddRange(dtIlaTb.ToList <Master>());
                }

                if (resultList == null || resultList.Count == 0)
                {
                    WfShowErrorMsg("查無資料,請重新過濾條件!");
                    return(false);
                }

                foreach (Master masterModel in resultList)
                {
                    //數量處理
                    masterModel.ifb05_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.ifb05); //數量
                    masterModel.ifb08_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.ifb08); //數量
                }

                pReport.RegData("master", resultList);
                pReport.CacheAllData = true;

                pReport.Compile();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #27
0
        protected override bool WfExecReport(Stimulsoft.Report.StiReport pReport)
        {
            //DataSet ds;
            vw_invr522 invr522Model;
            string sqlBody = "";
            DataTable dtIlaTb;
            List<QueryInfo> queryInfoList;
            QueryInfo queryModel;
            string strQueryRange, strWhere, strOrderBy;
            StringBuilder sbQuerySingle = null;
            List<SqlParameter> sqlParmList;
            List<Master> resultList = null;
            try
            {
                invr522Model = DrMaster.ToItem<vw_invr522>();
                resultList = new List<Master>();
                queryInfoList = new List<QueryInfo>();
                #region range 處理
                if (!GlobalFn.varIsNull(invr522Model.ipa01))
                {
                    queryModel = new QueryInfo();
                    queryModel.TableName = "ipa_tb";
                    queryModel.ColumnName = "ipa01";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ipa01"].DataType.Name;
                    queryModel.Value = invr522Model.ipa01;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(invr522Model.ipacreu))
                {
                    queryModel = new QueryInfo();
                    queryModel.TableName = "ipa_tb";
                    queryModel.ColumnName = "ipacreu";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ipacreu"].DataType.Name;
                    queryModel.Value = invr522Model.ipacreu;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(invr522Model.ipacreg))
                {
                    queryModel = new QueryInfo();
                    queryModel.TableName = "ipa_tb";
                    queryModel.ColumnName = "ipacreg";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["ipacreg"].DataType.Name;
                    queryModel.Value = invr522Model.ipacreg;
                    queryInfoList.Add(queryModel);
                }
                sqlParmList = new List<SqlParameter>();
                strQueryRange = BoMaster.WfGetQueryString(queryInfoList, out sqlParmList);
                #endregion

                #region single 處理
                sbQuerySingle = new StringBuilder();
                if (!GlobalFn.varIsNull(invr522Model.ipa03_s))
                {
                    sbQuerySingle.AppendLine("AND ipa03>=@ipa03_s");
                    sqlParmList.Add(new SqlParameter("@ila02_s", invr522Model.ipa03_s));
                }
                if (!GlobalFn.varIsNull(invr522Model.ipa03_e))
                {
                    sbQuerySingle.AppendLine("AND ipa03<=@ipa03_e");
                    sqlParmList.Add(new SqlParameter("@ipa03_e", invr522Model.ipa03_e));
                }
                #endregion

                strWhere = strQueryRange + " " + sbQuerySingle.ToString();
                var strSecurity = WfGetSecurityString();        //取得權限字串
                if (!GlobalFn.varIsNull(strSecurity))
                    strWhere += strSecurity;

                //取得單頭
                sqlBody = @"
                            SELECT 
	                            ipa01,ipb02,ipb03,ipb04,ipb05,
	                            ipb06,ipb07,ipb30,ipb40,ipb50,
                                ica02,ica03,
                                bej03,
	                            CONVERT(DECIMAL,0) AS qty1,
	                            CONVERT(DECIMAL,0) AS qty2,
	                            CONVERT(DECIMAL,0) AS dif_qty,
	                            CONVERT(NVARCHAR(20),0) AS qty1_str,
	                            CONVERT(NVARCHAR(20),0) AS qty2_str,
	                            CONVERT(NVARCHAR(20),0) AS dif_qty_str
                            FROM ipa_tb
	                            INNER JOIN ipb_tb ON ipa01=ipb01
                                LEFT JOIN ica_tb ON ipb03=ica01
                                LEFT JOIN bej_tb ON ipb07=bej01
                            WHERE
	                            ipa05='Y'
                                ";
                strOrderBy = " ORDER BY ipa01,ipb02";
                dtIlaTb = BoMaster.OfGetDataTable(string.Concat(sqlBody, strWhere, strOrderBy), sqlParmList.ToArray());
                dtIlaTb.TableName = "Master";
                if (dtIlaTb != null)
                {
                    resultList.AddRange(dtIlaTb.ToList<Master>());
                }

                if (resultList == null || resultList.Count == 0)
                {
                    WfShowErrorMsg("查無資料,請重新過濾條件!");
                    return false;
                }

                foreach (Master masterModel in resultList)
                {
                    switch (invr522Model.type1)
                    {
                        case "1":
                            masterModel.qty1 = masterModel.ipb30;
                            break;
                        case "2":
                            masterModel.qty1 = masterModel.ipb40;
                            break;
                        case "3":
                            masterModel.qty1 = masterModel.ipb50;
                            break;
                        case "4":
                            masterModel.qty1 = masterModel.ipb06;
                            break;
                    }
                    switch (invr522Model.type2)
                    {
                        case "1":
                            masterModel.qty2 = masterModel.ipb30;
                            break;
                        case "2":
                            masterModel.qty2 = masterModel.ipb40;
                            break;
                        case "3":
                            masterModel.qty2 = masterModel.ipb50;
                            break;
                        case "4":
                            masterModel.qty2 = masterModel.ipb06;
                            break;
                    }
                    masterModel.dif_qty = masterModel.qty2 - masterModel.qty1;

                    masterModel.qty1_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.qty1);
                    masterModel.qty2_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.qty2);
                    masterModel.dif_qty_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.dif_qty);
                }
                
                if (invr522Model.dif_yn == "Y")//只顯示差異
                {
                    if (resultList.Where(x => x.dif_qty != 0).Count() == 0)
                    {
                        WfShowErrorMsg("查無資料,請重新過濾條件!");
                        return false;
                    }
                    pReport.RegData("master", resultList.Where(x => x.dif_qty != 0));
                }
                else
                {
                    pReport.RegData("master", resultList);                    
                }

                pReport.CacheAllData = true;
                StiGroupFooterBand footerBand1 = (StiGroupFooterBand)pReport.GetComponents()["GroupFooterBand1"];
                footerBand1.NewPageAfter = true;
                footerBand1.ResetPageNumber = true;
                pReport.Compile();
                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #28
0
    protected void SetandoRel()
    {
        //Report da stimulsoft

        Stimulsoft.Report.StiReport Report = new Stimulsoft.Report.StiReport();

        //Stimulsoft.Report.Web.StiWebDesigner st1 = new Stimulsoft.Report.Web.StiWebDesigner();

        if (Convert.ToString(Request.QueryString["Rel"]) == "frmZurel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/folhafrequencia.mrt"));
            Report.Compile();
            Report["DiasMes"]         = TotalDiasMes.ToString();
            Report["DiasCumpridos"]   = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]   = TotalHoraMes.ToString();
            Report["HorasCumpridas"]  = HorasCumpridas;
            Report["HorasRealizadas"] = HorasRealizadas;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmZuxa")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/EspelhoPonto.mrt"));
            Report.Compile();
            Report["DiasMes"]        = TotalDiasMes.ToString();
            Report["DiasCumpridos"]  = TotalDiasCumprido.ToString();
            Report["TotalHorasMes"]  = TotalHoraMes.ToString();
            Report["HorasCumpridas"] = HorasCumpridas.ToString();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmsitu")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/situacaousuario.mrt"));
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmbco")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/totalhorasdiarias.mrt"));
            Report.Compile();
            //Report["Teste"] = 932;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmbcoHoraMes")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/bancoHoraMes.mrt"));
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmRelacDia")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/relacaopontoDia.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmLocalRegistro")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/LocalRegistro.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmMotivoFalta")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelacaoMotivoFalta.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfca")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/FichaCadastral.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfi")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/FichaCadastral.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmdesc")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelRelacaoRegistroPeriodo.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmfaltaInjust")
        {
            if (RelUtilizado == 0)
            {
                Report.Load(Server.MapPath(@"~/Relatorio/STF/RelDataInjustificada.mrt"));
            }
            else
            {
                Report.Load(Server.MapPath(@"~/Relatorio/STF/RelRegistroAusente.mrt"));
            }
            //o Outro Aqui
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmAuditRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/RelatorioAuditoriaJustificativa.mrt"));
            Report.Compile();
            Report["DTInicio"] = INICIO;
            Report["DTFim"]    = FIM;
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmLogMaqRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/AuditoriaGeralDasConexoes.mrt"));
            Report.Compile();
        }
        else if (Convert.ToString(Request.QueryString["Rel"]) == "frmInfoMaqRel")
        {
            Report.Load(Server.MapPath(@"~/Relatorio/STF/InformacoesMaquinasColetorLocal.mrt"));
            Report.Compile();
        }

        Report.RegData("DatasetPontoFrequencia", ds);

        Report.Render();

        System.IO.MemoryStream memStream = new System.IO.MemoryStream();

        HttpContext.Current.Response.ClearContent();
        HttpContext.Current.Response.ClearHeaders();
        HttpContext.Current.Response.ContentType = "application/pdf";

        HttpContext.Current.Response.AddHeader("Pontoweb.pdf", "");

        Stimulsoft.Report.Export.StiPdfExportService Export = new Stimulsoft.Report.Export.StiPdfExportService();

        Export.ExportPdf(Report, memStream, Stimulsoft.Report.StiPagesRange.All, 100, 100, false, false, true, true,
                         "", "", Stimulsoft.Report.Export.StiUserAccessPrivileges.All, Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit40, false);

        Response.ContentType = "application/pdf";

        Response.AddHeader("content-disposition", "inline; filename=Pontoweb.pdf");

        Response.BinaryWrite(memStream.ToArray());
    }
Beispiel #29
0
        public virtual ActionResult GetReportSnapshot(string fileName, string sourceName, string sourceData)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                return(Content("未能获取到打印格式信息!"));
            }
            DataTable dt = new DataTable();

            if (sourceName == "goods")
            {
                dt = BLLFactory <Mst_Goods> .Instance.GetPrint(sourceData);//
            }
            if (sourceName == "printInStock")
            {
                dt = BLLFactory <PI_Head> .Instance.GetPrint(sourceData);
            }
            if (sourceName == "printOutstock")
            {
                dt = BLLFactory <SO_Head> .Instance.GetPrint(sourceData);
            }

            if (sourceName == "PrintMask")
            {
                //将object类强转list集合
                List <SO_StockMakeBodyInfo> list = Session["MaskList"] as List <SO_StockMakeBodyInfo>;
                //实例化dataTable
                dt = new DataTable();
                //给datatable添加列
                dt.Columns.Add("F_GoodsName");
                dt.Columns.Add("F_SellingPrice");
                dt.Columns.Add("F_RealNumber");
                dt.Columns.Add("F_Unit");
                dt.Columns.Add("F_CargoPositionName");
                dt.Columns.Add("F_WarehouseName");
                //添加数据
                foreach (SO_StockMakeBodyInfo item in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["F_GoodsName"]         = item.F_GoodsName;
                    dr["F_SellingPrice"]      = item.F_SellingPrice;
                    dr["F_RealNumber"]        = item.F_RealNumber;
                    dr["F_Unit"]              = item.F_Unit;
                    dr["F_RealNumber"]        = item.F_RealNumber;
                    dr["F_CargoPositionName"] = item.F_CargoPositionName;
                    dr["F_WarehouseName"]     = item.F_WarehouseName;
                    dt.Rows.Add(dr);
                }
            }

            PrintModel model = new PrintModel();

            model.fileName   = fileName;
            model.sourceName = "Source";
            model.sourceData = dt;

            // 创建报表对象
            Stimulsoft.Report.StiReport report1 = new Stimulsoft.Report.StiReport();
            //读取文件
            report1.Load(Server.MapPath(string.Format("~/Content/reports/{0}.mrt", model.fileName)));
            //截止读取
            report1.Compile();
            if (!string.IsNullOrEmpty(model.sourceName) && model.sourceData != null)
            {
                //注册数据源P
                report1.RegData(model.sourceName, model.sourceData);
            }

            //返回报表
            return(Stimulsoft.Report.Mvc.StiMvcViewer.GetReportSnapshotResult(report1));
        }
Beispiel #30
0
        protected override bool WfExecReport(Stimulsoft.Report.StiReport pReport)
        {
            //DataSet ds;
            vw_manr311    manr311Model;
            StringBuilder sbSql   = null;
            string        sqlBody = "";
            DataTable     dtMaster;
            List <YR.ERP.DAL.YRModel.Reports.Man.Manr311.Master> masterList;
            List <QueryInfo> queryInfoList;
            QueryInfo        queryModel;
            string           strQueryRange, strWhere;
            StringBuilder    sbQuerySingle = null;

            List <SqlParameter> sqlParmList;

            try
            {
                if (Vw_Manr311 != null) //他窗引用時
                {
                    manr311Model = Vw_Manr311;
                }
                else
                {
                    manr311Model = DrMaster.ToItem <vw_manr311>();
                }

                queryInfoList = new List <QueryInfo>();
                #region range 處理
                if (!GlobalFn.varIsNull(manr311Model.mfa01))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "mfa_tb";
                    queryModel.ColumnName = "mfa01";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["mfa01"].DataType.Name;
                    queryModel.Value      = manr311Model.mfa01;
                    queryInfoList.Add(queryModel);
                }
                if (!GlobalFn.varIsNull(manr311Model.mfa03))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "mfa_tb";
                    queryModel.ColumnName = "mfa03";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["mfa03"].DataType.Name;
                    queryModel.Value      = manr311Model.mfa03;
                    queryInfoList.Add(queryModel);
                }
                sqlParmList = new List <SqlParameter>();

                if (!GlobalFn.varIsNull(manr311Model.mfa06))
                {
                    queryModel            = new QueryInfo();
                    queryModel.TableName  = "mfa_tb";
                    queryModel.ColumnName = "mfa06";
                    queryModel.ColumnType = TabMaster.DtSource.Columns["mfa06"].DataType.Name;
                    queryModel.Value      = manr311Model.mfa06;
                    queryInfoList.Add(queryModel);
                }
                sqlParmList   = new List <SqlParameter>();
                strQueryRange = BoMaster.WfGetQueryString(queryInfoList, out sqlParmList);
                #endregion

                #region single 處理
                sbQuerySingle = new StringBuilder();
                if (!GlobalFn.varIsNull(manr311Model.mfa02_s))
                {
                    sbQuerySingle.AppendLine("AND mfa02>=@mfa02_s");
                    sqlParmList.Add(new SqlParameter("@mfa02_s", manr311Model.mfa02_s));
                }
                if (!GlobalFn.varIsNull(manr311Model.mfa02_e))
                {
                    sbQuerySingle.AppendLine("AND mfa02<=@mfa02_e");
                    sqlParmList.Add(new SqlParameter("@mfa02_e", manr311Model.mfa02_e));
                }
                #endregion

                strWhere = strQueryRange + " " + sbQuerySingle.ToString();
                var strSecurity = WfGetSecurityString();        //取得權限字串
                if (!GlobalFn.varIsNull(strSecurity))
                {
                    strWhere += strSecurity;
                }

                //取得單頭
                sqlBody            = @"SELECT 
	                            mfa00,mfa01,mfa02,mfa03,mfa04,mfa05,
	                            mfa06,mfa07,mfa08,
                                bab02 as mfa01_c,
                                pca02 as mfa03_c,
	                            bec02 as mfa04_c,beb02 as mfa05_c,
	                            mfb02,mfb03,mfb04,mfb05,mfb06,
	                            mfb07,mfb09,
                                ica.ica03 as ica03,
                                bej.bej03 as bej03,
                                '' as mfb05_str,
                                pcb03,pcb04,pcb06,pcb07
                            FROM mfa_tb   
                                LEFT JOIN mfb_tb On mfa01=mfb01
	                            LEFT JOIN baa_tb ON 1=1	
	                            LEFT JOIN bab_tb ON substring(mfa01,1,baa06)=bab01
	                            LEFT JOIN pca_tb ON mfa03=pca01	--廠商
	                            LEFT JOIN bec_tb ON mfa04=bec01	--員工
	                            LEFT JOIN beb_tb ON mfa05=beb01	--部門
                                LEFT JOIN ica_tb ica ON mfb03=ica.ica01
                                LEFT JOIN bej_tb bej ON mfb06=bej.bej01
                                LEFT JOIN pcb_tb ON mfa03=pcb01 and mfa07=pcb02
                            WHERE 1=1 
                                AND mfaconf='Y'
                                AND mfa00='2'
                           ";
                dtMaster           = BoMaster.OfGetDataTable(string.Concat(sqlBody, strWhere), sqlParmList.ToArray());
                dtMaster.TableName = "Master";

                if (dtMaster == null || dtMaster.Rows.Count == 0)
                {
                    WfShowErrorMsg("查無資料,請重新過濾條件!");
                    return(false);
                }

                masterList = dtMaster.ToList <Master>();
                foreach (Master masterModel in masterList)
                {
                    masterModel.mfb05_str = string.Format("{0:N" + masterModel.bej03 + "}", masterModel.mfb05);//子件數量
                }

                pReport.RegData(dtMaster);
                pReport.RegData("Master", masterList);
                pReport.CacheAllData = true;
                //處理排序
                StiDataBand stiDataBand1 = (StiDataBand)pReport.GetComponents()["DataBand1"];
                switch (manr311Model.order_by)
                {
                case "1":    //1.依出庫日期
                    stiDataBand1.Sort = new string[] { "ASC", "mfa02" };
                    break;

                case "2":    //2.依廠商
                    stiDataBand1.Sort = new string[] { "ASC", "mfa03" };
                    break;
                }
                //處理跳頁
                StiGroupFooterBand grouperBand1 = (StiGroupFooterBand)pReport.GetComponents()["GroupFooterBand1"];
                if (manr311Model.jump_yn.ToUpper() == "Y")
                {
                    grouperBand1.NewPageAfter    = true;
                    grouperBand1.ResetPageNumber = true;
                }
                else
                {
                    grouperBand1.NewPageAfter    = false;
                    grouperBand1.ResetPageNumber = false;
                }

                pReport.Compile();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }