Strike through text

Hi Docentric team,
I am developing a report in docentric and one of my requests was to be able to strike through a line if a condition is meet. Unfortunatelly I havent been able to do that so far.
Could you kindly help?
Kind regards
Denisa

Hi Asimetaj,

Welcome to Docentric Forum and thank you for your question.

I prepared a sample template, where you can see how to conditionally strike through a quantity field if the quantity is less than 30. It’s a silly example, but you’ll be able to see how to do it. I used Sales confirm report for demonstrating it.

The end result looks like this (highlight is not part of the template formatting, I just added it to mark where the strike through is applied):

We cannot conditionally set just a strike through property, so we first need to enter Quantity field twice, one next to another, and the put each one of the under the IF tagging element, where we set expression when the IF tagging element returns true, in which case it’s content will be visible. This now means, that only one Quantity field will be shown and the other will be hidden. I also attached this template so you can download and open it and see how I implemented it.

Now we need to apply the strike through on that Quantity field where this effect is needed.

Note that if you are using Live Preview, you will not see this effect, because Live Preview doesn’t support it yet. But if you preview it in Word or PDF, you will see the effect.

Hello Albin,
thank you very much for your prompt response.
I tried what you suggested but once I reload the template in the system I receive an error log which says: Eror while reloading system templates.

image
And when I try to relaunch the report I receive the below error message:
“Template has invalid format. Make sure that the document is valid docentric template. File contains corrupted data. Failed to generate document”

image
The only change I did in the report was just to change the effects of the string and make it strikethrough

Could you please advice?
Kind regards
Denisa

Hi @Asimetaj_Asimetaj

The approach my colleague Albin suggested was aimed at editing the report template file in MS Word. To upload the adapted report template to environment there is no need to reload System templates as this is a custom template that you upload to one of the available storage options (Blob storage, Azure storage, SharePoint) on the Report itself. For the reference you can see how to upload a custom report template to the environment here: https://youtu.be/O3sIgrzVQjw?si=NN0agezGs6YEwkiM&t=1871

Regarding the Error message that Template has invalid format, please make sure that the template is created using MS Word with Docentric AX Add-in installed with the uploaded data-source file. If still in doubt, you can send us the template here, or if it contains sensitive data, you can send it via email to support@docentric.com.

Hi Albin and Semir,
Thank you a lot for your help.
The issue was happening apparently because of some cashes etc.
I managed to solve the issue by:

  1. Restarted IIS, SQL Server etc
  2. Full build the system.
  3. Cleared all usage data and now the report can be opened.
    Kind regards
    Denisa

@Asimetaj_Asimetaj ,

Thank you Denisa for letting us know and sharing that knowledge with the community. It is always great to hear that it is working.

Wishing you great rest of the day.
Semir

1 Like