As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I also understand, it might be achieve only through IF..ELSE..
DEFINE FILE TESTFINAL INSTRLEN/D4 = ARGLEN(50, TEST, 'D4'); DES/D12 = IF INSTRLEN EQ 2 THEN 3 ELSE IF INSTRLEN EQ 4 THEN 2 ELSE IF INSTRLEN EQ 6 THEN 1 ELSE 0 END
TABLE FILE TESTFINAL PRINT DES NOPRINT BY TEST ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=DATA,COLUMN=N1,JUSTIFY=LEFT,WHEN=DES EQ 3,$ TYPE=DATA,COLUMN=N1,JUSTIFY=CENTER,POSITION=1,WHEN=DES EQ 2,$ TYPE=DATA,COLUMN=N1,JUSTIFY=RIGHT,WHEN=DES EQ 1,$ ENDSTYLE END
[IMG:right]C:\Documents and Settings\a533060\Desktop\1.JPG[/IMG] I only can be able to align LEFT,RIGHT,(or)CENTER, but not to the desired position within a cell.
Any help me on this would be really appreciable.
Thanks, RifazThis message has been edited. Last edited by: Rifaz,
-Rifaz
WebFOCUS 7.7.x and 8.x
Posts: 406 | Location: India | Registered: June 13, 2013
Well, if you want to display those values with sort of indentation you can create an alpha string with as many spaces as needed for each entry. You'll have to come with that logic yourself as you understand your data although it seems that you somehow already figured out how what the indentation length might be for each row as calculated in the "DES/D12" field in your DEFINE block.
When producing your report, just SET SHOWBLANKS=ON so your indentation will be kept when producing the Excel file.
DEFINE FILE TESTFINAL
MAX_PADDING/A30 = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'; <-- Adjust as needed for the longest padding you may have
DES/D12 = IF <your_logic_here_to_determine_how_many_indentation_spaces_to_use>;
PADDING/A30 = SUBSTR(30, MAX_PADDING, 1, DES, DES, PADDING); <-- You'll have as many '@' as determined by 'DES'
PADDED_VALUE/A50 = PADDING || TEST; <-- Assuming TEST is the field that contains your numbered elements
IND_VALUE/A50 = STRREP (50, PADDED_VALUE, 1, '@', 1, ' ', 50, IND_VALUE);
END
SET SHOWBLANKS=ON
TABLE FILE TESTFINAL
PRINT
IND_VALUE
TEST
ON TABLE PCHOLD FORMAT EXL2K
END
I could not test the code above but it's intended to be just a concept for you to try. The expected functionality is this: let's say that for an entry such as "3.1.1.1" your indentation logic determines that it should be displayed starting in position 8. So after running the code above I expect the internal variables to look like this:
TEST -> '3.1.1.1.' <- this is what you read from the database
MAX_PADDING -> '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
DES/D12 -> 8 <- this is calculated somehow in your code
PADDING/A30 -> '@@@@@@@@ ' <- Sequence of 8 '@' chars
PADDED_VALUE -> '@@@@@@@@3.1.1.1. '
IND_VALUE -> ' 3.1.1.1. ' <- This is what will be displayed!!!
I din't realize we're gonna made it, at first.It almost going to satisfy my requirement.
As, I'm at home, don't have real data's to repro. However, i tried using CAR master for MODEL field.
The problem is in STRREP, though it replaces '@' with '' that appears in PADDED_VALUE field and again it starts displaying the IND_VALUE datas from left instead with blank spaces before every data as expected.
Please run this in your house.
SET SHOWBLANKS = ON; DEFINE FILE CAR MAX_PADDING/A30 = '@@@@@@@@@@@@@@@@@@'; INSTRLEN/I5 = ARGLEN(24, MODEL,INSTRLEN); DES/D12 = IF INSTRLEN EQ 3 THEN 1 ELSE IF INSTRLEN EQ 9 THEN 2 ELSE IF INSTRLEN EQ 11 THEN 3 ELSE IF INSTRLEN EQ 16 THEN 4 ELSE 7; PADDING/A30= SUBSTR(30, MAX_PADDING, 1, DES, DES, PADDING); PADDED_VALUE/A100 = PADDING || MODEL; IND_VALUE/A100 = STRREP (100, PADDED_VALUE, 1, '@',1,' ',100, IND_VALUE); END
TABLE FILE CAR PRINT MODEL INSTRLEN DES PADDING PADDED_VALUE IND_VALUE END
Correct me, if i'm wrong.
Thanks, Rifaz
-Rifaz
WebFOCUS 7.7.x and 8.x
Posts: 406 | Location: India | Registered: June 13, 2013