Ejemplo n.º 1
0
        private void StimulsoftSimpleButton_Click(object sender, EventArgs e)
        {
            var rep = new StiReport();

            rep.Design();
            this.Close();
        }
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            var report = new StiReport();

            report.Load(@"Reports\SimpleList.mrt");
            report.Design();
        }
Ejemplo n.º 3
0
        private static void InternalRun()
        {
            var stiReport = new StiReport();

            stiReport.Load("Report.mrt");
            stiReport.Design();
        }
Ejemplo n.º 4
0
        void IReporter.Design(IObjectHost objectHost)
        {
            StiReport report = new StiReport();

            PrepareReport(report);
            report.Design(false);
        }
Ejemplo n.º 5
0
        public ReturnedSaveFuncInfo PrintPreviewNew(StiReport st, DataSet ds, int sanadId, int sanadType,
                                                    List <object> lst)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                PutExtras(st, ds, sanadId, sanadType, lst);
                if (clsPrint.ShowDesign)
                {
                    st.Design();
                }
                else
                {
                    st.Show(true);
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
Ejemplo n.º 6
0
        private void btDesign_Click(object sender, System.EventArgs e)
        {
            var report = new StiReport();

            StiOptions.Dictionary.AutoSynchronize = StiAutoSynchronizeMode.None;

            if (tvReports.SelectedNode != null && tvReports.SelectedNode.Parent != null)
            {
                var file = applicationPath + "Reports\\" + tvReports.SelectedNode.Tag;

                if (File.Exists(file))
                {
                    report.Load(file);
                }
                else
                {
                    MessageBox.Show("File \"" + file + "\" not found");
                }
            }
            RegData(report, (string)tvReports.SelectedNode.Tag);

            reportInfo info = reportsHelper[tvReports.SelectedNode.Tag] as reportInfo;

            if (info != null)
            {
                report.ReportDescription = info.description;
            }
            report.Design();

            ApplyStyle();
        }
Ejemplo n.º 7
0
        public void RunReport(string reportFileName, ReportOperator opera, DataSet reportData,
                              List <KeyValuePair <string, object> > varList)
        {
            if (outInfo != null)
            {
                outInfo("正在装载报表文件:" + ReportDir + reportFileName);
            }


            bool isNewFile = !File.Exists(ReportDir + reportFileName); //是新文件吗

            StiReport report = new StiReport();

            if (ReportDir + reportFileName != null && !isNewFile)
            {
                report.Load(ReportDir + reportFileName);
            }


            if (reportData != null)
            {
                report.RegData(reportData);
            }

            if (outInfo != null)
            {
                outInfo("正在初始化报表 ...");
            }

            AddReportVar(report, varList);

            if (!report.IsStopped)
            {
                if (opera == ReportOperator.Previev)
                {
                    report.Show(true);
                }
                else if (opera == ReportOperator.Print)
                {
                    report.Print(false);
                }
                else if (opera == ReportOperator.Design)
                {
                    if (isNewFile)
                    {
                        report.ReportFile = ReportDir + reportFileName;
                    }

                    report.Design(true);
                }
            }

            report.Dispose();
            report = null;
            if (outInfo != null)
            {
                outInfo("准备");
            }
        }
Ejemplo n.º 8
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            StiReport report = new StiReport();

            report.RegData(dataSet1);
            report.Load("..\\GlobalizedSimpleList.mrt");
            report.Design();
        }
