private FilterArgs GetSql(FilterArgs args) { #region CS //RemoteDataHelper rdh = null; //if (args != null && !string.IsNullOrEmpty(args.ClassName.Trim())) //{ // if (args.DataSource.Type == CustomDataSourceTypeEnum.TemplateTable) // args.DataSource.SQL = CustomDataSource.GetATableName(); // if (_context.ReportState == ReportStates.WebBrowse) // { // rdh = DefaultConfigs.GetRemoteHelper(); // args = rdh.GetSql(_context.UserToken, _context.TaskID, _context.SubID, _context.FilterArgs); // } // else // { // rdh = new RemoteDataHelper(); // ClientReportContext.Login = _login; // rdh.GetSql(args); // } //} #endregion var rdHelper = new RemoteDataHelper(); //return rdHelper.GetSql(_login.UserToken, _login.TaskID, _login.SubID, args); if (args.DataSource.Type == CustomDataSourceTypeEnum.TemplateTable) { //args.DataSource.SQL = CustomDataSource.GetATableNameWithTaskId(_login.TaskID); args.DataSource.SQL = CustomDataSource.GetATableName(); } ClientReportContext.Login = _login; rdHelper.GetSql(args); return(args); }
private void RealTimeQuery(bool applyauth) { try { UnableToolBarAll(); //if(applyauth) // UICommonHelper.ApplyAuth(_context, _context.ViewID, OperationEnum.Query); CreateArgs e = new CreateArgs(); //authstring RemoteDataHelper rdh = new RemoteDataHelper(); e.colauthstring = rdh.GetColAuthString(ClientReportContext.Login.U8Login, _context.ViewID); EngineHelper eh = CreateEngine(); string allcolumns = eh.Engine.LoadFormat(null, _context.ViewID, null, null, null, null, null); if (!string.IsNullOrEmpty(allcolumns)) { string columns = System.Text.RegularExpressions.Regex.Split(allcolumns, "@;@")[0].Replace("[", "").Replace("]", ""); RowAuthFacade raf = new RowAuthFacade(); string rowauth = raf.GetRowAuth(_context.ViewID, "", columns, ClientReportContext.Login, false); _context.FilterArgs.Args.Add("RowAuthString", rowauth); } e.bfilter = false; e.bgetsql = true; ParameterizedThreadStart ts = new ParameterizedThreadStart(eh.CreateReport); Thread t = new Thread(ts); t.Start(e); } catch (Exception ex) { ShowErrorMessage(ex.Message); } }
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; }
public ChartSchemas InitMobileReportChartSchema(Report report) { string _chartstrings = ""; ChartSchemas _chartschemas = null; if (!ClientReportContext.bInServerProcess && string.IsNullOrEmpty(report.ChartStrings)) { RemoteDataHelper rdh = new RemoteDataHelper(); _chartstrings = rdh.LoadChartStrings(this._loginInfo.UfMetaCnnString, report.ViewID); } if (_chartstrings != "") { _chartschemas = ChartSchemas.FromStrings(_chartstrings); } else { _chartschemas = new ChartSchemas(); } string id = null; var bFree = report.Type == ReportType.FreeReport || report.Type == ReportType.IndicatorReport || report.Type == ReportType.MetrixReport; if (bFree) { id = "freeid"; if (!_chartschemas.Contains(id)) { id = report.CurrentSchemaID; if (string.IsNullOrEmpty(id)) { id = "freeid"; } } } else { id = report.CurrentSchemaID; if (string.IsNullOrEmpty(id)) { id = "freeid"; } } _chartschemas.SetCurrentGroupChart(id, report.GroupLevels); report.ChartSchemas = _chartschemas; return(_chartschemas); }
private void tlcfilter_DropDown(object sender, EventArgs e) { try { this.tlcfilter.Items.Clear(); this.tlcfilter.Items.Add(U8ResService.GetResStringEx("U8.UAP.Report.All")); RemoteDataHelper rdh = DefaultConfigs.GetRemoteHelper(); DataTable dt = rdh.GetIndicatorFilter(_context.Report.FilterSource.Name, _context.Report.BaseTable, _eventfilter, ClientReportContext.Login.UfDataCnnString); foreach (DataRow dr in dt.Rows) { this.tlcfilter.Items.Add(dr[0].ToString()); } } catch (Exception ex) { ReportViewControl.ShowInformationMessageBox(ex.Message); } }
private string GetColAuthString(string viewId) { RemoteDataHelper rdh = new RemoteDataHelper(); string colauthstring; try //U易联报表获取不到taskID这里需要做一下处理 { colauthstring = rdh.GetColAuthString( ClientReportContext.Login.UserToken, ClientReportContext.Login.TaskID, ClientReportContext.Login.SubID, viewId); } catch { colauthstring = ""; } //colauthstring = rdh.GetColAuthString(ClientReportContext.Login.U8Login, viewId); //colauthstring = rdh.GetColAuthString(ClientReportContext.Login, viewId); return(colauthstring); }
public void Release() { if (_releaseevent.WaitOne(0, false)) { try { if (_semirowscontainer != null) { _semirowscontainer.Canceled(); } #region release auth //UICommonHelper.ReleaseAuth(_context, _context.ViewID, OperationEnum.Query); #endregion #region release cache & db if (_context.Report != null) { RemoteDataHelper rdh = DefaultConfigs.GetRemoteHelper(); rdh.DisposeDbAndCache(ClientReportContext.Login.TempDBCnnString, _context.Report.CacheID, _context.TablenameCollection, _context.LevelCollection); } #endregion #region normal release if (_context.Report != null) { _context.Report.Dispose(); _context.Report = null; } #endregion GC.Collect(); } catch { } } }
public MobileReportEngineAdapter(U8LoginInfor login) { this._login = login; _datacontainer = new SemiRowsContainerOnServer(); _rdh = new RemoteDataHelper(); }
public override Control CreatePartControl(IEditorPart part, IEditorInput input) { StringBuilder sb = new StringBuilder(); try { this.ReportEditorPart = part; this.ReportFormInput = input as ReportFormInput; sb.Append("CreatePartControl end 1"); this.ParseStaticReportInfo(); string reportId = this.GetObjectId(); sb.Append("CreatePartControl end 2"); object login = this.ReportFormInput.GetU8Login(); object rawFilter = null; bool isShowUI = false; bool isStaticReport = this.ReportFormInput.IsStaticReport(); int viewType = 1; sb.Append("CreatePartControl end 3"); if (!isStaticReport) { rawFilter = this.ReportFormInput.GetRawFilter(); isShowUI = this.ReportFormInput.IsShowUI(); } else { viewType = this.ReportFormInput.GetViewType(); } sb.Append("CreatePartControl end 4"); ClientReportContext context = new ClientReportContext(login); RemoteDataHelper rdh = new RemoteDataHelper(); sb.Append("CreatePartControl end 5"); context.ReportUIUserStateInfo = rdh.GetReportUserState(ClientReportContext.Login, reportId); sb.Append("CreatePartControl end 6"); ClientReportContext.Port = Cryptography.LoginInfo.ProtocolPort["RePt"].ToString(); ClientReportContext.Protocal = Cryptography.LoginInfo.ProtocolPort["RePr"].ToString(); sb.Append("CreatePartControl end 7"); DefaultConfigs.RegChannel(ClientReportContext.Login.AppServer); sb.Append("CreatePartControl end 8"); this.ReportViewControl = new ReportViewControl(); this.ReportViewControl.CanShowReport += new EventHandler(ReportViewControlShowReport); this.ReportViewControl.DoubleClick += new EventHandler(ReportViewControlDoubleClick); this.ReportViewControl.CloseContainerEvent += new CloseContainerHandler(ReportViewControl_ReportFilterEvent); this.ReportViewControl.UpdataGroupandCrossesToolbarEvent += new RefreshToolbarHandler(ReportViewControl_pdataGroupsToolbarEvent); this.ReportViewControl.RefreshViewsToolbarEvent += new RefreshToolbarHandler(ReportViewControl_RefreshViewsToolbarEvent); this.ReportViewControl.RefreshJoinQueryToolbarEvent += new RefreshToolbarHandler(ReportViewControl_RefreshJoinQueryToolbarEvent); // // pengzhzh 2012-8-9 // this.ReportViewControl.ModifyButtons += new System.Action(ButtonChangeModify); (this.ReportEditorPart as NetEditor).PageCloseRequest += new PageCloseRequestHandler(ReportPortalRunner_PageCloseRequest); sb.Append("CreatePartControl end 9"); if (isStaticReport) { this.ReportViewControl.Initialize(context, reportId, ReportStates.Static, (ReportType)viewType); } else { this.ReportViewControl.Initialize(context, reportId, ReportStates.Browse, rawFilter, isShowUI); } this.ReportFormInput.Text = "Loading"; sb.Append("CreatePartControl end 10"); (this.ReportEditorPart as NetEditor).Refresh(this.ReportFormInput); return(this.ReportViewControl); } catch (CanceledException) { CloseContainer(); return(null); } catch (Exception ex) { UFIDA.U8.UAP.Services.ReportExhibition.ReportViewControl.ShowInformationMessageBox(ex); UFIDA.U8.UAP.Services.ReportExhibition.ReportViewControl.ShowInformationMessageBox(ex.InnerException); System.Diagnostics.Trace.WriteLine("ReportPortalRunner.CreatePartControl Log:" + sb); CloseContainer(); return(null); } }
/// <summary> /// CS端有界面打开习文过滤时需要添加以下参数,这里先加上,可能没用。 /// </summary> /// <param name="filterargs"></param> /// <param name="login"></param> private void InitFilter2(ref FilterArgs filterargs, U8LoginInfor login) { //if (login.Year.ToString() != null && login.Year.ToString() != "") // filterargs.Args.Add("CIYear", login.Year.ToString()); //if (!string.IsNullOrEmpty(login.Date)) // filterargs.Args.Add("CurDate", login.Date); if (!filterargs.Args.Contains("ufreportarg")) { #region init filterargs string metastring = null; string datastring = null; string tempstring = null; //RemoteDataHelper rdh = DefaultConfigs.GetRemoteHelper(); var rdh = new RemoteDataHelper(); ReportRelateInfor rri = rdh.GetReportInfor(ClientReportContext.Login, filterargs.ReportID, ref metastring, ref datastring, ref tempstring); if (rri.Views.Count == 0) { throw new ResourceReportException("U8.UAP.Services.ReportElements.RemoteDataEngine.没有权限"); } ClientReportContext.Login.UfMetaCnnString = metastring; ClientReportContext.Login.UfDataCnnString = datastring; ClientReportContext.Login.TempDBCnnString = tempstring; var SimpleViews = rri.Views; filterargs.InitClass(rri.RootReportId, rri.FilterId, rri.FilterClass, rri.ClassName); //_rootReportId = rri.RootReportId; filterargs.Args.Add("filterxml", rri.FilterXML); StringBuilder sb = new StringBuilder(); SimpleView sv = null; if (string.IsNullOrEmpty(rri.FilterId) && string.IsNullOrEmpty(rri.FilterClass)) { string vid = filterargs.ViewID ?? SimpleViews.DefaultView.ID; //string gid = _context.Report != null ? _context.Report.CurrentSchemaID : ""; string gid = string.Empty; sb.Append("<Data"); sb.Append(" ViewID=\""); sb.Append(vid); sb.Append("\" GroupID=\""); sb.Append(gid ?? ""); sb.Append("\" dispdetail=\""); sb.Append("1"); sb.Append("\">"); } else { sb.Append("<Data>"); } sb.Append("<Views>"); for (int i = 0; i < SimpleViews.Count; i++) { sv = SimpleViews[i]; sb.Append("<View id=\""); sb.Append(sv.ID); sb.Append("\" ViewType=\""); sb.Append(sv.ViewType); sb.Append("\" Name=\""); sb.Append(getXmlStr(sv.Name)); sb.Append("\" ViewClass=\""); sb.Append(sv.ViewClass); sb.Append("\" bShowDetail=\""); sb.Append(sv.bShowDetail ? "True" : "False"); sb.Append("\" RowsCount=\""); sb.Append(sv.RowsCount.ToString()); sb.Append("\" bDefault=\""); sb.Append(sv.IsDefault ? "True" : "False"); sb.Append("\">"); sb.Append("</View>"); } sb.Append("</Views>"); sb.Append("</Data>"); filterargs.Args.Add("ufreportarg", sb.ToString()); #endregion } }