[Solved] Print the same page x times (x from query)

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

[Solved] Print the same page x times (x from query)

Post by mihmih »

Hi,

i have a query:

product_1 | green | 3,5€ | 12
product_2 | green | 4,5€ | 1
product_3 | black | 5€ | 14
product_4 | white | 3€ | 5

and i want to print informations for each product x times (x pages looked the same). And value x is in the last column. Is it possible in Libreoffice Base/reports? Thanks for any help.
Last edited by mihmih on Mon May 02, 2016 12:39 pm, edited 1 time in total.
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: print the same page x times (x from query)

Post by Villeroy »

Easy method but a little bit clumsy:
Open a spreadsheet, create a sequence 1 to X where X is the max. number you expect.
Insert a field name on top of the column.
Copy the sequence (with field name) as a new table into your database. The field type should be integer.

Code: Select all

SELECT "YourQuery".* FROM "YourQuery" JOIN "Sequence" ON "YourQuery."X"<="Sequence"."X"
combines each record of "YourQuery" with all sequence values where the x number is smaller than or equal to the sequence.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Print the same page x times (x from query)

Post by mihmih »

thank you very much, it works.

for future visitors: (comparison sign)

Code: Select all

...ON "YourQuery."X">="Sequence"."X"
LibreOffice 4.2 on Windows7
Post Reply