Ejemplo n.º 9
0
        private void btDesignITypedList_Click(object sender, System.EventArgs e)
        {
            StiReport report = new StiReport();

            report.RegData("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees());
            report.Load("..\\BusinessObjects_ITypedList.mrt");
            report.Design();
        }
Ejemplo n.º 10
0
        private void btDesignIEnumerable_Click(object sender, System.EventArgs e)
        {
            StiReport report = new StiReport();

            report.RegData("EmployeeIEnumerable", CreateBusinessObjectsIEnumerable.GetEmployees());
            report.Load("..\\BusinessObjects_IEnumerable.mrt");
            report.Design();
        }
        private void DesignReport()
        {
            StiReport report                   = new StiReport();
            var       AddressCompany           = _viewModel.CompanyInformationModel.Address;
            var       CityCompany              = _viewModel.CompanyInformationModel.City;
            var       EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
            var       FaxCompany               = _viewModel.CompanyInformationModel.Fax;
            var       LogoCompany              = _viewModel.CompanyInformationModel.Logo;
            var       ManagerNameCompany       = _viewModel.CompanyInformationModel.ManagerName;
            var       MobileCompany            = _viewModel.CompanyInformationModel.Mobile;
            var       PhoneCompany             = _viewModel.CompanyInformationModel.Phone;
            var       Phone2Company            = _viewModel.CompanyInformationModel.Phone2;
            var       PostalCodeCompany        = _viewModel.CompanyInformationModel.PostalCode;
            var       ProvinceCompany          = _viewModel.CompanyInformationModel.Province;
            var       StoreNameCompany         = _viewModel.CompanyInformationModel.StoreName;
            var       StoreCodeCompany         = _viewModel.CompanyInformationModel.StoreCode;
            var       TownCompany              = _viewModel.CompanyInformationModel.Town;
            var       WebSiteCompany           = _viewModel.CompanyInformationModel.WebSite;
            var       data = reviewRadGridView.SelectedItems.Cast <AccDocumentItemDTO>().Select(i =>
                                                                                                new
            {
                Code               = i.Code,
                OpeningSumDebit    = i.OpeningSumDebit,
                OpeningSumCredit   = i.OpeningSumCredit,
                RemainDebit        = i.RemainDebit,
                RemainCredit       = i.RemainCredit,
                SumCredit          = i.SumCredit,
                SumDebit           = i.SumDebit,
                Title              = i.Title,
                AddressCompany     = AddressCompany,
                CityCompany        = CityCompany,
                EconomicStoreCode  = EconomicStoreCodeCompany,
                FaxCompany         = FaxCompany,
                LogoCompany        = LogoCompany,
                ManagerNameCompany = ManagerNameCompany,
                MobileCompany      = MobileCompany,
                PhoneCompany       = PhoneCompany,
                Phone2Company      = Phone2Company,
                PostalCodeCompany  = PostalCodeCompany,
                ProvinceCompany    = ProvinceCompany,
                StoreNameCompany   = StoreNameCompany,
                StoreCodeCompany   = StoreCodeCompany,
                TownCompany        = TownCompany,
                WebSiteCompany     = WebSiteCompany,
                FromDate           = _viewModel.AccDocumentHeaderFilter.FromDate.ToShortDateString(),
                ToDate             = _viewModel.AccDocumentHeaderFilter.ToDate.ToShortDateString(),
            }
                                                                                                ).ToList();
            var path = $"{Environment.CurrentDirectory}\\Report\\reviewReport.mrt";

            report.RegBusinessObject("ReviewReport", data);
            if (!File.Exists(path))
            {
                File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
            }
            report.Load(path);
            report.Design();
        }
Ejemplo n.º 12
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            StiReport report = new StiReport();

            report.RegData(dataSet1);

            report.Load("..\\LiveReports.mrt");
            report.Design();
        }
Ejemplo n.º 13
0
        private void ButtonDesign_Click(object sender, EventArgs e)
        {
            LoadLocalization();

            var report = new StiReport();

            report.Load(@"Reports\SimpleList.mrt");
            report.Design();
        }
Ejemplo n.º 14
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            FillCopyrightParam();

            var report = new StiReport();

            report.RegData(dataSet1);
            report.Load("..\\Copyrights.mrt");
            report.Design();
        }
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var AddressCompany           = _viewModel.CompanyInformationModel.Address;
                var CityCompany              = _viewModel.CompanyInformationModel.City;
                var EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
                var FaxCompany         = _viewModel.CompanyInformationModel.Fax;
                var LogoCompany        = _viewModel.CompanyInformationModel.Logo;
                var ManagerNameCompany = _viewModel.CompanyInformationModel.ManagerName;
                var MobileCompany      = _viewModel.CompanyInformationModel.Mobile;
                var PhoneCompany       = _viewModel.CompanyInformationModel.Phone;
                var Phone2Company      = _viewModel.CompanyInformationModel.Phone2;
                var PostalCodeCompany  = _viewModel.CompanyInformationModel.PostalCode;
                var ProvinceCompany    = _viewModel.CompanyInformationModel.Province;
                var StoreNameCompany   = _viewModel.CompanyInformationModel.StoreName;
                var StoreCodeCompany   = _viewModel.CompanyInformationModel.StoreCode;
                var TownCompany        = _viewModel.CompanyInformationModel.Town;
                var WebSiteCompany     = _viewModel.CompanyInformationModel.WebSite;
                var data = radGridView.SelectedItems.Cast <Currency>()
                           .Select(currency => new
                {
                    CurrencyTitle      = currency.CurrencyTitle,
                    CurrencyTitle2     = currency.CurrencyTitle2,
                    NumberDecimal      = currency.NumberDecimal,
                    TitleDecimal       = currency.TitleDecimal,
                    TitleDecimal2      = currency.TitleDecimal2,
                    AddressCompany     = AddressCompany,
                    CityCompany        = CityCompany,
                    EconomicStoreCode  = EconomicStoreCodeCompany,
                    FaxCompany         = FaxCompany,
                    LogoCompany        = LogoCompany,
                    ManagerNameCompany = ManagerNameCompany,
                    MobileCompany      = MobileCompany,
                    PhoneCompany       = PhoneCompany,
                    Phone2Company      = Phone2Company,
                    PostalCodeCompany  = PostalCodeCompany,
                    ProvinceCompany    = ProvinceCompany,
                    StoreNameCompany   = StoreNameCompany,
                    StoreCodeCompany   = StoreCodeCompany,
                    TownCompany        = TownCompany,
                    WebSiteCompany     = WebSiteCompany,
                });
                var path = $"{Environment.CurrentDirectory}\\Report\\currencyReport.mrt";
                report.RegBusinessObject("CurrencyReport", data);
                if (!File.Exists(path))
                {
                    File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
                }
                report.Load(path);
                report.Design();
            }
        }
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var AddressCompany           = _viewModel.CompanyInformationModel.Address;
                var CityCompany              = _viewModel.CompanyInformationModel.City;
                var EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
                var FaxCompany         = _viewModel.CompanyInformationModel.Fax;
                var LogoCompany        = _viewModel.CompanyInformationModel.Logo;
                var ManagerNameCompany = _viewModel.CompanyInformationModel.ManagerName;
                var MobileCompany      = _viewModel.CompanyInformationModel.Mobile;
                var PhoneCompany       = _viewModel.CompanyInformationModel.Phone;
                var Phone2Company      = _viewModel.CompanyInformationModel.Phone2;
                var PostalCodeCompany  = _viewModel.CompanyInformationModel.PostalCode;
                var ProvinceCompany    = _viewModel.CompanyInformationModel.Province;
                var StoreNameCompany   = _viewModel.CompanyInformationModel.StoreName;
                var StoreCodeCompany   = _viewModel.CompanyInformationModel.StoreCode;
                var TownCompany        = _viewModel.CompanyInformationModel.Town;
                var WebSiteCompany     = _viewModel.CompanyInformationModel.WebSite;
                var data = TLRadGridView.SelectedItems.Cast <TL>().ToList()
                           .Select(tl => new
                {
                    TLCode             = tl.TLCode,
                    GLTitle            = tl.GL.Title,
                    Title              = tl.Title,
                    Title2             = tl.Title2,
                    Status             = tl.Status == true ? "فعال" : "غیرفعال",
                    AddressCompany     = AddressCompany,
                    CityCompany        = CityCompany,
                    EconomicStoreCode  = EconomicStoreCodeCompany,
                    FaxCompany         = FaxCompany,
                    LogoCompany        = LogoCompany,
                    ManagerNameCompany = ManagerNameCompany,
                    MobileCompany      = MobileCompany,
                    PhoneCompany       = PhoneCompany,
                    Phone2Company      = Phone2Company,
                    PostalCodeCompany  = PostalCodeCompany,
                    ProvinceCompany    = ProvinceCompany,
                    StoreNameCompany   = StoreNameCompany,
                    StoreCodeCompany   = StoreCodeCompany,
                    TownCompany        = TownCompany,
                    WebSiteCompany     = WebSiteCompany,
                });
                var path = $"{Environment.CurrentDirectory}\\Report\\tlReport.mrt";
                report.RegBusinessObject("TLReport", data);
                if (!File.Exists(path))
                {
                    File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
                }
                report.Load(path);
                report.Design();
            }
        }
