Reported: May 16, 2019
Version(s) affected: DataSight 3.5 onwards
Issue: Reports created in Report Designer with embedded charts may not display correctly when the report is previewed, printed or exported. This is due to the implementation of scripting functionality within Report Designer (see the article Handle Events via Scripts for further information on using scripts in Reports).
Resolution: The below script can be used to correct the majority of Reports which are affected by this issue. If performing the below steps does not resolve this issue, please contact us for assistance.
To implement this script in your Report, perform the following steps:
Your Report should now preview, print and export with the chart displayed correctly.
Last Updated: May 16, 2019
Script to Handle Grouping by Level in a Chart
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));
}