Save an analysis as a cockpit (HTML) (Profit Communication Center)

You can generate an analysis via the Profit Communication Center, using a commandline. Here, the output is saved locally (on your own PC or network). So you can save the analysis locally as an html page, just like publishing a cockpit in InSite. However, you can also perform other actions, such as exporting data to CSV. The latter is done a lot by partners and experts. The CSV can be used for external applications, or you can import it back into Profit via AFAS Remote.

Example:

You have created the Sales analysis in Profit.

Using the Profit Communication Center, you can publish this analysis as a cockpit to the location C:\Cockpits\Sales.htm every night. This means that you can immediately view this cockpit the next day.

Contents

Before you start

ou use the Profit Communication Centre on your own system or an application server and the cockpit is saved locally.

Preparations:

  • You must meet the system requirements of the PCC.
  • Install and configure the PCC

    Install the PCC on the system (the application server) you use for publishing the cockpit.

  • Install Microsoft Excel

    Install a supported version of Microsoft Excel on the system (the application server) that you use for publishing the cockpit.

Points of attention:

  • Microsoft Excel must be installed on the application server on which you run the commandline.
  • The Windows user starting the task must log in to the server and then lock the machine (Windows button + L). This is because the task must be ‘attended’.
  • If you use Windows Task Scheduler, the ‘Run only when user is logged on’ setting should be enabled.
Configuring, testing, linking the Profit Communication Center (PCC)

Via the commandline, you can run an automated macro of a Profit analysis. This is an automated version of manually running that analysis and starting the macro. First, make sure the manual process works.

Run manual process:

  1. Log in as the Windows user who will later run the scheduled commandline.
  2. Install the Profit Communication Center.

    Link the Profit Communication Center to the Profit environment that contains the analyse. Do this with the Profit user under whose data the analysis is to be automated later.

    No two-factor authentication applies to the user. The commandline invoking the analysis (via the PCC) uses the PCC's setting to retrieve the analysis from the Profit environment. When the analysis is retrieved via the commandline, the user does not need to log in (even periodically) via two-factor authentication.

  3. Log in to Profit or InSite and run the analysis.
  4. Open the analysis in Excel.

    Note:

    If this requires you to click away certain popups, this is a problem because an automated process will not do this. Notifications about Office or Windows activation or licensing, for example, should be resolved first. If you get notifications about enabling macros, adjust Excel's security settings.

  5. Test running the macro.

    From Excel, launch the ‘PublishAnalysisDirect’ macro and check that the desired action is performed. For example, saving a .csv file for an import or HTML files and an XML file for an InSite cockpit. If you get any messages when doing this, resolve them before automating this process further.

Customise analysis:

Any analysis to be published must contain the ‘PublishAnalysis’ macro. This macro publishes the analysis as an htm page. In this macro, you specify the name and file location for the htm page.

The ‘PublishAnalysis’ macro can also be used to publish a cockpit that can be accessed via an InSite site. So it may happen that the analysis as a macro contains ‘PublishAnalysis’ used for this purpose. You should not simply modify such a macro; always do so in consultation with the InSite administrator in the organisation.

Creating the macro ‘PublishAnalysis’ is described in Publishing cockpits for InSite.

Create batch file (.bat):

Add a batch file on the system on which Profit Communication Center is installed. If Profit Communication Center is installed on the default file location, use the following command line:

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="analysis name in Profit" /ENVIRONMENT="environment name"

For example: you want to publish the analysis ‘Sales’ from the environment O12345AA:

C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="Sales" /ENVIRONMENT="O12345AA"

administration filter

The commandline contains a field that allows you to filter by administration code.

Add the Administration field to the data set of the analysis.

Command line:

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="analysis name in Profit" /ENVIRONMENT="environment name" /UNIT="administration number"

Example:

You want to publish the analysis ‘Sales’ from the environment O12345AA for administration 1

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="Sales" /ENVIRONMENT="O12345AA" /UNIT="1"

Publishing the Social analysis

Use this commandline to publish the social analysis from Profit HRM.

Commandline:

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="name analysis in environment" /ENVIRONMENT="environment name" /HANDLER="socialeanalyse" /WERKGEVER="nummer" /PERIODETABEL="number of period tabel"

Example:

C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /HANDLER="socialeanalyse" /WERKGEVER="01" /PERIODETABEL="5"

Publishing the Occupancy analysis

Use this commandline to publish the occupancy analysis from Profit HRM.

Commandline:

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="analysis name in Profit" /ENVIRONMENT="environment name" /HANDLER="bezettingsanalyse" /VANDATUM="dd/mm/jjjj" /TOTDATUM="dd/mm/jjjj" /PERIODETABEL="numbeer of period table"

For dates, always use a forward slash (/), regardless of your system's regional settings.

Example:

"C:\Program Files (x86)\AFAS Software\Profit Communication Center\Profit communication center.exe" /PUBLISH="analysis name in Profit" /ENVIRONMENT="environment name" /HANDLER="bezettingsanalyse" /VANDATUM="01/01/2024" /TOTDATUM="07/01/2025" /PERIODETABEL="number of period tabel"

There are two parameters.

Hours per formation

/FORMATIE="TRUE"

Absenteeism based on calendar days

/KALENDER="TRUE"

Directly to

  1. Publish a cockpit (analysis) on InSite
  2. Publish a cockpit on InSite (AFAS Online)