Ejemplo n.º 17
0
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var AddressCompany           = _viewModel.CompanyInformationModel.Address;
                var CityCompany              = _viewModel.CompanyInformationModel.City;
                var EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
                var FaxCompany         = _viewModel.CompanyInformationModel.Fax;
                var LogoCompany        = _viewModel.CompanyInformationModel.Logo;
                var ManagerNameCompany = _viewModel.CompanyInformationModel.ManagerName;
                var MobileCompany      = _viewModel.CompanyInformationModel.Mobile;
                var PhoneCompany       = _viewModel.CompanyInformationModel.Phone;
                var Phone2Company      = _viewModel.CompanyInformationModel.Phone2;
                var PostalCodeCompany  = _viewModel.CompanyInformationModel.PostalCode;
                var ProvinceCompany    = _viewModel.CompanyInformationModel.Province;
                var StoreNameCompany   = _viewModel.CompanyInformationModel.StoreName;
                var StoreCodeCompany   = _viewModel.CompanyInformationModel.StoreCode;
                var TownCompany        = _viewModel.CompanyInformationModel.Town;
                var WebSiteCompany     = _viewModel.CompanyInformationModel.WebSite;
                var data = radGridView.SelectedItems.Cast <User>().ToList()
                           .Select(user => new
                {
                    UserName           = user.UserName,
                    FriendlyName       = user.FriendlyName,
                    GroupName          = user.Group.Name,
                    Password           = user.Password,
                    AddressCompany     = AddressCompany,
                    CityCompany        = CityCompany,
                    EconomicStoreCode  = EconomicStoreCodeCompany,
                    FaxCompany         = FaxCompany,
                    LogoCompany        = LogoCompany,
                    ManagerNameCompany = ManagerNameCompany,
                    MobileCompany      = MobileCompany,
                    PhoneCompany       = PhoneCompany,
                    Phone2Company      = Phone2Company,
                    PostalCodeCompany  = PostalCodeCompany,
                    ProvinceCompany    = ProvinceCompany,
                    StoreNameCompany   = StoreNameCompany,
                    StoreCodeCompany   = StoreCodeCompany,
                    TownCompany        = TownCompany,
                    WebSiteCompany     = WebSiteCompany,
                });

                var path = $"{Environment.CurrentDirectory}\\Report\\userReport.mrt";
                report.RegBusinessObject("UserReport", data);
                if (!File.Exists(path))
                {
                    File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
                }
                report.Load(path);
                report.Design();
            }
        }
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var AddressCompany           = _viewModel.CompanyInformationModel.Address;
                var CityCompany              = _viewModel.CompanyInformationModel.City;
                var EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
                var FaxCompany         = _viewModel.CompanyInformationModel.Fax;
                var LogoCompany        = _viewModel.CompanyInformationModel.Logo;
                var ManagerNameCompany = _viewModel.CompanyInformationModel.ManagerName;
                var MobileCompany      = _viewModel.CompanyInformationModel.Mobile;
                var PhoneCompany       = _viewModel.CompanyInformationModel.Phone;
                var Phone2Company      = _viewModel.CompanyInformationModel.Phone2;
                var PostalCodeCompany  = _viewModel.CompanyInformationModel.PostalCode;
                var ProvinceCompany    = _viewModel.CompanyInformationModel.Province;
                var StoreNameCompany   = _viewModel.CompanyInformationModel.StoreName;
                var StoreCodeCompany   = _viewModel.CompanyInformationModel.StoreCode;
                var TownCompany        = _viewModel.CompanyInformationModel.Town;
                var WebSiteCompany     = _viewModel.CompanyInformationModel.WebSite;
                var data = radGridView.SelectedItems.Cast <DocumentNumbering>()
                           .Select(documentNumbering => new
                {
                    AccountDocumentTitle = documentNumbering.AccountDocument.AccountDocumentTitle,
                    CountingWayTitle     = documentNumbering.CountingWay.CountingWayTitle,
                    StyleTitle           = documentNumbering.Style.StyleTitle,
                    StartNumber          = documentNumbering.StartNumber,
                    EndNumber            = documentNumbering.EndNumber,
                    AddressCompany       = AddressCompany,
                    CityCompany          = CityCompany,
                    EconomicStoreCode    = EconomicStoreCodeCompany,
                    FaxCompany           = FaxCompany,
                    LogoCompany          = LogoCompany,
                    ManagerNameCompany   = ManagerNameCompany,
                    MobileCompany        = MobileCompany,
                    PhoneCompany         = PhoneCompany,
                    Phone2Company        = Phone2Company,
                    PostalCodeCompany    = PostalCodeCompany,
                    ProvinceCompany      = ProvinceCompany,
                    StoreNameCompany     = StoreNameCompany,
                    StoreCodeCompany     = StoreCodeCompany,
                    TownCompany          = TownCompany,
                    WebSiteCompany       = WebSiteCompany,
                });
                var path = $"{Environment.CurrentDirectory}\\Report\\documentNumberingReport.mrt";
                report.RegBusinessObject("DocumentNumberingReport", data);
                if (!File.Exists(path))
                {
                    File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
                }
                report.Load(path);
                report.Design();
            }
        }
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var AddressCompany           = _viewModel.CompanyInformationModel.Address;
                var CityCompany              = _viewModel.CompanyInformationModel.City;
                var EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
                var FaxCompany         = _viewModel.CompanyInformationModel.Fax;
                var LogoCompany        = _viewModel.CompanyInformationModel.Logo;
                var ManagerNameCompany = _viewModel.CompanyInformationModel.ManagerName;
                var MobileCompany      = _viewModel.CompanyInformationModel.Mobile;
                var PhoneCompany       = _viewModel.CompanyInformationModel.Phone;
                var Phone2Company      = _viewModel.CompanyInformationModel.Phone2;
                var PostalCodeCompany  = _viewModel.CompanyInformationModel.PostalCode;
                var ProvinceCompany    = _viewModel.CompanyInformationModel.Province;
                var StoreNameCompany   = _viewModel.CompanyInformationModel.StoreName;
                var StoreCodeCompany   = _viewModel.CompanyInformationModel.StoreCode;
                var TownCompany        = _viewModel.CompanyInformationModel.Town;
                var WebSiteCompany     = _viewModel.CompanyInformationModel.WebSite;
                var data = radGridView.SelectedItems.Cast <ExchangeRate>()
                           .Select(exchangeRate => new
                {
                    Description        = exchangeRate.Description,
                    CurrencyTitle      = exchangeRate.Currency.CurrencyTitle,
                    EffectiveDate      = exchangeRate.EffectiveDate.ToShortDateString(),
                    ParityRate         = exchangeRate.ParityRate,
                    AddressCompany     = AddressCompany,
                    CityCompany        = CityCompany,
                    EconomicStoreCode  = EconomicStoreCodeCompany,
                    FaxCompany         = FaxCompany,
                    LogoCompany        = LogoCompany,
                    ManagerNameCompany = ManagerNameCompany,
                    MobileCompany      = MobileCompany,
                    PhoneCompany       = PhoneCompany,
                    Phone2Company      = Phone2Company,
                    PostalCodeCompany  = PostalCodeCompany,
                    ProvinceCompany    = ProvinceCompany,
                    StoreNameCompany   = StoreNameCompany,
                    StoreCodeCompany   = StoreCodeCompany,
                    TownCompany        = TownCompany,
                    WebSiteCompany     = WebSiteCompany,
                });
                var path = $"{Environment.CurrentDirectory}\\Report\\exchangeRateReport.mrt";
                report.RegBusinessObject("ExchangeRateReport", data);
                if (!File.Exists(path))
                {
                    File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
                }
                report.Load(path);
                report.Design();
            }
        }
