Galaktikasoft

Changes and Improvements in Xafari 13.2.702

Processing floating-point numbers

Possibility to configure the decimal point character was added:
Possibility to process optional parameters 'separator between the integer part and fractional part of the number', 'date display template'.
To configure these parameters, it is necessary to set values in section Parameters in the import mapping settings file.

Example of the section:

SkipEmptyReferences
true

DecimalSeparator
.

DatePattern
dd/MM/yyyy

Database User Settings Store

Business operation customization events are divided by the business operation type:

Business operation customization events of BOExecViewController are accessible using indexed field BOExecViewController.BOEvents. The type of the business operation or the ID of the business operation can be used as the index. If the event processing subscription is made without the specification of the business operation, then the subscriber will receive messages on all business operations. Below is an example of making an event processing subscription in the code of the controller:

protected override void OnActivated()
{
    base.OnActivated();
    _boExecViewController = Frame.GetController();
    if (_boExecViewController != null)
    {
        // Subscription for processing the controller's events for specific business operations.
        _boExecViewController.BOEvents[typeof(CalcOrderTotalList)].BusinessOperationExecuting += CalcOrderTotalListExecuting;
        _boExecViewController.BOEvents[typeof(ReversibleOperation)].BusinessOperationCustomExecute += ReversibleOperationCustomExecute;
        _boExecViewController.BOEvents[typeof(ChangeFreightContext)].CreateCustomBusinessOperationInstance += CreateCustomChangeFreightContextInstance;
        // Subsription for processing the controller's events for all business operations.
        _boExecViewController.BOEvents.CustomizeResultViewParameters += CustomizeResultViewParameters;
    }
} 

Functions for generating hyperlinks for use in the Drill-Down reports have been added

Functions for generating hyperlinks based on ViewShortcut, which can be used in the Drill-Down reports, have been added to the platform (module Xafari). The function is accessible using the global instance of the hyperlink manager: Xafari.XafariUrlManager.Intsance.BuildUrl(ViewShortcut shortcut)
Currently hyperlinks can be generated only in the Web version of the application. For a correct generation of hyperlinks in the web-application it is necessary to add a key to section appSettings in the configuration file of the application:

<!— Base URL of the current application. It is configured in the course of rollout of the application. —>
The key must contain the base URL of the installed application. Then it will be possible to use the hyperlinks outside the context of the current active application. If the key is not specified, then relative hyperlinks, which can be used in the current application context only, will be generated. The short-cut for the ListView can include a criterion for selecting the application data. Methods extending class ViewShorcut have been developed to facilitate the generation of the hyperlink and the criterion:
  • BuildUrl() — it generates the URL based on an instance of ViewShortcut
  • SetCollectionSourceCriteria(CriteriaOperator criteria) — it specifies the criterion of the data source for the list view.
Also, class XafariViewShortcut (a descendant of the ViewShortcut) was developed for working with the described functions. In addition to constructors ViewShortcut, the class has additional constructors, which makes it possible to specify the criterion:
  • public XafariViewShortcut(String viewId, CriteriaOperator collectionSourceCriteria)
  • public XafariViewShortcut(Type objectClass, CriteriaOperator collectionSourceCriteria, String viewId) Example of generating a hyperlink in the script of the report:
using Xafari;
// Display the list form for specification of the current order.
private void OrderDetailsUrl_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e) 
{
    e.Value = string.Empty;
    var dataObject = e.Row;
    if (dataObject == null) return;
    var objectSpace = XPObjectSpace.FindObjectSpaceByObject(dataObject);
    if (objectSpace == null) return;
    var objectType = typeof(OrderDetails);
    var viewId = XafariModule.Application.GetListViewId(objectType);
    if (string.IsNullOrEmpty(viewId)) return;
    var criteria = CriteriaOperator.Parse("Order.Oid = ?", objectSpace.GetKeyValue(dataObject));
    // Creating the shortcut for the View
    var shortcut = new XafariViewShortcut(viewId, criteria); // Producing the hyperlink
    e.Value = shortcut.BuildUrl();
}

