Try our conversational search powered by Generative AI!

Quan Mai
Nov 2, 2018
  1849
(3 votes)

New reporting features [Beta]

Commerce 12.11, releasing earlier next week, comes with a new type of report: order summary, group by market, currency, and day, to give the site owners an overview of how well their site is performing:

You can now go to the CMS Admin view, which has a new scheduled job "Collect Report Data", which gather the order data and write them to the data warehouse. You then can access to <yoursitehost>/<yoursecretpath>/Commerce/Report#context=epi.commerce.report:///salesbydayreport to get the report by days.

What if you want write your own implementation

The default report generator uses the standard order abstraction APIs so it should work with any implementation. But if you want to have more control on how the data is generated, it is possible by implementing IReportDataGenerator

    public interface IReportDataGenerator
    {
        /// <summary>
        /// Generates line item report data.
        /// </summary>
        /// <param name="fromDate">The start date to generate lineitem reports for.</param>
        /// <param name="toDate">The end date to generate lineitem reports for.</param>
        /// <returns>A collection of line item report model.</returns>
        IEnumerable<LineItemStoreModel> GenerateLineItemReportData(DateTime fromDate, DateTime toDate);

        /// <summary>
        /// Generates order report data.
        /// </summary>
        /// <param name="fromDate">The start date to generate order reports for.</param>
        /// <param name="toDate">The end date to generate order reports for.</param>
        /// <returns>A collection of order report model.</returns>
        IEnumerable<OrderStoreModel> GenerateOrderReportData(DateTime fromDate, DateTime toDate);
    }

which basically has two methods: one to generate line item report data and one to generate order report data for a specified period.

Then register it in one of your initialization modules.

Just give me performance

If you 

  • Are using the default implementation of order system (i.e. PurchaseOrder)
  • Want the fastest possible performance
  • ...without writing too much code yourself

then I have good news for you. We included a second implementation of IReportDataGenerator which takes advantages of internal implementation. If you want the fastest performance, then just add it to one of your initialization modules. For example, in QuickSilver SiteInitialization.ConfigureContainer:

services.AddSingleton<IReportDataGenerator, DirectAccessReportDataGenerator>();

The performance gain is reported between 8 to 15 times faster than the default implementation. But remember the limitations!

This is beta feature and the APIs are subjected to change without a major version, so please consider before using it for production. We also welcome all kind of feedback, bug reports and feature requests for the new repoting system. 

Nov 02, 2018

Comments

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog