Graphical Report with Multiple Sites

Graphical Report with Multiple Sites

In DataSight Version 3.2 and earlier, the built in reporting tool required a small amount of script to activate multiple graphing features. This topic provides the script and the information of how to implement the script in a Multi-graph report.

 

Build a Graphical Report with multiple sites

  1. Build your report. You may use Report Wizard to do this.
  2. Once your report has been built, view it in Report Designer.
  3. Create a Band 'GroupFooter' and then place a chart there (See Report Designer Bands for more details). The type of data elected for the chart should be Numeric as chart can only draw numeric data.
  4. After creating the band and the chart, click on Scripts in the Report ribbon and place the following script lines in the window (This script has been developed to group by Level Name):

 

private void chart1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {

    XRChart xrc = (XRChart)sender;

 

    // Gets the current value of the grouping field.

    // For the master-detail report, use DetailBand.GetCurrentColumnValue in the detail band instead.

    string filter_value = GetCurrentColumnValue("LEVELNAME").ToString();

 

    // Clears the filters that may have been set earlier.

    xrc.Series[0].DataFilters.Clear();

 

    // Creates and adds a new filter to the "TheGroupingField" data field 

    // that has the type System.String.

    // The condition is that the data value equals the filter_value parameter.

    xrc.Series[0].DataFilters.Add(new DataFilter("LEVELNAME", "System.String",

        DataFilterCondition.Equal, filter_value));

}

 

  1. Click Validate to connect the chart to the script.
  2. Select the chart you are working on from the first drop-down list.
  3. Once you have selected your chart, select Before Print in the second drop-down list. Then Validate the script.
  4. Return to your Design view by unselecting Scripts on the Report ribbon.