Beispiel #1
0
        private void GetSql()
        {
            if (_context.ReportState == ReportStates.OutU8)
            {
                return;
            }
            RemoteDataHelper rdh = null;

            if (_context.FilterArgs != null && !string.IsNullOrEmpty(_context.FilterArgs.ClassName.Trim()))
            {
                if (_context.FilterArgs.DataSource.Type == CustomDataSourceTypeEnum.TemplateTable)
                {
                    //_context.FilterArgs.DataSource.SQL = CustomDataSource.GetATableName();
                    _context.FilterArgs.DataSource.SQL = CustomDataSource.GetATableNameWithTaskId(_context.TaskID);
                }
                if (_context.ReportState == ReportStates.WebBrowse)
                {
                    rdh = DefaultConfigs.GetRemoteHelper();
                    _context.FilterArgs = rdh.GetSql(_context.UserToken, _context.TaskID, _context.SubID, _context.FilterArgs);
                }
                else
                {
                    rdh = new RemoteDataHelper();
                    rdh.GetSql(_context.FilterArgs);
                }
            }
        }
        /// <summary>
        /// 以直接修改数据库的方式清除一个分组的运行时格式
        /// </summary>
        public static void RemoveGroupStyle(
            string viewId,
            string groupId,
            string ufMetaCnnString)
        {
            RemoteDataHelper rdh = DefaultConfigs.GetRemoteHelper();

            rdh.RemoveGroupStyle(viewId, groupId, ufMetaCnnString);
        }
        public void OpenChartWizard(Chart chart)
        {
            ChartService _chartservice = null;
            string       id            = null;

            if (chart.Report.Type == ReportType.IndicatorReport)
            {
                id = "IndicatorChart";
                Hashtable       ctn = new Hashtable();
                SimpleHashtable sht = new SimpleHashtable();
                if (!string.IsNullOrEmpty(chart.DataSource))
                {
                    Section          indicatordetail = chart.Report.Sections[SectionType.IndicatorDetail];
                    IIndicatorMetrix metrix          = indicatordetail.Cells[chart.DataSource] as IIndicatorMetrix;
                    if (metrix == null)
                    {
                        throw new Exception("非法图表数据源矩阵");
                    }

                    sht.Add("__bcross__", metrix.CrossPart != null);
                    if (metrix.IndicatorParts != null)
                    {
                        foreach (IPart indi in metrix.IndicatorParts)
                        {
                            sht.Add((indi as Cell).Caption, (indi as Cell).Name);
                        }
                    }
                }
                else
                {
                    sht.Add("__bcross__", false);
                }
                ctn.Add(chart.Level, sht);
                _chartservice = new IndicatorChartService(chart.Report, ctn);
            }
            else
            {
                _chartservice = new ChartService(chart.Report);
            }

            ChartWizardAdapter _wizardadapter = new ChartWizardAdapter(_chartservice);

            if (_wizardadapter.ChartWizard.ShowDialog(_chartservice.GetSchemasAllLevel(chart.Level), chart.Level, id) == DialogResult.OK)
            {
                RemoteDataHelper rdh = DefaultConfigs.GetRemoteHelper();
                rdh.SaveChartStrings(ClientReportContext.Login.UfMetaCnnString, chart.Report.ViewID, chart.Report.ChartStrings);
            }
            else
            {
                chart.Report.ChartStrings = null;
            }
            chart.ChartWizard = null;
        }
Beispiel #4
0
        public EngineHelper(Control control, ClientReportContext context)
        {
            _context = context;
            _control = control;
            int handle = 0;

            if (_control != null)
            {
                handle = _control.Handle.ToInt32();
            }

            _engine = DefaultConfigs.GetRemoteEngine(ClientReportContext.Login, _context == null ? ReportStates.Print : _context.ReportState);
            CreateSemiRowsContainer();
            _semirowscontainer.ReportComing   += new ReportComingHandler(_semirowscontainer_ReportComing);
            _semirowscontainer.SemiRowsComing += new SemiRowsComingHandler(_semirowscontainer_SemiRowsComing);
            _semirowscontainer.EndAll         += new EventHandler(_semirowscontainer_EndAll);
            _semirowscontainer.ErrorOccured   += new ErrorHandler(_semirowscontainer_ErrorOccured);
            _semirowscontainer.Waiting        += new EventHandler(_semirowscontainer_Waiting);

            _headerevent = new AutoResetEvent(true);
            _outterevent = new AutoResetEvent(false);
        }