Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] PDF - Placing numeric fields in Heading produces blank space in the output

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] PDF - Placing numeric fields in Heading produces blank space in the output
 Login/Join
 
Virtuoso
posted
I have a report that produces an executive summary in its heading, including the values of several fields from the report. I have a line that is supposed to look like this --

Statewide served were 83,615 and the prior week count was 84,069, decreasing by 454 customers


The problem is that it looks like this --

Statewide served were    83,615 and the prior week count was    84,069, decreasing by    454 customers


When I attempt to select the extra space with the mouse it indicates that it's not blank spaces that can be selected individually, but some strange part of the field that either gets selected as a whole or not at all. Due to the variable size of the fields involved I can't trim them very effectively.

Can anybody tell me what I'm looking at and if there is a way to mitigate the issue?

This is one big complicated summary report full of seriously critical information, packed with heavy-duty recaps, special headers and built-in comparisons to prior versions. But if I place it on the desk in front of someone the first thing they'll do is point at those blank spaces and tell me to remove them.

J.

This message has been edited. Last edited by: <Kathryn Henning>,



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
Two (pretty basic) approaches:

One approach:
1. Create an alpha field containing the numeric value as a character string (COMPUTE NOPRINT using FPRINT or FTOA or PTOA).
2. Left-justify the string (Another COMPUTE NOPRINT, using LJUST)
3. String together your fixed and variable text, using hard catenation to remove the trailing blanks.
4. Imbed that computed field in your heading.

Or, HOLD your data, capture those three counts in &vars (TABLE, READFILE); reformat and justify as desired (as another 3 &vars) ,
TRUNCATE the resulting &vars, and simply reference the &vars in the heading of the final TABLE request.

The first approach avoids Dialog Manager stuff, but requires you to convert your present heading:
"some text <first_counter> more text <second_counter> etc."

to
"<one_long_COMPUTED_field_encompassing_the_text_and_counters"


The second allow you to code the heading more naturally, as
"some text <+0>&first_counter<+0> more text <+0>&second_counter<+0> etc."

and allows you to break the line into multiple TEXT objects (by inserting spot markers as illustrated) to which individual styling can be applied.

----- edited 9/17/14: added code tags, reworded final section -----

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Here's one way:

TABLE FILE CAR
SUM
WHEELBASE
HEIGHT
WIDTH
COMPUTE RETAIL_COSTA/A14 = FTOA(TOT.RETAIL_COST, '(D10)', 'A14'); NOPRINT
COMPUTE DEALER_COSTA/A14 = FTOA(TOT.DEALER_COST, '(D10)', 'A14'); NOPRINT
COMPUTE SALESA/A14 = FTOA(TOT.SALES, '(D10)', 'A14'); NOPRINT

COMPUTE HEADING2/A200 =
'Statewide served were'         || (' ' | LJUST(14, RETAIL_COSTA, 'A14')) ||
' and the prior week count was' || (' ' | LJUST(14, DEALER_COSTA, 'A14')) ||
', decreasing by'               || (' ' | LJUST(14, SALESA      , 'A14')) || 
' customers'; NOPRINT

BY COUNTRY
BY CAR
BY MODEL

HEADING
"Car Test"
"<HEADING2"
" "
ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLE *
TYPE=REPORT, FONT=Arial, SIZE=8, ORIENTATION=LANDSCAPE, $
ENDSTYLE

ON TABLE SET PAGE NOPAGE
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Yeesh, I have 11 of these!

Amper-variables have their own issues with commas after them, and I've managed to trim the couple I have pretty well. The COMPUTE option is not pretty, but I may have to be it. It's a shame their isn't a better way to do this.

Of course it would help if functions like LJUST could figure out the length on their own instead of forcing you to enter all of them, but I'm not expecting that to change anytime soon.

Thanks gents.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
quote:
...Amper-variables have their own issues with commas after them...


Like what?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
I prefer the DM route. You can streamline the number-formatting code by embedding the FPRINT/FTOA and LJUST dirty work in a covering DEFINE FUNCTION.

