[MSWordUtils] How to define the font/fontsize of a tablecell?

Forge Component
(2)
Published on 7 Aug by Stuart Harris
2 votes
Published on 7 Aug by Stuart Harris

Hi Stuart,

I have one more question.

Is it possible to define the font/fontsize/fontcolor of a tablecell?

If so, can you give me an example?


Thank you.

Kind regards,

Juliane

Hi Juliane,

No, not at this stage.  But it is possible with the underlying library so will come in the future, but not at the moment.  Let me have a look at it and see what I can do.

It would help to know the scenario you are implementing.  Also what other features you are looking for?

Kind regards,

Stuart

Solution

Hi Juliane,

I have published a new version (1.3.4) that allows table cells to specify the format of the text, including font family, font size, color and bold/italic/etc.

I hope this helps!

Kind regards,

Stuart

Solution

Hi Stuart,

sorry for the late reply.

I will try to describe what I implement.

I am developing a user interface for a profile DB. After completing various forms (e.g. training, projects, skills)  the user can print the profile.

The layout for printing is fixed, so I need the ability to define font,fontsize, color.

Currently I am using a template with different bookmarks. Also I add text in html format and different tables. The tables are created dynamically. Different tables are printed only if they have content.

Sorry for the bad English, it is not my native language.


Now I tried your new version, but the new features do not work for me:

- I have defined a "Format" with fontsize(11) and font("Arial")

- I have assigned the format to each table cell,

but the font und fontsize doesn't change.

Changing the font and fontsize of an MSWordText-Object works.

What am I doing wrong?


Kind regards,

Juliane 

Hi Juliane,

Please do not be concerned about your English (it is actually quite good!); apologies that my only language is English.

The sample generates an MSWord table with formatted text ok.

The possible issues I can imagine are that there is a way to use the extension where the formatting does not work, or that there is a bug in your code.

Could you share more detail of your implementation? Maybe create a test .oml file and share it?  You could post it here, or send a private message via the members tab.

In the meantime, I will have a walkthrough the extension code to see if there are any obvious ways the formatting might not be applied.

Kind regards,

Stuart

Hi Juliane,

I have run some tests on the latest published version.  I can get the formatting to apply as in the below image.

Please let me know if your code is doing something different.

Hi Stuart,

thank you very much for your effort. I have recreated your code (TestPrint.oml). It does not work for me:

Hope, you find my mistake.

Best regards,

Juliane

Hi Juliane,

You haven't made any mistakes.  It appears the code is running differently on my environment, as the document generates correctly when I run the same code.

This is very strange.  I will lodge a bug with OutSystems..

Also, I have some updates to deploy, maybe that will help.  It unlikely, but you could trying removing the forge component and installing it again.

Kind regards,

Stuart

Hi Stuart,

I removed the component und installed it again and ta-dah ... now it works:-)

Thank you very much.

Kind regards,

Juliane