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:
- Right-click your report and select Design -> With The Saved Filter from the context menu.
- Click the affected chart in your Report.
- Click Scripts at the top-right in the Report Designer Ribbon.
- Select and copy the Script to Handle Grouping by Level in a Chart located below.
- Right-click within the scripting window within Report Designer and select Paste from the context menu.
- Click Validate from the Ribbon to connect the chart to the script.
- Click Designer at the top-right of the Report Designer Ribbon and save your Report.
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));
}
Related Articles
Gaugings Reports
Two reports have been designed for stream gauging data. These are the Gauging List report showing a selection of stream flow measurements and the Gauging Details report for an individual gauging, which provides a graphical representation of both the ...
Print Preview Reports
Reports can be viewed in a Print Preview window prior to saving, printing or exporting. When you view a Preview window, you will see your report populated with data and broken down into pages, as specified. When in the Preview mode, you can print out ...
Summary Reports
Several annual, monthly, daily and special summary reports come standard with DataSight and are a fixed type reporting solution. You can simply select the date ranges, levels and variables from your database and the type of summary (total, average ...
Reports in Saved Views
Reports saved to the Saved Views may be opened and edited using different filter conditions than those originally saved with the report. This allows you to design a standard template for your reports that you can apply to different sets of data. ...
Automatically Publish Reports
Automated publication of reports in a chosen format can be scheduled using a Saved Datasheet. From within the Tasks grid view, either double-click on a selected task row, or click on the Edit The Edit Tasks dialogue window appears. Choose the Saved ...