The TRUNCATE will have to be separate -- it's not valid in DEFINE or COMPUTE (for obvious reasons).


As to commas: I though commas (like blanks and must punctuation -- quotes, parens, etc.) are recognized as delimiters for &var names; if not, toss in a vertical bar.

Bonne chance.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
This works but I can't put commas in the number --

   COMPUTE HEADING_LINE_7/A40V = 'week. Statewide served were ' | TRIMV('L', EDIT(TOT.ALL_SERVICES_COUNTER, '999999999'), 9, '0', 1, 'A9V') || ' test'; NOPRINT



For this field in particular it's an integer so FToA is out. If I put commas in the EDIT function's mask it turns the entire string into commas which is really weird.

Still working this.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
Try:
COMPUTE HEADING_LINE_7/A60V = 'week. Statewide served were ' | TRIMV('L', FPRINT(TOT.SALES, 'I9C','A12V'), 12, ' ', 1, 'A12V') || ' test'; NOPRINT


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
FPrint didn't seem to get along with Integer fields. I may need to convert to fixed point for my counter.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
Alright, this did the trick --

    COMPUTE ALL_SERVICES_COUNTER_F/F8 = TOT.ALL_SERVICES_COUNTER;
    COMPUTE HEADING_LINE_7/A120V = 'week. Statewide served were ' | TRIMV('L', FPRINT(ALL_SERVICES_COUNTER_F, 'I9C','A16V'), 16, ' ', 1, 'A9V') ||
                                  ' and the prior week count was ' | TRIMV('L', EDIT(FST.PRIOR_WEEK_ALL_SERVICES_COUNTER, '999999999'), 20, '0', 1, 'A9V') ||
                                  ', ' | TOTAL_INCREASING_OR_DECREASING | ' by ' | TRIMV('L', EDIT(TOTAL_SERVED_DIFFERENCE, '999999999'), 20, '0', 1, 'A9V') || ' customers'; NOPRINT



The first line converts the value to a fixed point, and then the FPRINT conversion in the actual text line finishes the job. Remarkably hard, but it works, and that's what really counts. Thank you all for tuning in, and thank you Alan for pointing me in the right direction.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
An update -- oddly enough, converting the second variable to work the same as the first throws a pdf paneling error. Exact same concept, but the report apparently is wider now and the conversion to PDF cannot happen due to my HEADALIGN command. This even occurs if I don't print HEADING_LINE_7 in the heading.

Never a dull moment, for some reason PDF now thinks the report is wider than it is. Close, but no cigar yet.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
1. When you mix || and |, all the spaces squeezed out by a series of ||'s is inserted before the first following |.

When you use | after strings where you wish to preserve the trailing space, parenthesize the phrase as: (operand | operand). That way all the internal spaces "removed" by the series of || can float to the end.

Like so:
COMPUTE HEADING_LINE_7/A120V = 
   ( 'week. Statewide served were ' | TRIMV('L', FPRINT(ALL_SERVICES_COUNTER_F, 'I9C','A16V'), 16, ' ', 1, 'A9V') ) 
|| ( ' and the prior week count was ' | TRIMV('L', EDIT(FST.PRIOR_WEEK_ALL_SERVICES_COUNTER, '999999999'), 20, '0', 1, 'A9V') )
|| ( ', ' | TOTAL_INCREASING_OR_DECREASING )
|| ( ' by ' | TRIMV('L', EDIT(TOTAL_SERVED_DIFFERENCE, '999999999'), 20, '0', 1, 'A9V') )
|| ' customers'; 


Possibly, the length of the computed /A120V will be set to the trimmed length of the content, and PDF will be able to preserve the "original" width.

2. In any event, 120 is more than you need. I think /A111V will do it.

3. What happens if you use FPRINT (rather than EDIT()) but suppress the commas (using: 'I9', 'A9V'). Does it still break?

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] PDF - Placing numeric fields in Heading produces blank space in the output

Copyright © 1996-2020 Information Builders