Page 1 of 1

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

PostPosted: Sat Apr 30, 2016 10:09 am
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.

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

PostPosted: Sat Apr 30, 2016 10:54 am
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   Expand viewCollapse view
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.

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

PostPosted: Mon May 02, 2016 12:12 pm
by mihmih
thank you very much, it works.

for future visitors: (comparison sign)

Code: Select all   Expand viewCollapse view
...ON "YourQuery."X">="Sequence"."X"