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 InnerOpenReport(string cacheId, string viewId, string fileterFlag, string groupId, string rawtable, RuntimeFormat runtimeFormat, FilterArgs args, string crossId) { //加载报表的样式 ReportEngine reportEngine = new ReportEngine(_login, ReportStates.Browse, _datacontainer); string allcolumns = reportEngine.LoadFormat(cacheId, viewId, fileterFlag, groupId, null, rawtable, runtimeFormat); if (args != null) { if (!string.IsNullOrEmpty(allcolumns)) { //if (_context.Type == ReportType.IndicatorReport) if (string.IsNullOrEmpty(args.ClassName))// &&! _context.FilterArgs.bAutoSource ) { RowAuthFacade raf = new RowAuthFacade(); string rowauth = raf.GetRowAuthFromAllColumns(viewId, allcolumns, ClientReportContext.Login, true); args.Args.Add("RowAuthString", rowauth); } string[] columns = Regex.Split(allcolumns, "@;@");//allcolumns.Split(new char[] { '@', ';', '@' }); //if( _context.FilterArgs.Args.Contains( "DataAccordingGroup" ) ) //{ if (columns.Length > 1) { string[] items = columns[1].Split(','); for (int i = 0; i < items.Length; i++) { if (!string.IsNullOrEmpty(items[i])) { args.GroupItems.Add(items[i]); } } } if (columns.Length > 2) { string[] items = columns[2].Split(','); for (int i = 0; i < items.Length; i++) { if (!string.IsNullOrEmpty(items[i])) { args.SumItems.Add(items[i]); } } } //} args.DataSource.SelectString = string.IsNullOrEmpty(columns[0]) ? "" : columns[0]; } else { args.DataSource.SelectString = ""; } args.Args.Add("columns", args.DataSource.SelectString); } string colAuthString = GetColAuthString(viewId); //运行报表 reportEngine.CreateReport(true, args, null, null, null, rawtable, 0, colAuthString, ShowStyle.Normal, crossId, false); }
public void OpenStatic(object o) { StaticArgs e = o as StaticArgs; try { string allcolumns = _engine.GetStaticReportAllColumns(e.staticid); RowAuthFacade raf = new RowAuthFacade(); string rowauth = raf.GetRowAuthFromAllColumnsWithStaticID(e.staticid, allcolumns, ClientReportContext.Login, false); _engine.OpenStaticReport(e.eventfilter, e.uifilter, e.pageindex, e.showall, rowauth); } catch (Exception ex) { OnError(null, ex.Message); } }