Expression _BookmarkLink; // (string) //An expression that evaluates to the ID of a //bookmark within the report to go to when this //report item is clicked on. //(If no bookmark with this ID is found, the link //will not be included in the report. If the //bookmark is hidden, the link will go to the start //of the page the bookmark is on. If multiple //bookmarks with this ID are found, the link will //go to the first one) // Constructor public Action(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p) { _Hyperlink = null; _Drillthrough = null; _BookmarkLink = null; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Hyperlink": _Hyperlink = new Expression(r, this, xNodeLoop, ExpressionType.URL); break; case "Drillthrough": _Drillthrough = new Drillthrough(r, this, xNodeLoop); break; case "BookmarkLink": _BookmarkLink = new Expression(r, this, xNodeLoop, ExpressionType.String); break; default: break; } } }
public void ActionDrillthroughTest1() { int id = 0; string reportName = "report"; IDrillthrough drillthrough = Drillthrough.Create(reportName, null); Action action = Action.CreateDrillthrouth(drillthrough, id); Assert.AreEqual(ActionType.DrillThrough, action.ActionType); Assert.IsNotNull(action.Drillthrough); Assert.AreEqual(reportName, action.Drillthrough.ReportName); Assert.AreEqual(id, action.ActionId); Assert.AreEqual(0, action.Drillthrough.NumberOfParameters); }
internal void ConstructActionDefinition() { ActionInstance instance = Instance; Global.Tracer.Assert(instance != null); if (instance.Label != null) { m_actionItemDef.Label = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateConstExpression(instance.Label); } else { m_actionItemDef.Label = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateEmptyExpression(); } m_label = null; if (BookmarkLink != null) { if (instance.BookmarkLink != null) { m_actionItemDef.BookmarkLink = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateConstExpression(instance.BookmarkLink); } else { m_actionItemDef.BookmarkLink = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateEmptyExpression(); } m_bookmark = null; } if (Hyperlink != null) { if (instance.HyperlinkText != null) { m_actionItemDef.HyperLinkURL = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateConstExpression(instance.HyperlinkText); } else { m_actionItemDef.HyperLinkURL = Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.CreateEmptyExpression(); } m_hyperlink = null; } if (Drillthrough != null) { Drillthrough.ConstructDrillthoughDefinition(); } }
public void ActionDrillthroughTest2() { const int id = 0; const string reportName = "report"; DrillthroughParameter[] parameters = new[] { new DrillthroughParameter("a", 1, false), new DrillthroughParameter("b", 2, false), }; IDrillthrough drillthrough = Drillthrough.Create(reportName, parameters); Action action = Action.CreateDrillthrouth(drillthrough, id); Assert.AreEqual(ActionType.DrillThrough, action.ActionType); Assert.IsNotNull(action.Drillthrough); Assert.AreEqual(reportName, action.Drillthrough.ReportName); Assert.AreEqual(id, action.ActionId); Assert.AreEqual(parameters.Length, action.Drillthrough.NumberOfParameters); }