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:

  1. 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.
  2. OnDefineSummaryRows(ArrayListSummaryRows)—To expose the SummaryRows collection, of type BillboardSummaryRow, the collection of all summary rows in the billboard.
  3. 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

  1. Open the Billboard (configuration).
  2. Select the Data Set Editor tab.
  3. Select the Data node in the Data Tables field group.
  4. Set the Data Source Type to Script.
  5. If a billboard parameter is to be passed to the script, configure the billboard parameter.
  6. Enter the Database Connection.
  7. Click Edit Script.

    The Report Table Handler Script displays.

  8. 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;
        }
    }
  9. Edit the script as required.
  10. Click Save.