Merlin Project: Base Costs Report as PDF

Merlin Project Support

We received following question recently:


I’m using the latest version of Merlin Project on a mac and have created a project file where I needed to insert various base costs. I know Merlin Project sums them into planned, expected or actual base costs, but my client requested a detailed Base Costs Report to be printed or read in Preview or Acrobat Reader. The report should list all Base Costs on my project and export their properties. Is this possible?

To meet the requirement described above, you may use an AppleScript solution we developed.

The script iterates all project activities, their assignments, attachments and resources, and extracts base costs on each item. When outputting corresponding properties, it writes an AsciiDoc text file onto the Desktop. Finally it calls Asciidoctor PDF to create a PDF using a customized stylesheet.

Installation of the Script

  • Download the following archive.
  • Expand the zip file.
  • Call in Finder menu Go > Home
  • Move here the folder res-for-script
  • Call in Merlin Project File > Actions > Show Scripts Folder.
Merlin Project - Show Scripts Folder
  • Open the folder called net.projectwizards.merlinproject
  • Move the script file called Create Base Costs Report.scpt into Merlin Project's Scripts Folder.
  • Double click the script Create Base Costs Report It will be opened in the Script Editor
  • Locate the row containing property pathToAsciidoctorPDF
  • Open a Terminal window and call command -v asciidoctor-pdf
  • Modify the pathToAsciidoctorPDF when appropriate

If you need to install asciidoctor-pdf follow the installation instructions and modify the pathToAsciidoctorPDF when appropriate.

Creating the Base Costs Report

Open any given project having base costs. Call the script Create Base Costs Report out of Merlin Project's File > Actions > … menu.

Wait for the script to create the AsciiDoc file and to call the PDF conversion using asciidoctor-pdf. It beeps when it's done. Both the AsciiDoc .adoc file and the created PDF will appear on the Desktop.

The tables output following Base Cost properties:
Title: the title of the base cost along with a symbol showing the class of the base cost holder
Planned Amount
Actual Amount: If set, this amount overwrites the Planned Amount
Type: possible values are gathered from the project settings value lists
Account: if set, the name of the account for this cost
Status: possible values are gathered from the project settings value lists
Added by: If set, a resource’s name
Billable: if set, √
Accrue: possible values prorated, at start, at end, immediately

Base Costs Report for the Demo Document

The customized colouring of the table for the header, font-size and alternating row background is defined by the included Asciidoctor-PDF YAML theme.

NOTE: The header option on the tables in the AsciiDoc file allows Asciidoctor-PDF to repeat the header row in case it needs to paginate the table on multiple pages.

The pagination of the table pages happens in the landscape orientation. The PDF starts thus with the title page in portrait, switching for the needs of the report into landscape and back again to portrait for the closing page.

Base Cost Report: Mixed Orientation of Pages

Feel free to open the .adoc file and modify it if need to convert the PDF in a second step using your own stylesheets. Should you want to use your own stylesheet for the PDF, simply place it into the res-for-script folder and rename the themeName property in the script accordingly.

Note To AppleScripts from ProjectWizards: You may incorporate this ProjectWizards sample code into your program(s) without restriction. This ProjectWizards sample code has been provided "AS IS" and the responsibility for its operation is yours. You are not permitted to redistribute this ProjectWizards sample code as "ProjectWizards sample code" after having made changes. If you're going to redistribute the code, we require that you make it clear that the code was descended from ProjectWizards sample code but that you've made changes.
To modify this or other AppleScript samples, please refer to the Scripting Merlin Project document. You'll find there various samples and code snippets ready to use.

Merlin Project sur Mac et iPad

Vos idées, notre magie – Réalisez vos projets en toute simplicité!
Essayez maintenant gratuitement pendant 30 jours.