Reporting - Work around TextShape's automatic resizing

Hi there, I guess this one is geared towards the devs.
The "Text" shape will resize itself upon resizing the header/details section of a table, even if the section is not in "Structured Columns" mode.

I've found no way to disable this behavior.

Could it possible to subclass the Text shape (in a custom module) to avoid it?
I'm not sure if it's the Header or the shape itself that's handling the resizing.

Animation

Thanks in advance.

EDIT:
Very strange, I can get a text shape that won't resize itself if I do this:
Animation

Huh. Well, you're going to have a rough time doing anything about this as an end user. If it's really bugging you, you could probably adapt the technique here:

A typical text shape in an unstructured row looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<alist>
  <text x="219" y="144" width="196" height="34.776">
    <string>adsfadsfasdfasdfadfasdfasdfasdf</string>
  </text>
</alist>

A 'sticky' text shape after you set the row structured looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<alist>
  <text x="150" y="105" width="79" height="19.958" asize="--~,--~">
    <stroke type="border" />
    <string>asdfasdfadsf</string>
    <format type="date" pattern="MMM d, y" null-string="&lt;N/A&gt;" />
    <format type="number" pattern="#0.##" null-string="&lt;N/A&gt;" />
  </text>
</alist>

Note that asize="--~,--~" block. That's the critical bit. The autosizing parameter is defined elsewhere as:

Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).

So, uhh, yeah. If you really want it fixed anytime soon, you could borrow the technique I used in that other post to duplicate the text shape XML, add the auto size key you want, and put it back on the clipboard to be pasted back in.

I won't say that this isn't a bug, per se, but it's also just strange behavior, and I'll be honest, I doubt anyone else has ever noticed it to complain.

1 Like

Thank you Paul, I'll try your method.

The reason I want to do this is that including a SimpleTable in a Header will break exporting to Excel.