Ejemplo n.º 20
0
        private void btnConvert_Click(object sender, System.EventArgs e)
        {
            if (!File.Exists(tbCrystalReportFile.Text))
            {
                MessageBox.Show("Incorrect Crystal Reports template file name",
                                null, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            }
            else
            {
                StiTreeViewLog log = new StiTreeViewLog(this.treeViewLog);

                log.OpenLog("Initialize ...");
                Application.DoEvents();
                ReportDocument crystalReport = new ReportDocument();

                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Open CrystalReports template file ...");
                Application.DoEvents();
                crystalReport.Load(tbCrystalReportFile.Text);

                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Converting ...");
                Application.DoEvents();

                StiCrystalReportsHelper convertor = new StiCrystalReportsHelper();
                TreeView       tv           = new TreeView();
                StiTreeViewLog log2         = new StiTreeViewLog(tv);
                StiReport      stimulReport = convertor.Convert(crystalReport, log2, checkBoxUsePrimitives.Checked, checkBoxUseFunction.Checked);

                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Save Stimulsoft Reports template file ...");
                Application.DoEvents();
                stimulReport.Save(tbStimulReportFile.Text);

                log.CurrentNode.Text += "OK";

                //log.OpenLog("Report template info");
                TreeNode tn = tv.Nodes[0];
                tv.Nodes.RemoveAt(0);
                tn.Text = "Report template info";
                treeViewLog.Nodes.Add(tn);
                //log.CloseLog();

                MessageBox.Show("Conversion complete!");

                #if Test
                stimulReport.Design();
                #endif
            }
        }
Ejemplo n.º 21
0
        private void ProcessarRelatorio(string tipo)
        {
            var report = new StiReport();

            using (Dados dstDados = new Dados())
            {
                Dados.GeralRow geralRow = dstDados.Geral.NewGeralRow();

                geralRow.Nome   = txtNome.Text;
                geralRow.CEP    = Convert.ToUInt64(txtCEP.Text).ToString(@"00000\-000");
                geralRow.Rua    = txtRua.Text;
                geralRow.Numero = int.Parse(txtNumero.Text);
                geralRow.Bairro = txtBairro.Text;
                geralRow.Cidade = txtCidade.Text;
                geralRow.Estado = txtEstado.Text;

                dstDados.Geral.AddGeralRow(geralRow);

                for (Int32 i = 0; i < dataGridItens.Rows.Count - 1; i++)
                {
                    Dados.ItemRow itemRow = dstDados.Item.NewItemRow();

                    itemRow.Produto    = dataGridItens.Rows[i].Cells[0].Value.ToString();
                    itemRow.Quantidade = int.Parse(dataGridItens.Rows[i].Cells[1].Value.ToString());
                    itemRow.Valor      = decimal.Parse(dataGridItens.Rows[i].Cells[2].Value.ToString());

                    dstDados.Item.AddItemRow(itemRow);
                }

                report.RegData(dstDados);

                report.Load("Etiqueta.mrt");

                switch (tipo)
                {
                case "Visualizar":
                    report.Show();
                    break;

                case "Exportar":
                    report.Render();
                    report.ExportDocument(StiExportFormat.Pdf, $"{txtCaminho.Text}\\Etiqueta_{ txtNome.Text.Replace(" ", string.Empty) }.pdf");
                    break;

                case "Editar":
                    report.Design();
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 22
0
        private void DesignReport()
        {
            StiReport report                   = new StiReport();
            var       AddressCompany           = _viewModel.CompanyInformationModel.Address;
            var       CityCompany              = _viewModel.CompanyInformationModel.City;
            var       EconomicStoreCodeCompany = _viewModel.CompanyInformationModel.EconomicStoreCode;
            var       FaxCompany               = _viewModel.CompanyInformationModel.Fax;
            var       LogoCompany              = _viewModel.CompanyInformationModel.Logo;
            var       ManagerNameCompany       = _viewModel.CompanyInformationModel.ManagerName;
            var       MobileCompany            = _viewModel.CompanyInformationModel.Mobile;
            var       PhoneCompany             = _viewModel.CompanyInformationModel.Phone;
            var       Phone2Company            = _viewModel.CompanyInformationModel.Phone2;
            var       PostalCodeCompany        = _viewModel.CompanyInformationModel.PostalCode;
            var       ProvinceCompany          = _viewModel.CompanyInformationModel.Province;
            var       StoreNameCompany         = _viewModel.CompanyInformationModel.StoreName;
            var       StoreCodeCompany         = _viewModel.CompanyInformationModel.StoreCode;
            var       TownCompany              = _viewModel.CompanyInformationModel.Town;
            var       WebSiteCompany           = _viewModel.CompanyInformationModel.WebSite;
            var       data = radGridView.SelectedItems.Cast <FinancialYear>()
                             .Select(financialYear => new
            {
                YearName           = financialYear.YearName,
                Description        = financialYear.Description,
                StartDate          = financialYear.StartDate.ToShortDateString(),
                EndDate            = financialYear.EndDate.ToShortDateString(),
                Status             = financialYear.IsActive == true ? "فعال" : "غیرفعال",
                AddressCompany     = AddressCompany,
                CityCompany        = CityCompany,
                EconomicStoreCode  = EconomicStoreCodeCompany,
                FaxCompany         = FaxCompany,
                LogoCompany        = LogoCompany,
                ManagerNameCompany = ManagerNameCompany,
                MobileCompany      = MobileCompany,
                PhoneCompany       = PhoneCompany,
                Phone2Company      = Phone2Company,
                PostalCodeCompany  = PostalCodeCompany,
                ProvinceCompany    = ProvinceCompany,
                StoreNameCompany   = StoreNameCompany,
                StoreCodeCompany   = StoreCodeCompany,
                TownCompany        = TownCompany,
                WebSiteCompany     = WebSiteCompany,
            });
            var path = $"{Environment.CurrentDirectory}\\Report\\financialYearReport.mrt";

            report.RegBusinessObject("FinancialYearReport", data);
            if (!File.Exists(path))
            {
                File.Copy($"{Environment.CurrentDirectory}\\Report\\Report.mrt", path, false);
            }
            report.Load(path);
            report.Design();
        }
Ejemplo n.º 23
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet data = new DataSet();

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

            StiReport report = new StiReport();

            report.Load("..\\..\\Reports\\SelectingColumns.mrt");
            report.RegData(data);
            report.Design();
        }
Ejemplo n.º 24
0
        void IReporter.DesignCurrentForm(IObjectHost objectHost)
        {
            DBGrid grid = (objectHost as DBGrid);

            if (grid == null)
            {
                return;
            }

            StiReport report = MakeReport(grid, _rcp);

            PrepareReport(report);
            report.Design(false);
        }
        private void btDesign_Click(object sender, RoutedEventArgs e)
        {
            var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("UsingBusinessObjects.SimpleList.mrt");

            StiReport report = new StiReport();

            report.Load(stream);

            stream.Close();
            stream.Dispose();
            stream = null;
            report.CalculationMode = StiCalculationMode.Interpretation;
            report.RegBusinessObject("Data", "Data", new Data());

            report.Design();
        }
        private void DesignReport1()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var data = SLRadGridView.SelectedItems.Cast <SLStandardDescription>()
                           .Select(sLStandardDescription => new
                {
                    SLStandardDescriptionTitle = sLStandardDescription.SLStandardDescriptionTitle,
                    SLStandardDescriptionCode  = sLStandardDescription.SLStandardDescriptionCode,
                });

                report.RegBusinessObject("SLStandardDescriptionReport", data);
                report.Design();
            }
        }
Ejemplo n.º 27
0
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var data = measurementUnitDataGrid.SelectedItems.Cast <MeasurementUnit>().Select(MeasurementUnit =>
                                                                                                 new
                {
                    MeasurementUnitTitle  = MeasurementUnit.MeasurementUnitTitle,
                    MeasurementUnitTitle2 = MeasurementUnit.MeasurementUnitTitle2,
                });

                report.RegBusinessObject("MeasurementUnitReport", data);
                report.Design();
            }
        }
