Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

RU 🇷🇺


Panel
bgColor#FFFFFF

In the Table Report, configure a list of records (fields) that will represent a number of columns containing the schedule data.

Tip

Use Table Reports to create and export a CSV file containing custom header names to match a specified format.

Table of Contents
minLevel1
maxLevel7

Adding Table Report

Table type reports can be added by choosing “Table Report” option from Add Report dropdown.

Once added, a blue icon with a table and the name “New Table Report” will appear in the list of reports. Rename it clearly.

Configuring Table Report

The Table Reports consists of two interconnecting tabs: Setup and Result. In the Setup tab you can add and give an export caption the Data Fields required to be displays in the Result tab.

  1. In the Data Field column add fields you want to report on.

    1. Use the dropdown menu provided in each row to find a field required, or

    2. Drag and drop fields available in the Fields panel.

  • Use the Search tool to simplify searching for the fields to be reported on.

  • Empty rows in the Data Field column are not critical, they will not be present in the Result and Export (unless have an Export Caption specified).

2. In the Export Caption column, edit the field captions to be displayed as Header names in the Result tab and in the exported report.

Tip

This feature distinguishes Table Reports from other types, and gives user the ability to export the report with custom column headings.

  • Export captions cannot duplicate, otherwise you’ll get an error message, preventing you from moving to the Result tab.

    • Rows containing duplicated names will be marked with a red circle, as shown below:

Applying filters to the Table Report

It is possible to apply a filter to a Table Report. The filter can be created in the code editor that appears when the “Use Filter” check box is toggled on.

Use simple “If” statement to specify what to include in the result, if a specified condition is true. See the examples below.

Available Formulas

Two formula helpers are located at the bottom of the editor, which assists in retrieving values used in the filter logic.

  • In the Available Formulas panel double click on TableFilterContextN or TableFilterContextT to configure and return the value in the current row as a number or text.

Note that for a report to present the correct data, the relevant data fields must be added to the Data Fields column at the bottom.

Filtering on Destination example

To filter on a specific destination, use the following sample code:

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using System.ComponentModel;
using Alastri.UI.Reports.Table;

public class MyTableFilter : ITableFilter
{
    public bool Include(in TableFilterContext context)
    {
        if(context.T("DestinationFullName").Equals("Stockpiles/HG1_ROM/WtAvg"))
        {
            return true;
        }
        return false;
    }
}

The code on the left will filter the destinations available by the specified name, ie, only “Stockpiles/HG1_ROM/WtAvg” will be included in the result.


Anchor
note
note
Note, that “Equals” will filter out any destinations that are not an exact match to the specified. If you don’t need such a narrow result, use the “Contains” operator, it will check if your specified string is part of the string you referenced to.

To make the filtering to be non case-sensitive, use the method StringComparison.OrdinalIgnoreCase next to the string name, for example:

if(context.T("SourceFullName").Equals("openPit/mine/pit1/stage1/790/1/790", StringComparison.OrdinalIgnoreCase))

Note, that it can only be used with “Equals” method, and will cause an error if using with “Contains”.


Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using System.ComponentModel;
using Alastri.UI.Reports.Table;

public class MyTableFilter : ITableFilter
{
    public bool Include(in TableFilterContext context)
    {
        if(context.T("DestinationFullName").Contains("Stockpiles"))
        {
            return true;
        }
        return false;
    }
}

The code on the left will filter the destinations available by any containing “Stockpiles” in the name.

Filtering on Source example

To filter on a specific source, use the following sample code:

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using System.ComponentModel;
using Alastri.UI.Reports.Table;

public class MyTableFilter : ITableFilter
{
    public bool Include(in TableFilterContext context)
    {
        if(context.T("SourceFullName").Equals("OpenPit/Mine/Pit1/Stage1/790/1/790"))
        {
        return true;
        }
        return false;
    }
}

The code on the left will filter the sources available by the specified name, ie, only “OpenPit/Mine/Pit1/Stage1/790/1/790” will be included in the result.

See the notes above.


Filtering on Agent example

To filter on a specific Agent/Agent type, use the following sample code:

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using System.ComponentModel;
using Alastri.UI.Reports.Table;

public class MyTableFilter : ITableFilter
{
    public bool Include(in TableFilterContext context)
    {
        if(context.T("AgentGroup").Equals("R9400"))
    {
        return true;
    }
    return false;
    }
}

The code on the left will filter the agents by the specified group, ie, only “R9400” will be included in the result.

See the notes above.


Filtering on Source AND Destination example

To filter on a specific Source and Destination, use “&&” logical operator, like shown in the sample code below:

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using System.ComponentModel;
using Alastri.UI.Reports.Table;

public class MyTableFilter : ITableFilter
{
    public bool Include(in TableFilterContext context)
    {
        if(context.T("DestinationFullName").Equals("Stockpiles/HG1_ROM/WtAvg") &&
            context.T("SourceFullName").Contains("OpenPit/Mine/Pit"))
        {
            return true;
        }
        return false;
    }
}

The code on the left will filter the sources and the destinations available by the specified names, ie, only transactions between “Stockpiles/HG1_ROM/WtAvg” and “OpenPit/Mine/Pit“ will be included in the result.

See the notes above.


  • Depending on your C# knowledge level, you might try to code more complex filtering.

    • For your reference, see below the list of most commonly used logical operators.

Expand
titleLogical operators

And

&&

If A is "true" and B is "true" and C is "true", then return "true", else return "false"

Or

||

If A is "true" or B is "true" or C is "true", then return "true", else return "false"

Equal to

==

If A is equal to B, return "true", else return "false"

Not equal to

!=

If A is not equal to B, return "true", else return "false"

Greater than

>

If A is greater than B, return "true", else return "false"

Greater than or equal to

>=

If A is greater than or equal to B, return "true", else return "false"

Less than

<

If A is less than B, return "true", else return "false"

Less than or equal to

<=

If A is less than or equal to B, return "true", else return "false"

Errors

Observe the error messages appearing dynamically in the Errors panel, if any. Resolve all the errors to proceed to the result.

Tip

Error messages are descriptive, they are pointing to the lines and columns containing errors. Please read the error messages carefully.

Check if the statement is correct by pressing the Compile button at the top left corner of the Script Editor.

If you made a mistake, the Compile Error window will pop up, showing row and column of an error with a short description of its type.

When the Errors panel is blank, and all data fields are mapped, proceed to the Result tab.

Export

Exporting

Export the generated report with your custom data fields and headers as a CSV file using the Export Selected button.