Search results

Hyperlink

Pivot Grid allows you to show hyperlink option to the link data for individual cells that display in the pivot grid. Also, the hyperlink can be enabled separately for row header, column header, value, and summary cells using the hyperlinkSettings. It can be configured through code behind, during initial rendering. The settings available to show hyperlink to the cells are:

  • showHyperlink: It allows to set the visibility of hyperlink in all cells.
  • showRowHeaderHyperlink: It allows to set the visibility of hyperlink in row headers.
  • showColumnHeaderHyperlink: It allows to set the visibility of hyperlink in column headers.
  • showValueCellHyperlink: It allows to set the visibility of hyperlink in value cells.
  • showSummaryCellHyperlink: It allows to set the visibility of hyperlink in summary cells.
  • headerText: It allows to set the visibility of hyperlink based on header text.
  • conditionalSettings: It allows to set the visibility of hyperlink based on specific condition.

By default, the hyperlink options are disabled for all cells in the pivot grid.

The Pivot Grid has an option to show hyperlink option to all the cells that are currently displaying. To show hyperlink option, you need to set showHyperlink to true.

razor
AllCells.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
 .Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { showHyperlink =true }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    return View();
}

The Pivot Grid has an option to show hyperlink option to row header cells that are currently displaying. To show hyperlink option for row headers alone, you need to set showRowHeaderHyperlink to true.

razor
RowHeader.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
 .Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { showRowHeaderHyperlink =true }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    return View();
}

The Pivot Grid has an option to show hyperlink option to columns header cells that are currently displaying. To show hyperlink option for column headers alone, you need to set showColumnHeaderHyperlink to true.

razor
ColumnHeader.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
 .Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { showColumnHeaderHyperlink =true }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    return View();
}

The Pivot Grid has an option to show hyperlink option to value cells that are currently displaying. To show hyperlink option for values alone, you need to set showValueCellHyperlink to true.

razor
ValueCells.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
.DrilledMembers(drilledmembers =>
{
    drilledmembers.Name("Country").Items(ViewBag.countryMembers).Add(); drilledmembers.Name("Year").Items(ViewBag.yearMembers).Add();
}).Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { showValueCellHyperlink =true }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    ViewBag.yearMembers = new string[] { "FY 2015" };
    ViewBag.countryMembers = new string[] { "France" };
    return View();
}

The Pivot Grid has an option to show hyperlink option to summary value cells that are currently displaying. To show hyperlink option for summary values alone, you need to set showSummaryCellHyperlink to true.

razor
SummaryCells.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
.DrilledMembers(drilledmembers =>
{
    drilledmembers.Name("Country").Items(ViewBag.countryMembers).Add(); drilledmembers.Name("Year").Items(ViewBag.yearMembers).Add();
}).Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { showSummaryCellHyperlink =true }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    ViewBag.yearMembers = new string[] { "FY 2015" };
    ViewBag.countryMembers = new string[] { "France" };
    return View();
}

The Pivot Grid has an option to show hyperlink option to the cells based on specific conditions. It can be configured using the conditionalSettings option through code behind, during initial rendering. The settings required to sort are:

  • measure: Specifies the value field name to get visibility of hyperlink option for specific measure.
  • condition: Specifies the operator type such as equals, greater than, less than, etc.
  • value1: Specifies the start value.
  • value2: Specifies the end value.
razor
Conditions.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
.DrilledMembers(drilledmembers =>
{
    drilledmembers.Name("Country").Items(ViewBag.countryMembers).Add(); drilledmembers.Name("Year").Items(ViewBag.yearMembers).Add();
}).Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings(hyperlinksettings => hyperlinksettings
 .ConditionalSettings( format =>
{
    format.Conditions(Condition.Between).Measure("Units Sold").Value1(150).Value2(200).Add();
})).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    ViewBag.yearMembers = new string[] { "FY 2015" };
    ViewBag.countryMembers = new string[] { "France" };
    return View();
}

The Pivot Grid has an option to show hyperlink option to the cells based on specific row or column. It can be configured using the headerText option through code behind, during initial rendering.

razor
Headers.cs
@Html.EJS().PivotView("PivotGrid").Height(300).DataSource(dataSource => dataSource.Data((IEnumerable<object>)ViewBag.Data).ExpandAll(false)
.DrilledMembers(drilledmembers =>
{
    drilledmembers.Name("Country").Items(ViewBag.countryMembers).Add(); drilledmembers.Name("Year").Items(ViewBag.yearMembers).Add();
}).Rows(rows =>
 {
     rows.Name("Country").Add(); rows.Name("Products").Add();
 }).Columns(columns =>
 {
     columns.Name("Year").Caption("Production Year").Add(); columns.Name("Quarter").Add();
 }).Values(values =>
 {
     values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
 })).HyperlinkSettings( new PivotViewHyperLinkSettings { headerText= "FY 2015.Q1.Units Sold" }).Render()
public ActionResult Index()
{
    var data = GetPivotData();
    ViewBag.data = data;
    ViewBag.yearMembers = new string[] { "FY 2015" };
    ViewBag.countryMembers = new string[] { "France" };
    return View();
}

See Also