Ejemplo n.º 28
0
        private void btnConvert_Click(object sender, System.EventArgs e)
        {
            if (!File.Exists(tbRssFile.Text))
            {
                MessageBox.Show("Incorrect Report Sharp Shooter template file name",
                                null, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            }
            else
            {
                StiTreeViewLog log = new StiTreeViewLog(this.treeViewLog);

                log.OpenLog("Initialize ...");
                Application.DoEvents();


                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Open Report Sharp Shooter template file ...");
                Application.DoEvents();

                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Converting ...");
                Application.DoEvents();

                byte[] buf = File.ReadAllBytes(tbRssFile.Text);

                StiReportSharpShooterHelper helper = new StiReportSharpShooterHelper();
                StiReport report = helper.Convert(buf, checkBoxImportStyleNames.Checked);

                log.CurrentNode.Text += "OK";
                log.CloseLog();
                log.OpenLog("Save Stimulsoft Reports template file ...");
                Application.DoEvents();
                report.Save(tbStimulReportFile.Text);

                log.CurrentNode.Text += "OK";

                MessageBox.Show("Conversion complete!");

                #if Test
                report.Design();
                #endif
            }
        }
Ejemplo n.º 29
0
        public ReturnedSaveFuncInfo DesignNew(StiReport st, DataSet ds, int sanadId, int sanadType,
                                              List <object> lst)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                PutExtras(st, ds, sanadId, sanadType, lst);
                st.Design();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
        private void DesignReport()
        {
            StiReport report = new StiReport();

            using (var uow = new SainaDbContext())
            {
                var data = productModelDataGrid.SelectedItems.Cast <ProductModel>().Select(ProductModel =>
                                                                                           new
                {
                    ProductModelCode  = ProductModel.ProductModelCode,
                    ProductModelTitle = ProductModel.ProductModelTitle,
                    RequiredCode      = ProductModel.RequiredCode,
                    RequiredDocument  = ProductModel.RequiredDocument
                });

                report.RegBusinessObject("ProductModelReport", data);
                report.Design();
            }
        }
Ejemplo n.º 31
0
 public static void CalcHouseCounterServicesReportFor354(System.Windows.Forms.IWin32Window owner, long calcId, System.DateTime period, long serviceId)
 {
     ObjectList<RepReportTemplate> list = RepReportTemplate.FindByName("09.01.01 Детализация по коллективным приборам учета");
     if (list.get_Count() > 0)
     {
         RepReportTemplate template = list.get_Item(0);
         System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[3];
         parameters[0] = new System.Data.SqlClient.SqlParameter("@calcId", System.Data.SqlDbType.BigInt);
         parameters[0].set_Value((long) calcId);
         parameters[1] = new System.Data.SqlClient.SqlParameter("@period", System.Data.SqlDbType.DateTime);
         parameters[1].set_Value(period);
         parameters[2] = new System.Data.SqlClient.SqlParameter("@serviceId", System.Data.SqlDbType.BigInt);
         if (serviceId > 0L)
         {
             parameters[2].set_Value((long) serviceId);
         }
         else
         {
             parameters[2].set_Value(System.DBNull.Value);
         }
         System.Data.DataSet set = DALSql.ExecuteDataSet("exec " + template.Sql + " @calcId, @period, @serviceId", parameters);
         StiReport report = new StiReport();
         report.LoadFromString(template.Template);
         report.Compile();
         report.RegData((System.Data.DataSet) set);
         if (User.IsMemberOf(RightsEnum.ОтчетыРедактированиеШаблона))
         {
             report.Design(true, (System.Windows.Forms.IWin32Window) owner);
             if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(owner, "Сохранить изменения в шаблоне?"))
             {
                 template.Template = report.SaveToString();
                 template.SaveChanges();
             }
         }
         else
         {
             report.Show((System.Windows.Forms.IWin32Window) owner);
         }
     }
 }
