Dynamically set reportfield heights

I’ve searched the forum and I’ve seen this has been asked, but I didn’t find any solution or workaround…

In the report I am creating, I have a text field which sometimes has more than one line of text.

How do I show it when it has more than one line?

I managed to resize the control in the beforeprint event, but that’s not enough as the report body size doesn’t change and the any content beyond the first line is cut anyway.

Please enlighten me…

There is currently no way to have variable sized lines in the report. You either size the line so it can show multiple lines or you cut the text off. Autosizing has been a requested feature since the first version.

If you require something like that you’ll have to go with a 3rd party reporting tool like BKeeney Shorts, Valentina Reports, or create your own report via code.

The report designer needs a serious overhaul. Upvote if you feel this is important for Xojo as a product.

<https://xojo.com/issue/31102>

Well, there is a reason why we created Shorts. We needed it!

Agreed and Shorts is great. Fast and flexible. Xojo as a whole becomes a much more attractive product overall if it would improve the built in report tool however.

This output:

is from a Xojo Report. You can see that I have variable line heights for different products. You can download the project from here.

The trick is to manipulate the body band before it is printed. To that end I have a group on the product itself, and the manipulation is carried out in a before print event handler in that group, but the output is in the body. See the beforeprint event handler for label1 for further information.

alllllrrriiight… It took me a little while to get it straight… specially, I didn’t notice the need of ‘GroupByField’ parameter…

Thanks Wayne… I knew this HAD to be possible somehow… (not the most intuitive way, though)

Wayne,
I cannot seem to download the project, only get a page displayed that is unreadable. Can you please verify the link?

Thank you,
Tim

Hi Tim,

It is just a dropbox link https://dl.dropboxusercontent.com/u/18858366/Report%20Demo.xojo_binary_project.

If you’re still having problems pm me your email address & I’ll send it to you.

Cheers
Wayne

[quote=302167:@Tim Seyfarth]Wayne,
I cannot seem to download the project, only get a page displayed that is unreadable. Can you please verify the link?
Thank you,
Tim[/quote]
if you are on firefox like me, you need to right-clic the link and select “save the link as” to get the project.

Firefox - thanks Jean-Yves,

Wayne do you have any luck with reporting in web apps?
Tim

This project is really a demonstration of a concept. I recently had a requirement for a report where I needed to suppress the output of a band and worked out how to do that. Today I extrapolated that to variable band heights and knocked together the project. In production I would of course use graphics class options to calculate the heights of the columns and fiddle with spacing.

This is NOT ideal, it is a kludge, but it can work and I wanted to share that capability. The project also uses undocumented properties that don’t autocomplete which makes using them dangerous as they may not be available in future releases.

Ultimately you should be able to select a grow & shrink option on a report band, but in the short term adding before & after print events to bands would be great <https://xojo.com/issue/45968> and showing the bands in the navigator would help too <https://xojo.com/issue/45967>.

I’ve started a shared folder in feedback feedback://subscribe?folder_id=221 which has a password of Report, so would be an excellent place to collect these f/r’s.

In <https://xojo.com/issue/31102> Norman states that a catch all case is unlikely to be addressed, so more detail in individual cases is better.

Would be great if you could allocate points to a shared folder.

Tim I use wkHTMLtoPDF for none desktop reporting & sometimes for desktop too!

Thank you for the tips Wayne!
Tim

@Roman Varas can you please change the title of this conversation to perhaps “How to dynamically set report bands” or something like that. It should make it easier for others to find hopefully.

I guess there’s no need anymore for me to change the title. Thanks Wayne!!!