Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Report layout with columns

Questions related to using nuBuilder Forte.
Post Reply
nickrth
Posts: 28
Joined: Sun Aug 23, 2020 3:19 pm
Has thanked: 1 time
Been thanked: 1 time

Report layout with columns

Unread post by nickrth »

Hi there,

I've had so much fun building my nuBuilder system over the past few months and have found it exceptionally good and the online documentation and forum incredibly helpful. But I'm stumped on this one...

I have a report that lists a bunch of items, but the report is quite long so I'm wanting to condense it by presenting the data in two columns. I tried to add the field a second time in the Details group, hoping it would advance to the next record for each one, but alas it just repeats the same record.
report.jpg
Any ideas as to how I can get it to flow the data across two columns rather than just repeat the same record?

Thanks in advance.
You do not have the required permissions to view the files attached to this post.
steven
Posts: 370
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 53 times
Been thanked: 52 times

Re: Report layout with columns

Unread post by steven »

nicktrh,

The only way you can do it is by faking it by creating 2 fields in the database and putting half the records in each field.

The same goes for printing multiple labels.


Steven
A short post is a good post.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Report layout with columns

Unread post by apmuthu »

Can use a view that populates two fields - one with the odd ones and the other with the even ones....or using two fields with half the number of items in one and the others in the rest using a WHERE clause.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Report layout with columns

Unread post by apmuthu »

The SQL construct can be constructed like:

Code: Select all

CREATE TABLE `twocol` (
  `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Item` varchar(40) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `twocol`(`ID`,`Item`) VALUES
 (1,'Lettuce iceberg whole (1 whole piece)')
,(2,'Margarine (1000 gram gram tub)')
,(3,'Onions brown sliced (1000 gram bag)')
,(4,'Onions red sliced (500 gram bag)')
,(5,'Beetroot (850 gram can)')
,(6,'Salad dressing coleslaw (330 ml bottle)');

-- The actual query to get the alternate Items in different columns

SELECT a.Item AS Col1
     , b.Item AS Col2 
FROM `twocol` a LEFT JOIN `twocol`  b ON (a.ID = b.ID-1)
WHERE (a.ID%2);
You do not have the required permissions to view the files attached to this post.
nickrth
Posts: 28
Joined: Sun Aug 23, 2020 3:19 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Report layout with columns

Unread post by nickrth »

Many thanks. I'll try this approach.
Post Reply