Ask Your Question

How can I group pages in a Base report by the first letter of a term? [closed]

asked 2012-07-21 13:44:12 +0200

britesc gravatar image

updated 2014-07-04 20:40:50 +0200

bencomp gravatar image

Hi, Could anyone please advise me as to whether it is possible to group by the first letter of an item name in a report? I have a db containing electronic parts and would like to create a catalogue but as I enter new stock items I have to print the whole catalogue each time? I would like to just print the section containing the new items. For example if I add a diode I would just like to print the D pages. Likewise a resistor just the R pages. What is the best way to go about making my catalogue and doing the updates? Thanks and kind regards, jB

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-27 12:06:38.426576

2 Answers

Sort by » oldest newest most voted

answered 2013-03-06 11:40:06 +0200

qubit gravatar image

Hi @britesc,

It sounds like you probably want to add a filter to your query so you can just select the pages that match "D*". I suggest that you start by taking a look at a getting started guide like this:

In SQL, you can select a set of records based on a partial-match on a field, for example:

SELECT * FROM parts WHERE part_name LIKE 'D%';
edit flag offensive delete link more


To further @qubit's answer you could use a parameter in your query so the letter would not be hard-coded, but entered each time, i.e. SELECT * FROM "parts" WHERE "part_name" LIKE UPPER(:letter) || '%'

w_whalley gravatar imagew_whalley ( 2013-03-06 18:02:10 +0200 )edit

answered 2014-01-06 00:31:56 +0200

bencomp gravatar image

Create a query in SQL mode and use the following query (adjust the table and column names):

SELECT LEFT( "table"."group_column", 1 ) AS "first", "table".* 
FROM "table" 
ORDER BY "first" ASC

In the above query, group_column is the column that you want to use the first letter of to create groups.

Create a report, choose the query you just created as the data source: set the report's Content Type to Query and pick your query from the dropdown list.

Open the Sorting and Grouping view and choose the first field as a group. In the Properties of the group header, you can play with the settings, but to start each group (i.e. each group of products starting with a new letter) on a new page so that you can selectively print certain pages of your catalogue, set Forge New Page to Before Section.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-07-21 13:44:12 +0200

Seen: 603 times

Last updated: Jul 04 '14