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     [SOLVED] Reduce space for dollar amount in the subhead

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Reduce space for dollar amount in the subhead
 Login/Join
 
Gold member
posted
I am trying to develop a freeform report and I am having difficulty in reducing the space for dollar amount.
For example:
[TABLE FILE CAR
SUM DEALER_COST NOPRINT
BY COUNTRY NOPRINT
SUBHEAD
"Total dealer cost
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,PAGESIZE='LETTER',$
-*TYPE=SUBHEAD,OBJECT=FIELD,ITEM=1,WRAP=0.5,$
ENDSTYLE
END
-EXIT
]
I can reduce the gap by specifying the width or wrap attribute.
My problem is the dollar amount could vary.
It could be in 1000's or millions.
Is there a way to remove the unnecessary space for dollar amount?
Please advice.

Thank you.

This message has been edited. Last edited by: ReddyP,


7.7.01,windows2008 R2
 
Posts: 65 | Registered: July 28, 2011Report This Post
Gold member
posted Hide Post
I place the column C1 after the sentence
"total dealer cost"
for some reason it is not getting pasted.


7.7.01,windows2008 R2
 
Posts: 65 | Registered: July 28, 2011Report This Post
Virtuoso
posted Hide Post
ReddyP, your code was not properly copied to the message. Please enclose it in [ code ] tags or just use the </> button in the message window.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
I assume that you still need the dollar amounts to be right justified? The only way I know of is via the WIDTH setting in the SUBHEAD section in Style Sheet.

Another alternative would be to DEFINE a field with a size big enough to host the biggest dollar amount you expect but if you're talking millions then you'll need a field that is at least D8 and that will still take up sufficient space to print.

WebFOCUS is doing the 'smart' thing by allocating enough space to guarantee that no matter which value you end up with, it will be appropriately printed.

Hmmm, if my understanding is correct, you want that field to be big enough to print the biggest value in your current report without leaving a big gap. But if you run it again with a different set of parameters and obtain different values for C1, then the gap should somehow readjust itself to those new values ... is that right?

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
ReddyP, this may work but it requires various steps:

1) Save your results in a HOLD file

2) Obtain the maximum dollar amount found in your results

3) Determine how many digits that max. dollar amount has and and attempt to calculate an appropriate WIDTH value enough to display your results without a big gap. You'll have to play with this until you get an expression that better reflects your environment. I'm posting something simple for illustration purposes.

4) Produce your report using UNITS=PTS (points) and setting your dollar amount's WIDTH in the SUBHEAD to the value calculated above.

-SET &FACTOR = 1;
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY

TABLE FILE CAR
SUM 
COMPUTE TOTAL_COST/D20 = DEALER_COST * &FACTOR;
BY COUNTRY
ON TABLE HOLD AS HVALUES
END

-* Get maximum value to be displayed
TABLE FILE HVALUES
SUM MAX.TOTAL_COST AS MAX_TOTAL_COST
ON TABLE HOLD AS HMAXVAL FORMAT ALPHA
END
-RUN

-READ HMAXVAL &MAX_VAL.A20.

-* Determine approximate WIDTH in points (PTS) needed for the field
-* *** You can come up with a fancier math expression here ... I'll play it safe for testing purposes.  
-* ****You have to consider also other factors such a font and size !!!!
-*

-SET &MAX_VAL = &MAX_VAL + 0;
-SET &MAX_DIGITS = &MAX_VAL.LENGTH;

-* Assume that about 9 points will be needed for each digit.
-* This does not account for comma separators so again, adjust accordingly!!!

-SET &MAX_WIDTH = &MAX_DIGITS * 9; 

-* Produce report
TABLE FILE HVALUES
SUM TOTAL_COST NOPRINT 
BY COUNTRY NOPRINT
SUBHEAD
"Total dealer cost <TOTAL_COST"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT,UNITS=PTS,PAGESIZE='LETTER',$
TYPE=SUBHEAD,OBJECT=FIELD,ITEM=1,WIDTH=&MAX_WIDTH,JUSTIFY=RIGHT,$
ENDSTYLE
END



Run the report as is first to see the output with 5-digit values.

Then adjust the code changing the multiplying factor at the top to increase your resulting dollar amounts (set it to 10, 100, 1000, etc.) and see how the WIDTH gets adjusted to make just enough space to print the value without leaving a "huge" gap.

Play with it and adjust it until you feel comfortable with the results. I hope this helps!

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
Thank you njsden for the nice example.
Yes, I wanted to right justify the number but somehow reduce the gap based on the number.
Yes, this would take care of the problem.

Thanks again.


7.7.01,windows2008 R2
 
Posts: 65 | Registered: July 28, 2011Report This Post
Virtuoso
posted Hide Post
You're very welcome ReddyP. I'm glad it helped. Would you mind editing your original post and prefixing its title with [SOLVED]?

Thanks!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
Done. Thank you.


7.7.01,windows2008 R2
 
Posts: 65 | Registered: July 28, 2011Report 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     [SOLVED] Reduce space for dollar amount in the subhead

Copyright © 1996-2020 Information Builders