Ejemplo n.º 32
0
        internal static void ShowReport(StiReport report, bool wpf, bool design, DataSet dtSet,
            string vrReportAutor, string vrReportDescricao, string vrEmpresa, string vrCnc,
            string vrTitulo, string vrUsuario, string vrFiltros, string vrImage)
        {
            report.ReportAuthor = vrReportAutor;
            report.ReportDescription = vrReportDescricao;
            if (vrImage == null || vrImage == "")
                report.Dictionary.Variables["vrEmpresa"].ValueObject = vrEmpresa;
            else
            {
                if (System.IO.File.Exists(vrImage))
                {
                    report.Dictionary.Variables["vrEmpresa"].ValueObject = sEspacos + vrEmpresa;
                    StiImage stiImage = report.GetComponents()["imgLogo"] as StiImage;
                    Image myImage = Image.FromFile(vrImage);
                    stiImage.Image = myImage;
                }
            }
            report.Dictionary.Variables["vrCnc"].ValueObject = vrCnc;
            report.Dictionary.Variables["vrTitulo"].ValueObject = vrTitulo;
            report.Dictionary.Variables["vrUsuario"].ValueObject = vrUsuario;
            report.Dictionary.Variables["vrFiltros"].ValueObject = vrFiltros;

            report.RegData(dtSet);
            report.Compile();
            if (design)
            {                
                if (wpf)
                    report.DesignWithWpf();
                else
                    report.Design();
            }
            else
            {
                if (wpf)
                    report.ShowWithWpf();
                else
                    report.Show();
            }
        }
