How to put different types of ‘records‘ into a table (RPG)
Posted: Thu Jun 21, 2012 4:07 pm
This is the simplest way to do this – there are much more elaborate things that can also be done.
A minor modification is made to the shipped RPG building block program DETAILER3 (see file QRPGLESRC in your LongRange project library or in library LRNG_PROJ) ........ it puts differently formatted data into Column2 and column 5 for odd and even lines:
This produces something like a 5250 multi-line subfile – but it’s a lot more flexible because only some records have extra lines ...
In a real application this would be something like
So that some records get 3 lines, some get 4 and some get 5.
You can also see carriage returns and small fonts being used in the shipped ‘Incidents’ demonstration application here ........ The date and time are separated by carriage returns and use a much smaller font.
See shipped RPG program DEMOINCI3 in source file LRNG_DEMO/SOURCEDEMO.
A minor modification is made to the shipped RPG building block program DETAILER3 (see file QRPGLESRC in your LongRange project library or in library LRNG_PROJ) ........ it puts differently formatted data into Column2 and column 5 for odd and even lines:
Code: Select all
// For COLUMN 2 alternate the content to make multi-lines in the display
If (Details.OddRow);
Details.Col2Value = 'BBBBBBBBBBBBB';
Else;
Details.Col2Value = 'XXXXXXXXXXXXXXXXX'
+ X'0D' + 'YYYYYYY'
+ X'0D' + '4848494948383';
Endif;
// Do the same with COLUMN 5 to show multiline date
If ( NOT(Details.OddRow) );
Details.Col5Value = 'EEEEEEEEEEEEE';
Else;
Details.Col5Value = 'QQQQQQQQQQQQQQQQQQQ'
+ X'0D' + 'TTTTTTT'
+ X'0D' + '(02)-748489474';
Endif;
In a real application this would be something like
Code: Select all
Details.IdentityCol = %trimr(NAME)
+ X'0D' + %trimr(ADDRESS1)
+ X'0D' + %trimr(ADDRESS2);
If (PHONEBUS <> ‘ ‘);
Details.IdentityCol += X'0D' + ‘Business Phone : ’+ %trimr(PHONEBUS);
Endif;
If (PHONEHOME <> ‘ ‘);
Details.IdentityCol += X'0D' + ‘Home Phone : ’+ %trimr(PHONEHOME);
EndifYou can also see carriage returns and small fonts being used in the shipped ‘Incidents’ demonstration application here ........ The date and time are separated by carriage returns and use a much smaller font.
See shipped RPG program DEMOINCI3 in source file LRNG_DEMO/SOURCEDEMO.