// Displaying the detail form for the current order.
private void OrderUrl_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e) 
{
    e.Value = string.Empty;
    var dataObject = e.Row;
    if (dataObject == null) return;
    var objectSpace = XPObjectSpace.FindObjectSpaceByObject(dataObject);
    if (objectSpace == null) return;
    var objectType = dataObject.GetType();
    var objectKey = objectSpace.GetKeyValueAsString(dataObject);
    if (String.IsNullOrEmpty(objectKey)) return;
    var viewId = XafariModule.Application.GetDetailViewId(objectType);
    if (string.IsNullOrEmpty(viewId)) return;// Creating the shortcut for the View
    var shortcut = new XafariViewShortcut(objectType, objectKey, viewId); 
    // Producing the hyperlink
    e.Value = shortcut.BuildUrl();
};

Electronic reports, a new type of Xafari reports, has been implemented

Generating reports as files in the required format (text files, xml, csv, etc.) for the presentation of various reports and documentation to other institutions in the electronic form (for example, by E-mail) is the intended use of the electronic reports. The functionality is implemented as modules:

Xafari.Reports.File
Xafari.Reports.File.Win
Xafari.Reports.File.Web
To create a report as a file, the application developer will describe a class (the generator) inherited from XafariFileReportGenerator<TDataSource, TParameters>, in addition to the basic Xafari reports infrastructure. In so doing, the data source class and the report parameter class are used as generic parameters. It is required to implement abstract method GenerateCore() in the generator class code. The method can create any number of data streams (method GetStream), to which the required report data are sent. It is necessary to register the developed generator class in the reports system by calling ObjectSpace.RegisterFileReportTemplate<TReport, TFileReportGenerator>();
The registration is performed in a method of class UpdateDatabaseAfterUpdateSchema(), which is an updater to the module in which the generator is implemented. Upon registration, the developed electronic report will appear in the template list for the report specified in the Xafari registration method. When the electronic report is executed, a zip-archive containing all data streams as files are loaded into the client's local machine, the file names match the names of the streams passed to method GetStream.
The name of the zip-archive is specified in field TemplateFileName of electronic report template ITemplateFileReport. ObjectFormatter is used when generating the file name for the archive. Fields Parameters and DataSource are available in the formatter, allowing to specify the report parameters and the data source for the report, respectively.

Excel reports of the Xafari reports system have been improved

Xafari.Reports.Excel
Xafari.Reports.Excel.Web
Xafari.Reports.Excel.Win
Xafari.Excel.Template
Xafari.Excel.Template.Win

In the Web-version of the application, by default, the report templates are stored in folder ~App_DataExcelTemplates of the web-server, also folder ~App_DataExcelReports must exist in the webserver and must be accessible for writing.
To change the path to the default folders, you need to redefine controller WebExcelReportExecuterController in the application, with redefined methods CreateReport and PreviewReport, with properly configured fields ExcelReportsPath and ExcelTemplatesPath for the instance of class WebExcelReportExecuter.

Actions 'Report types' and 'Report list' have been moved to category 'Hidden'

Actions 'Report types' (SimpleAction saListReport) and 'Report list' (SimpleAction saListParameters) have been moved to category 'Hidden'. It means that they do not appear in the application toolbar by default. If you want to display these actions in the application, then you need to add them in the form of ARM element 'action' or to move them to the required category by means of the model configuration. The specified actions are implemented in module Xafari.Reports.

New ARM element (ArmItemReport) has been implemented

A possibility to add a specific report to the ARMs has been added to the Xafari report system. A new ARM element type, ArmItemReport (Xafari Report), has been developed for this purpose. The functionality is implemented as a separate module Xafari.Reports.Arm.
The report is presented in the hierarchical form:

[Report] +- Edit…
+- Parameter set 1
+- Parameter set 2
where the report is the root node, and the child nodes represent the available sets of parameters for the respective report. In order to produce the report, it is necessary to select the required child node.
A view of the report configuration appears when node 'Edit' is selected.
If no parameter sets were specified for the report, then the report is represented by a root node only in the ARMs. When the node is selected, a view of the reports configuration appears.

The longtime operation logging mechanism has been redesigned

The logging of longtime operations is performed in a separate stream.

AdvancedBandedListEditor for the Win platform has been added

Common data

Logging

Exporting to an xml file using the Atlantis application format

Restriction of values in the list form

External module connection with subscription to events

Deserializing the mapping configuration

An error related to access to rights for the action was rectified

Additional improvements