Just recently I’ve been asked how to set up Print management to enable selection of different Free text invoice designs based on the information found in Financial dimensions. Print management setup doesn’t offer you dimensions data on the Invoice journal table, which is available on this setup by default. If I could find a way to set up the conditions in Print management for the Free text invoice report, I could easily select the appropriate design (in my case Docentric’s template), without any need to involve a developer. After some brainstorming with my colleagues, here’s what we came up with.
I will show you what it takes to set up the conditions in Print management so that it will select the design (aka template), based on the following rules:
- If the value of Financial dimensions – Business unit = 001 then use the blue template
- If the value of Financial dimensions – Business unit = 002 then use the red template
- In any other case, use the default black template
Step 1: Add additional Docentric templates
We will start from the existing Free text invoice template which is part of the Docentric SSRS Replicas model. Download it from Docentric report setup and modify the color of the document’s title to be blue instead of black. Repeat the process to create the template with the red title as well. In the end, we will have 3 template files: FreeTextInvoice.Report.docx, FreeTextInvoice_Blue.Report.docx and FreeTextInvoice_Red.Report.docx.
Now we have to add our two new templates for Free text invoice in Docentric report setup (the Templates tab > Add). Then we need to attach the corresponding template files (Templates > Template file > Attach) to each of the templates. I will use Azure storage for my two new customized templates.
Newly added Docentric templates for Free text invoice are now ready to use.
Step 2: Add conditions in Print management setup
From Docentric report setup we will now open Print management setup (SETTINGS > Print management) and expand Free text invoice, then right-click on the Original <Default> node and select New from the pop-up window to insert a new setting, where we will set the condition.
Fill in the Description field in SETTING IDENTIFICATION and click Select under CONDITION.
Unfortunately, we cannot set the criteria based on Financial dimensions, because they are not exposed on Customer invoice journal, the only available table by default.
If everything is done right, we should now see the joins in hierarchal order as shown below. Now we can click Range, select the Dimension code set table, select the BusinessUnit field and enter our criteria value: 001.
When we’re done, we should set up the print settings next, which will be used when the configured condition is fulfilled. Click Printer setup and on the Print destination settings form choose Docentric Screen as the target print destination, then select our blue template in the Template ID combobox.
Now repeat the whole process for the second setting and the red template. At the end, our Print management setup should look like this:
Note that Original <Default> setting has also been set to use Docentric Screen as the target print destination and Docentric default template, which is one with the black title.
Step 3: Test Print Management conditions with Financial dimensions
I have opened my Free text invoices and located two of them associated with Business unit 001 and 002: FTI-00000003 (Business unit 002) and FTI-00000004 (Business unit 001) in order to test my conditions in Print management setup. I selected them both and clicked DOCUMENT > View > Use print management to print them. The results were correct, as you can see in the image below:
Print management setup did exactly what we wanted – it selected the proper template in both cases.
On the other hand, if we select any free text invoice with Business unit that is not 001 or 002, the default template with the black title will be used to print the report.
Testing without Print management setup
If we, however, don’t use Print management, the default template will be applied. This happens when we run the report using Original preview or Copy preview. If you want to overcome this behavior, you will need to implement additional logic in your code. This feature, called Print management preview, is already on the Docentric roadmap for one of the future product releases.