table gridlines are allways visible

General TRichView support forum. Please post your questions here
Post Reply
a.weber
Posts: 58
Joined: Wed Mar 02, 2022 7:02 am

table gridlines are allways visible

Post by a.weber »

Hello,
loading a docx with a blind table -- all borders hidden in word - but in RichViewEdit the borders are visible als 1px black solid lines.
I have tried the following options but without luck:

Options - [rvoShowGridLines]
RTFReadProperties.AutoHideTableGridLines = true

I saved the docx as rtf and loaded this there it works - the gridlines are not visible. So I think it's a bug in loading docx?

with best regards
A. Weber
Sergey Tkachenko
Site Admin
Posts: 17254
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: table gridlines are allways visible

Post by Sergey Tkachenko »

There are two options for hiding grid lines.

The first option is rvoShowGridLines in RichView.Options. It works globally for all tables in RichView.
Note that changing this option does not repaint the current document, call RichView.FullInvalidate to repaint after including or excluding this option.
This option is for TRichView, not for documents, so it is not saved to and is not loaded from files.

The second option is rvtoHideGridLines in Table.Options. It works only for this table, and allows to hide grid lines in this table even if rvoShowGridLines is in RichView.Options.
Note that changing this option does not repaint the current document, call RichView.FullInvalidate to repaint after including or excluding this option
This option can be saved and loaded only in RVF format.
If you assign AutoHideTableGridLines = True, this option will be set for all tables loaded from RTF and DocX. But this option is not saved to and not loaded from RTF and DocX.

As for me, I do not recommend to use Table.Options for this purpose. I believe that RichView.Options is enough.
RichViewActions' TrvActionTableGrid changes rvoShowGridLines in RichView.Options, and cannot change a per-table option.
a.weber
Posts: 58
Joined: Wed Mar 02, 2022 7:02 am

Re: table gridlines are allways visible

Post by a.weber »

Hello,
There are two options for hiding grid lines.
I have tried both options - but none of them worked - I changed the options at designtime in Object inspektor - so FullInvalidate wouldn't change anything.
The problem is it depends from where I loaded the document - if I load it from "rtf" it works like expected. If i load it from "docx" the borders are allways visible as 1px black solid lines.

First try:
Options.rvoShowGridLines := true;
RTFReadProperties.AutoHideTableGridLindes := false;

Loaded from RTF:
table-rtf-ok.png
table-rtf-ok.png (25.09 KiB) Viewed 4034 times
it shows just the gray dotted line - like set in rvStyle component.

Loaded from DOCX:
table-docx-wrong.png
table-docx-wrong.png (25.17 KiB) Viewed 4034 times
it shows me a 1px black solid line

Second try
Options.rvoShowGridLines := false;
RTFReadProperties.AutoHideTableGridLindes := true;
Loaded from RTF:
table-rtf-ok2.png
table-rtf-ok2.png (22.93 KiB) Viewed 4034 times
like expected no borders visible.

Loaded from DOCX:
table-docx-wrong2.png
table-docx-wrong2.png (22.64 KiB) Viewed 4034 times
borders still there like in first try...
Attachments
sample.zip
Both files as rtf and docx
(38.22 KiB) Downloaded 211 times
Sergey Tkachenko
Site Admin
Posts: 17254
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: table gridlines are allways visible

Post by Sergey Tkachenko »

These options work only for displaying lines in place of hidden or zero-width table/cell borders.
It does not affect displaying visible borders.
I'll check what's wrong with these files in the next couple of days.
a.weber
Posts: 58
Joined: Wed Mar 02, 2022 7:02 am

Re: table gridlines are allways visible

Post by a.weber »

ok. thank you
Sergey Tkachenko
Site Admin
Posts: 17254
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: table gridlines are allways visible

Post by Sergey Tkachenko »

Well, there is a bug in DocX reading: table cell properties specified in table style (in this case, single border) are used instead of cell properties defined in the table itself (in this case, no borders).
It will be fixed in the next update. Let me know if you need this fix urgently.
a.weber
Posts: 58
Joined: Wed Mar 02, 2022 7:02 am

Re: table gridlines are allways visible

Post by a.weber »

Hello Sergey,
depends on your release schedule - if the next release is within the next three months it would be fine. So long we we can work with RTF instead of docx for our formated mails.

André
Sergey Tkachenko
Site Admin
Posts: 17254
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: table gridlines are allways visible

Post by Sergey Tkachenko »

I sent the fixed unit to you in a private message.
Post Reply