Obtain Billboard Data Using a Script
You can use a script that is compiled inside MineMarket.
Parameters are passed to the script in a semicolon-delimited list.
There are three methods from the BillboardFormatterClass that are available for use in the script to format the data:
- OnDataLoad(DataTablePrimaryDt, DataTableFormatDt)—To get a handle to the primary data table (PrimaryDt) or format data table (FormatDt) both of type DataTable, used when formatting cells. Either PrimaryDT or FormatDt can be null.
- OnDefineSummaryRows(ArrayListSummaryRows)—To expose the SummaryRows collection, of type BillboardSummaryRow, the collection of all summary rows in the billboard.
- OnFormatCell(BillboardCell Cell)—This method is called as each BillboardCell, of type Cell, in a row is processed to allow the data recordset to be formatted according to the values of the data in the corresponding row of the format recordset.
Important: Do not change the pointers to the primary data recordset when formatting the primary data.
Security Note: You need the Allow billboard maintenance security right in the Billboards domain security rights group for this activity.
Activity Steps
- Open the Billboard (configuration).
- Select the Data Set Editor tab.
- Select the Data node in the Data Tables field group.
- Set the Data Source Type to Script.
- If a billboard parameter is to be passed to the script, configure the billboard parameter.
- Enter the Database Connection.
- Click Edit Script.
The Report Table Handler Script displays.
- Insert the following C# script code stub to add rows to the data table.Copy
using System;
using System.Data;
using Mincom.MineMarket.DAL;
using Mincom.MineMarket;
using System.Collections.Generic;
public class BTReportTableHandler : IBTReportTableHandler
{
public BTReportTableHandler() {}
/// <summary>
/// RunTable populates DataTable which is used to populate billboard table
/// </summary>
/// <param name="connections"> a list of connections to use for the script</param>
/// <param name="parameterValues">a list of parameters and values</param>
/// <returns>DataTable which contains all required data</returns>
public DataTable RunTable(BTReportConnectionList connections,Dictionary<BTReportParameter, object> parameterValues)
{
DataTable dataTable = new DataTable("Table");
...
return dataTable;
}
} - Edit the script as required.
- Click Save.