Page 1 of 1

Differentiate between columns from rows in query

Posted: Mon Feb 22, 2021 10:02 pm
by Ron19855
 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

Re: Differentiate between columns from rows in query

Posted: Wed Feb 24, 2021 10:09 pm
by FJCC
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.

Re: Differentiate between columns from rows in query

Posted: Wed Feb 24, 2021 11:40 pm
by Ron19855
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.

Re: Differentiate between columns from rows in query

Posted: Thu Feb 25, 2021 12:44 am
by FJCC
You can get a table that has all of the rows where Record = 530 by writing a query like

Code: Select all

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?

Re: Differentiate between columns from rows in query

Posted: Fri Feb 26, 2021 9:17 am
by Mountaineer
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.