Configuring and Activating Reporting

Applies to: Duet Enterprise for Microsoft SharePoint and SAP Server 2.0 | Office 2010 | SharePoint Server 2010

In this article
Configuring Reporting in a SharePoint Server Installation
Modifying and Importing the Report Template BDC Model
Activating Reporting in the Duet Sales Order Management Solution
Accessing Reports in the Duet Sales Order Management Solution
Next Steps

Duet Enterprise for Microsoft SharePoint and SAP enables users in SharePoint to request SAP reports and have them delivered to SharePoint document libraries. The Duet Sales Order Management solution can be easily adapted to take advantage of this functionality. In this topic you modify the solution so that the Duet Enterprise Reporting Feature is activated on the SharePoint site on which the solution will be deployed.

Configuring Reporting in a SharePoint Server Installation

To be able to request, run, and receive SAP reports in your SharePoint Server 2010 with Duet Enterprise, you or a SharePoint administrator must configure reporting on your server. For information about the requirements for reporting, see the topic on configuring reporting for Duet Enterprise in the TechNet Library. This topic covers the Features that should be activated at the site-collection level on your server. The Features related to reporting include the following:

  • Advanced Web Analytics

  • Disposition Approval Workflow

  • Duet Enterprise Reports Content Types

  • Library and Folder Based Retention

  • SharePoint Server Standard Site Collection Features

You or your SharePoint administrator must also ensure that your installation of SharePoint Server is configured to communicate with an SAP system. For more information, see the topic Configure secure communications between the SharePoint and SAP environments in the TechNet Library.

Modifying and Importing the Report Template BDC Model

If you or your SharePoint administrator has already configured SharePoint Server for reporting, the Report Template BDC model has likely been modified appropriately for your environment and imported into the Metadata Store on your server. This is one of the models included in a Duet Enterprise installation. The model must be updated appropriately for your environment before you import it into your SharePoint Server. In particular, you need to ensure that the WcfMexDocumentUrl property of the LobSystem element, and the SharePointResourceUrl and WcfEndPointAddress properties of the LobSystemInstance element are set appropriately based on your environment.

After the Report Template model is imported, you should be able to see the model in the Metadata Store on your system by clicking Manage service applications in Central Administration, selecting Business Data Connectivity Service, and then clicking Manage on the ribbon. The model defines an external content type called ReportTemplate in the SAP.Office.DuetEnterprise.Reporting namespace. (For more information, see the topic on Importing BDC models in the TechNet Library.)

Activating Reporting in the Duet Sales Order Management Solution

You can activate the Duet Enterprise Reporting Feature on the site to which you have deployed the Duet Sales Order Management solution by managing site Features on the site itself, but you can also add code to the solution to activate reporting when the website-level Feature of the solution itself is activated.

First, add a Reporting class to the Duet Sales Order Management solution.

To add a Reporting class to the solution

  1. In Solution Explorer, select the Customizations folder (created in an earlier topic in this walkthrough, Developing the Primary Components for the Solution).

  2. On the Project menu, click Add Class. The Add New Item dialog box appears with the class template already selected.

  3. Specify "Reporting.cs" as the name of the class file.

  4. Click Add. The file is added to the project and opened for editing.

  5. Replace the contents of the file with the following code.

    using System;
    using Microsoft.SharePoint;
    
    namespace DuetSalesOrderSolution.Customizations
    {
        class Reporting
        {
            //Identifier for the Duet Enterprise Reporting Feature.
            internal const string SAPReportingFeatureId = "B8C75454-5807-4edd-AEE8-8551302F4FE6";
    
            internal void Activate(SPWeb spWeb)
            {
                // Assuming here that the necessary Reporting Features are activated for the site collection.
                spWeb.Features.Add(new Guid(SAPReportingFeatureId), true);
            }
    
            internal void Deactivate(SPWeb spWeb)
            {
                spWeb.Features.Remove(new Guid(SAPReportingFeatureId));
            }
        }
    }
    
  6. Save the file.

This simple class includes methods to activate and deactivate the Duet Enterprise Reporting Feature on a specified website, using the unique identifier for the Feature.

Tip

You can obtain a list of unique identifiers for the Features on a SharePoint Server by executing the following Windows PowerShell cmdlet:

Get-SPFeature | Sort -Property DisplayName

The Duet Enterprise Reporting Feature appears as "SAPReporting" in the results returned by this cmdlet.

You now update the FeatureActivated method in the event receiver code for the website-level Feature of the solution to instantiate an object of the Reporting class and execute the Activate method of the class (when the Feature itself is activated on the site).

To update the FeatureActivated method

  1. In Solution Explorer, under the Features node, select the SalesOrderSiteFeature Feature.

  2. Press F7 to edit the event receiver code file (SalesOrderSiteFeature.EventReceiver.cs) for the Feature.

  3. Replace the FeatureActivated method in the file with the following updated code.

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        base.FeatureActivated(properties);
    
        SPWeb spWeb = (SPWeb)properties.Feature.Parent;
    
        // Create Currency list.
        CurrencyList currencyList = new CurrencyList();
        currencyList.Activate(spWeb);
    
        // Enable list customizations.
        ListCustomizations listCustomizations = new ListCustomizations(externalListTitles);
        listCustomizations.Activate(spWeb);
    
        // Enable reporting.
        Reporting reporting = new Reporting();
        reporting.Activate(spWeb);
    }
    

    The only change to this method is the addition of the code related to reporting.

  4. Save the file.

Accessing Reports in the Duet Sales Order Management Solution

After reporting has been enabled on the target SharePoint site where your solution is deployed, you should be able to click Report Settings in Quick Launch to see any available reports. (Report Settings itself is a SharePoint external list associated with the ReportTemplate external content type.) The list of reports available to you in the Duet Sales Order Management solution depends on the permissions of the account you are using and on the kinds of reports defined in the SAP system with which the ReportTemplate external content type is associated. Figure 1 shows some sample reports in the Report Settings list.

Figure 1. Report Settings external list

Report Settings external list

Depending on your credentials in the system, you may be able to run reports or view and edit the properties of reports using commands on the list item menu for a particular report. After you submit a request for a report (in this case by clicking Run Report on the list item menu for a given report), the request is routed to the SAP back-end system and delivered asynchronously to a Reports document library on your site, as shown in Figure 2.

Figure 2. Report from SAP system in Reports document library

Report from SAP system in Reports document library

Next Steps

Very little work needs to be done in the Duet Sales Order Management solution itself to be able to take advantage of the reporting capabilities that are already built into Duet Enterprise. One of the modifications you can make to the solution, as explained in this topic, is to ensure that reporting is enabled on your target SharePoint site by adding code to activate reporting when the website-level Feature of the solution is activated.

In the next topic, we look at techniques for debugging the solution and adding logging capabilities.

See Also

Concepts

Reporting in Duet Enterprise

Other Resources

Plan reporting for Duet Enterprise

Getting started with SAP reports in Duet Enterprise