Report layout with columns

Questions related to using nuBuilder Forte.

Report layout with columns

Unread postby nickrth » Sat Feb 13, 2021 8:40 am

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
report.jpg (45.02 KiB) Viewed 492 times

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.
nickrth
 
Posts: 19
Joined: Sun Aug 23, 2020 10:49 pm

Re: Report layout with columns

Unread postby steven » Mon Feb 15, 2021 6:22 am

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
steven
 
Posts: 138
Joined: Mon Jun 15, 2009 5:33 pm

Re: Report layout with columns

Unread postby apmuthu » Wed Feb 17, 2021 3:17 am

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: 250
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Re: Report layout with columns

Unread postby apmuthu » Wed Feb 17, 2021 3:33 am

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);
Attachments
two_cols.png
Output
two_cols.png (2.62 KiB) Viewed 460 times
apmuthu
 
Posts: 250
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Re: Report layout with columns

Unread postby nickrth » Fri Jun 04, 2021 9:41 pm

Many thanks. I'll try this approach.
nickrth
 
Posts: 19
Joined: Sun Aug 23, 2020 10:49 pm


Return to General

Who is online

Users browsing this forum: No registered users and 13 guests

cron