LibreOffice Base - autofill textbox in a report

Hello.

I’m using LibreOffice 7.4.6.2 (x64) on Windows 10.

I have a question regarding designing reports in Base. I’d like to make a report, containing a price list for certain items. In some cases the item descriptions and prices are pretty far away and I’d like to fill this empty space with dots, connecting items with prices.

I managed to do that directly in the query, linked to the report:

CONCAT( [Barve_o], CONCAT( ’ ', REPEAT( ‘.’, 95 - LENGTH( [Barve_o] ) ) ) )

This works perfectly well in case of monospaced fonts. But if the fonts are not monospaced the lines are not nicely aligned on the right (see the attached picture).

Is there a way to add dots and autofill empty space between the description and the price that would produce alignment on the right also with other font types?

Many thanks in advance.
Brez naslova

RIght-click>Edit… the report.
Make sure that the properties window is visible (View>Properties…)
Click the text box and set the horizontal alignment.

You won’t get it working with Report Generator. You are looking for filling with dots like it is used in a table of contents. This will only work with tabulators, and these tabulators are not available in a textbox.

Exactly! I’d like to fill with dots like in a table of contents.

If tabs are not available in textbox, is it possible to perform this task in Writer once a report is generated?

I found the tab feature in Writer. When a text is written and tab button pressed the dots appear until the specified position.

I tried to do this on the report but when I press tab, instead of making dots, the cursor goes to the next textbox.

I’m thinking - if I arrange in the query that some special sign appears at the end of the item description, let’s say § sign, is there a way to replace this sign in Writer with TAB (^t) that would make those dots (I tried find/replace and it doesn’t work)? Or is there any way that I could make Writer to make these dots after the report is created?

Report is all created in table-rows and columns. If you set tabulators for such a paragraph you could tab by CTRL + Tab.

1 Like

That works! We’re so close now.

Here’s what I did:

  1. pressed ctrl+A untl the whole table is highlited
  2. set tabs
  3. clicked in the individual cell and did ctrl+tab, then the dots appeared

The last step would be to automate the process because the table is pretty large and it would take a lot of time to ctrl+tab each cell individually.

How can this process be automated? I don’t want to ctr+tab all cells in the report, just the ones that contain descriptions. I could put a special sign at the end of description and then somehow replace this sign with ctr+tab effect. Can this be done with find/replace? If so - what should I enter under replace that would signify ctrl+tab combination?

I did it! Here’s how it goes:

  1. Add some random special sign at the end of the data where you’d like to have the dots in the query that is attached to the report, like:
    concat(“Barve_o”,’ {’)

  2. Record a macro in Writer where you find and replace this special sign (in our case {) with something else, let’s say X

  3. Edit the macro and find these lines:
    args1(11).Name = “SearchItem.SearchString”
    args1(11).Value = “{”
    args1(12).Name = “SearchItem.ReplaceString”
    args1(12).Value = “X”

and chage them to:

args1(11).Name = “SearchItem.SearchString”
args1(11).Value = “{”
args1(12).Name = “SearchItem.ReplaceString”
args1(12).Value = Tab(1)

And that’s it.

Many thanks for your help!
Brez naslova-delujoca

1 Like

Will see if I could put this to German Base Handbuch as a special tip!