コード例 #1
0
        public StimulReporDesigner_Frame(string reportUn)
        {
            #region Настраиваем дизайнер

            StimulReportFactory.PrepareDesigner();
            StiHelper.HyperLinkAttach();
            //StiHelper.StiWcfConfigure();

            InitializeComponent();

            DateRangeMode = enumDateRangeMode.WithoutDateMode;
            TreeMode      = enumTreeMode.None;

            // Designer
            StiOptions.WCFService.WCFRenderReport   += WCFRenderReport;
            StiOptions.WCFService.WCFTestConnection += WCFTestConnection;
            StiOptions.WCFService.WCFBuildObjects   += WCFBuildObjects;
            //StiOptions.WCFService.WCFRetrieveColumns += WCFRetrieveColumns;
            StiOptions.WCFService.WCFOpeningReportInDesigner += WCFOpeningReportInDesigner;
            //Designer.
            StiOptions.WCFService.WCFRequestFromUserRenderReport  += WCFRequestFromUserRenderReport;
            StiOptions.Engine.GlobalEvents.SavingReportInDesigner += GlobalEvents_SavingReportInDesigner;
            //StiOptions.Viewer.Elements.ShowReportSaveToServerButton = true;
            //Stimulsoft.Report.StiOptions.Viewer.Elements.ShowReportSaveToServerButton = true;

            // Interactions
            StiOptions.WCFService.WCFRenderingInteractions += WCFRenderingInteractions;

            // Prepare RequestFromUser Variables
            StiOptions.WCFService.WCFPrepareRequestFromUserVariables += WCFPrepareRequestFromUserVariables;
            StiOptions.WCFService.WCFInteractiveDataBandSelection    += WCFInteractiveDataBandSelection;

            #endregion

            _reportUn = reportUn;

            //Загрузка отчета из БД
            LayoutGrid.RunBackgroundAsync <TReportInfo>("LoadReport", response =>
            {
                if (response == null || response.Data == null)
                {
                    return;
                }

                var report = new StiReport
                {
                    CacheAllData    = true,
                    ReportCacheMode = StiReportCacheMode.On,
                };
                try
                {
                    report.Load(response.Data.DecodeBuffer());
                }
                catch (Exception ex)
                {
                    Manager.UI.ShowMessage(ex.Message);
                }

                _reportUn   = response.ReportUn;
                _reportName = tbReportName.Text = response.StringName;

                StimulReportFactory.PrepareReport(report, !string.IsNullOrEmpty(reportUn));

                ProryvReportFunctions.RegisterFunctionsInReport();

                DesignerControl.Report = report;

                DateRangeMode = (enumDateRangeMode)response.DateRangeMode;
                TreeMode      = (enumTreeMode)response.TreeMode;
                CheckBoxChannels.IsChecked = response.IsShowChannelSelector;
            }, EnumServiceType.StimulReport, reportUn);
        }