private void FormOneReport( string key, DataRow dr, Hashtable sysInfos, Hashtable u861FormatRelated, Hashtable isUsingU861Format) { IReportNode rn = this.GetMyReportTreeNode( dr, u861FormatRelated, isUsingU861Format, ref key); if (this.IsAllOk(rn, sysInfos)) { object subsystemName = sysInfos[rn.SubID]; if (subsystemName != null) { rn.SubName = subsystemName.ToString(); } else { rn.SubName = rn.SubID; } this.SetStaticReportCustomName(rn); this._reportInfo[ReportCenterDataService.KeyAll].Add(rn); this._reportInfo[key].Add(rn); this._hashData[key][rn.SubID] = rn.SubName; } }
public virtual void Add(IReportNode child) { if (HasChildren && child != null) { if (child is ReportBag) { AddMany(child.Children); } else { Children.Add(child); } } }
private void SetStaticReportCustomName(IReportNode rn) { if (this._hashData.ContainsKey(ReportCenterDataService.KeyCustomStaticReportNames)) { Hashtable staticReportNames = this._hashData[ReportCenterDataService.KeyCustomStaticReportNames]; if (staticReportNames.ContainsKey(rn.ID)) { IReportCenterNode ircn = staticReportNames[rn.ID] as IReportCenterNode; if (!string.IsNullOrEmpty(ircn.Text)) { rn.Text = ircn.Text; } } } }
/// <summary> /// 报表是否可见 /// </summary> private bool IsAllOk(IReportNode rn, Hashtable sysInfos) { // 系统不启用不显示报表 if (!sysInfos.ContainsKey(rn.SubID)) { return(false); } // 非静态报表 Hashtable reportsWithAuth = this._hashData[ReportCenterDataService.KEY_ReportAuth]; DynamicReport dr = rn as DynamicReport; if (dr != null && this.CheckAuth4DynamicReport(dr)) { //有些系统报表必须在相关业务规则启用时才可见 if (dr.bSystem && !string.IsNullOrEmpty(dr.cMenuId) && !this._standardReportMenuRuleHandler.IsReportVisible(dr.cMenuId)) { return(false); } return(true); } // 静态报表,可能还不存在xml,因此字典不包含此关键字的哈希表 if (rn is StaticReport) { if (this._hashData.ContainsKey(ReportCenterDataService.KeyDeletedStaticReports)) { Hashtable deletedStaticReports = this._hashData[ReportCenterDataService.KeyDeletedStaticReports]; if (deletedStaticReports.ContainsKey(rn.ID)) { return(false); } } return(true); } return(false); }
private IReportNode GetMyReportTreeNode( DataRow dr, Hashtable u861FormatRelated, Hashtable isUsingU861Format, ref string key) { IReportNode im = null; if (key == ReportCenterDataService.KEY_StaticReport) { im = new StaticReport(this._iOpenReportCenterNode); } else { im = new DynamicReport(this._iOpenReportCenterNode); } (im as IFillData).FillData(dr); DynamicReport rep = im as DynamicReport; if (rep != null) { object val = null; //关于新老报表存在如下情形:(自定义报表都不能切换) //1.只存在老报表数据: // -a. bNewRpt=NULL则不允许切换,不允许发布,使用老报表打开 // -b. bNewRpt<>NULL则允许切换 // -b.1 bNewRpt=1 ->不允许发布,使用新报表打开 // -b.2 bNewRpt=0 ->不允许发布,使用老报表打开 //2.只存在新报表数据:不允许切换,允许发布,使用新报表打开 //3.新老报表数据同时存在: // -a. bNewRpt=NULL则按照1-a情形 // -b. bNewRpt<>NULL且bHadUpgradedFrom861=NULL ->不允许切换 // -a.1 bNewRpt=0 ->不允许发布,使用老报表打开 // -a.2 bNewRpt=1 ->允许发布,使用新报表打开 // -c. bNewRpt<>NULL且bHadUpgradedFrom861<>NULL // -a.1 bNewRpt=0 ->允许切换,不允许发布,使用老报表打开 // -a.2 bNewRpt=1 ->允许切换,使用新报表打开 // -a.1 bHadUpgradedFrom861=1则允许发布 // -a.1 bHadUpgradedFrom861=0则不允许发布 //CanUseAs861Report表示此报表能够进行切换 rep.CanUseAs861Report = false; if (this.ContainsKey(u861FormatRelated, rep, ref val)) { rep.CanUseAs861Report = true; } //IsUsing861Report表示当前报表使用老报表方式查询 //对应bNewRpt的值: //bNewRpt=0或null -> IsUsing861Report=true //bNewRpt=1 -> IsUsing861Report=false val = null; rep.IsUsing861Report = false; if (this.ContainsKey(isUsingU861Format, rep, ref val)) { rep.IsUsing861Report = !SqlHelper.GetBooleanFrom(val, false); } if (rep.bSystem) { key = ReportCenterDataService.KeySystem; } else { key = ReportCenterDataService.KeyCustom; } } return(im); }
public static IReportNode Key(string key, IReportNode value) => new ReportKey(key, value);
public ReportKey(string key, IReportNode value) : base(key, false) { Value = value; }
protected Maybe <IReportNode> Ok(IReportNode result) => new Maybe <IReportNode>(result);