Differentiate between columns from rows in query

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

Differentiate between columns from rows in query

Postby Ron19855 » Mon Feb 22, 2021 10:02 pm

 Edit: Moved from Writer forum to Reporting 
Hello,

I have a query that queries all the items belonging to a particular order number. I want to create a report that pulls data from this query and generates a receipt. Here is an example, note that Record/fullName and ITEM/PRICE are from different tables.

When I select multiple rows as-is, it prints each row to a different page. Is there a way to have all Items print as a list on the same page. Is there a method in which I can specify to print all ITEM columns where Record equals 530? If not, is there a way to concat ITEMS in the query so they all appear in one column in the query? Open to any method that could solve this problem. Any assistance will be greatly appreciated. Thank you. (Note: I am using MySQL as my database)

11.PNG
OpenOffice 4.1.6 - Windows 7 Ultimate
Ron19855
 
Posts: 10
Joined: Thu Dec 27, 2018 11:25 pm

Re: Differentiate between columns from rows in query

Postby FJCC » Wed Feb 24, 2021 10:09 pm

How are you transferring the information from the database to the Writer file? If I select some rows from the data source window by Ctrl + Clicking on the gray boxes at the left edge of the rows and then dragging the rows into a Writer document, I get a table.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8121
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Differentiate between columns from rows in query

Postby Ron19855 » Wed Feb 24, 2021 11:40 pm

I have the placeholders set beforehand. This makes it simpler because I don't have to make any changes to the formatting of my report. When I select print, the placeholder fields are automatically populated depending on the row in my table/query I select. Is there a way to maintain using this method but have multiple rows corresponding to the same primary key print on one page instead of a different page for each entry? You method of holding control is nice, but it less convenient then just selecting the record and having it populate.
OpenOffice 4.1.6 - Windows 7 Ultimate
Ron19855
 
Posts: 10
Joined: Thu Dec 27, 2018 11:25 pm

Re: Differentiate between columns from rows in query

Postby FJCC » Thu Feb 25, 2021 12:44 am

You can get a table that has all of the rows where Record = 530 by writing a query like
Code: Select all   Expand viewCollapse view
SELECT "fullName" AS "NAME, "ITEM", "PRICE" FROM "MyTABLE" WHERE "Record" = :ChooseRecord

Then dragging the whole query from the left hand listing of tables and queries into the Writer document. You will be prompted to pick the columns to insert and then asked for a value of ChooseRecord.
Will that work for you?
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8121
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Differentiate between columns from rows in query

Postby Mountaineer » Fri Feb 26, 2021 9:17 am

Ron19855 wrote:I have the placeholders set beforehand. This makes it simpler ...


In one of my reports i use a special field "next row" thst can be embedded in the writer-template using the connection like a serial letter.

If I repeat my setup of fields + "next row" 5 times on a page I get 5 rows of my database per page.

You may have to find out, how next-row is labeled, I did this some time ago in german language, so I don' know the english label.

J.
OpenOffice 3.1 on Windows Vista
Mountaineer
 
Posts: 67
Joined: Sun Sep 06, 2020 8:27 am


Return to Reporting

Who is online

Users browsing this forum: No registered users and 1 guest