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

Getting your data onto paper - or the web - Discussing the reports features of Base

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

Postby mihmih » Sat Apr 30, 2016 10:09 am

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
mihmih
 
Posts: 83
Joined: Wed Feb 18, 2015 9:21 pm

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

Postby Villeroy » Sat Apr 30, 2016 10:54 am

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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24592
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby mihmih » Mon May 02, 2016 12:12 pm

thank you very much, it works.

for future visitors: (comparison sign)

Code: Select all   Expand viewCollapse view
...ON "YourQuery."X">="Sequence"."X"
LibreOffice 4.2 on Windows7
mihmih
 
Posts: 83
Joined: Wed Feb 18, 2015 9:21 pm


Return to Reporting

Who is online

Users browsing this forum: No registered users and 4 guests