Ejemplo n.º 33
0
 private void tsbDesigner_Click(object sender, System.EventArgs e)
 {
     StiReport report = new StiReport();
     AccountReportType byName = AccountReportType.GetByName("Личный кабинет. Регистрация");
     report.LoadFromString(byName.Template);
     StiOptions.Designer.DontAskSaveReport = true;
     report.Design(true, (System.Windows.Forms.IWin32Window) this);
     if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
     {
         byName.Template = report.SaveToString();
         byName.SaveChanges();
     }
 }
Ejemplo n.º 34
0
 private void tsbDesigner_Click(object sender, System.EventArgs e)
 {
     RepReport report = this.InsertReportIntoGeneratorQueue();
     if ((report != null) && (report != RepReport.Null))
     {
         if ((report.Status != 0) || (report.ReportTemplateId == 0L))
         {
             throw new System.ApplicationException("Отчет непригоден для выполнения (id=" + ((long) report.Id) + ")");
         }
         RepReportTemplate withTemplate = RepReportTemplate.GetWithTemplate(report.ReportTemplateId);
         if ((withTemplate == null) || (withTemplate.Sql == string.Empty))
         {
             throw new System.ApplicationException("Отчет непригоден для выполнения (id=" + ((long) report.Id) + ")");
         }
         try
         {
             report.Status = 1;
             report.SaveChanges();
             System.Data.DataSet set = Mappers.RepReportMapper.GenerateReportDataSet(withTemplate.Sql, report.Id);
             StiReport report2 = new StiReport();
             report2.LoadFromString(withTemplate.Template);
             report2.RegData((System.Data.DataSet) set);
             StiOptions.Designer.DontAskSaveReport = true;
             report2.Design(true, (System.Windows.Forms.IWin32Window) this);
             if (System.Windows.Forms.DialogResult.Yes == AIS.SN.UI.Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
             {
                 withTemplate.Template = report2.SaveToString();
                 withTemplate.SaveChanges();
             }
         }
         catch (System.Exception exception)
         {
             AIS.SN.UI.Messages.ShowException(this, exception);
         }
         this.UpdateBingingReports();
     }
 }
Ejemplo n.º 35
0
        private void книгаУчетаДоходовИРасходовToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StiConfig.LoadLocalization("ru.xml");
            var report = new StiReport();
            StiOptions.Dictionary.BusinessObjects.MaxLevel = 0;
            report.Load(Path.Combine(Application.StartupPath, "Reports\\kniga.mrt"));

            var opers = new AllOperationRepository().GetAllOperation(BeginDate, EndDate).ToList();
            report.RegData("Operations", opers);

            var allopers = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), EndDate).ToList();

            int count = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), BeginDate.AddSeconds(-1)).Count();

            report.Dictionary.Variables.Add("BeginDate", BeginDate);
            report.Dictionary.Variables.Add("EndDate", EndDate);

            report.Dictionary.Variables.Add("StrPeriod", _strperiod);
            report.Dictionary.Variables.Add("StrDate", _strdate);
            report.Dictionary.Variables.Add("CountPosition", count);

            report.Dictionary.Variables.Add("SummaTotalPrihod", allopers.Sum(c=>c.SummaDebet));
            report.Dictionary.Variables.Add("SummoTotalRashod", allopers.Sum(c=>c.SummaKredit));

            if (ApplicationDeployment.IsNetworkDeployed)
            {
                report.Show(true);
            }
            else
            {
                report.Design();
            }
        }
Ejemplo n.º 36
0
 private void tsbDesigner_Click(object sender, System.EventArgs e)
 {
     System.Data.DataSet set = this.m_debtDocument.GenerateReportDebtSetNotices(this.m_DebtListNotices.procedureName, this.dbPayNotices.Value, this.cbAddDebtActionNotices.get_Checked(), (int) this.MinCountDebt.Value, (int) this.ColDayPerformance.Value, this.m_DebtListNotices.Id, this.m_SelectedAccounts);
     set.Tables.get_Item(0).set_TableName("data");
     StiReport report = new StiReport();
     DebtListNotices notices = ObjectWithId.FindById<DebtListNotices>(this.m_DebtListNotices.Id);
     report.LoadFromString(notices.template);
     report.RegData((System.Data.DataSet) set);
     StiOptions.Designer.DontAskSaveReport = true;
     report.Design(true, (System.Windows.Forms.IWin32Window) this);
     if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
     {
         notices.template = report.SaveToString();
         notices.SaveChanges();
     }
 }
Ejemplo n.º 37
0
 private void btPrint_Click(object sender, System.EventArgs e)
 {
     NoticeNoticeTemplate template = (this.bsNoticeTemplates.get_Current() as NoticeNoticeTemplate) ?? NoticeNoticeTemplate.Null;
     if (this.bsNotices.get_Count() == 0)
     {
         Messages.ShowMessage("Для печати ничего не найдено");
     }
     else if (template == NoticeNoticeTemplate.Null)
     {
         Messages.ShowMessage("Не выбран шаблон");
     }
     else
     {
         template = ObjectWithId.FindById<NoticeNoticeTemplate>(template.Id);
         System.Data.DataTable table = NoticeNotice.GetHeader((ObjectList<NoticeNotice>) this.bsNotices.get_DataSource(), this.cbHideClosedAccounts.get_Checked(), this.cbNoticeInformation.get_Checked());
         table.set_TableName("header");
         System.Data.DataSet set = NoticeNotice.GetReport((ObjectList<NoticeNotice>) this.bsNotices.get_DataSource(), template.Sql);
         if ((set.Tables.get_Count() >= 2) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             set.Tables.get_Item(0).set_TableName("pays");
             set.Tables.get_Item(1).set_TableName("counter");
             for (int i = 2; i < set.Tables.get_Count(); i = (int) (i + 1))
             {
                 int num2 = (int) (i - 1);
                 set.Tables.get_Item(i).set_TableName("data" + ((int) num2).ToString());
             }
             if (template.IdentityName == "Счет на оплату Ульяновск вариант 3")
             {
                 if (set.Tables.get_Count() > 2)
                 {
                     set.Tables.get_Item(2).set_TableName("organizations");
                 }
                 if (set.Tables.get_Count() > 3)
                 {
                     set.Tables.get_Item(3).set_TableName("rates");
                 }
             }
             StiReport report = new StiReport();
             report.LoadFromString(template.Template);
             report.ReportCacheMode = StiReportCacheMode.Off;
             report.Compile();
             foreach (System.Data.DataTable table2 in set.Tables)
             {
                 report.RegData(table2.get_TableName(), (System.Data.DataTable) table2);
             }
             report.RegData("header", (System.Data.DataTable) table);
             report.ReportCacheMode = StiReportCacheMode.Off;
             report.Compile();
             if (this.chbxIsDesignTemplate.get_Checked())
             {
                 StiOptions.Designer.DontAskSaveReport = true;
                 report.Design(true);
                 if ((report.SaveToString() != template.Template) && (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?")))
                 {
                     template.Template = report.SaveToString();
                     template.SaveChanges();
                 }
             }
             else
             {
                 report.Render(true);
                 report.Show(true);
             }
         }
     }
 }