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] Columns to Rows

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Columns to Rows
 Login/Join
 
Member
posted
I have the following requirement

Resultset will contain 15 columns. Always onlye one row of data

But these 15 columns should be displayed as following

Col1 Value Col6 Value
Col2 Value Col7 Value
Col3 Value Col8 Value
Col4 Value Col9 Value
Col5 Value Col10 Value


Col11 Value
Col12 Value
Col13 Value
Col14 Value
Col15 Value

I can using OVER and putting the data in HTMTABLE format and displaying them in TR and TD tages with HTMLFORM using
!IBI.FIL.HOLDFILENAME

But in order to support multi-version output like XLS CSV and PDF how can I avoid using HTMLFORM and HTMTABLE combination but get the same output.

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


WebFOCUS 7.6
Windows
Excel, HTML, PDF
 
Posts: 4 | Registered: March 06, 2009Report This Post
Expert
posted Hide Post
As it's only one row of data then I would suggest ON TABLE SAVE AS followed by -READing the values in and using them in a heading.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Thanks for your response.

As I need to format data COL1 VALUE1 COL2 VALUE2, essentially I have to start doing trail and error formatiing right?! Cant really get TR TD type of consistent formatting.


WebFOCUS 7.6
Windows
Excel, HTML, PDF
 
Posts: 4 | Registered: March 06, 2009Report This Post
Expert
posted Hide Post
If you want CSV and PDF output versions then there are no TD and TR tag pairings. Or did you not realise that?

T
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Could you concatenate the columns to be displayed next to each other inside a define and then just print them with the OVER?


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
 
Posts: 35 | Location: DFW Texas | Registered: May 30, 2008Report This Post
Member
posted Hide Post
TD and TR tags are not in CSV and PDF world for sure. I realize that. Probably I didnt phrase the statement correctly.

What I meant is that using the -READ and heading I will not be able to get a precise format in CSV PDF comparable to what I can achive using TR and TD for a HTML format.

I can do the column concatenation in a define and use OVER but to my knowledge I will not be able apply separate style to distinguish them as label and data.

Thanks for all your thoughts to this thread. Any further thoughts?


WebFOCUS 7.6
Windows
Excel, HTML, PDF
 
Posts: 4 | Registered: March 06, 2009Report This Post
Expert
posted Hide Post
You'll not achieve the format you get with HTML in CSV because the latter is a data format and not a display format, therefore you will not be able to use the HEADING idea for that as the HEADING is not retained.

Your answer lies in the history of Focal Point - all the posts and responses laid down since it's inception.

However, as search seems a little too much, think along these lines -

-* Try  each of these in turn
-SET &WFFMT = 'PDF';
-SET &WFFMT = 'CSV';
-SET &WFFMT = 'HTML';

TABLE FILE CAR
SUM COUNTRY NOPRINT
ACROSS COUNTRY
ON TABLE SAVE AS TEMPSAV1
END
-RUN

-READ TEMPSAV1 &Country1.A10. &Country2.A10. &Country3.A10. &Country4.A10. &Country5.A10.

-IF &WFFMT EQ 'CSV' THEN :Label01;

TABLE FILE GGSALES
BY REGION NOPRINT
HEADING
"Country1 <+0> &Country1 <+0> Country4 <+0> &Country4 "
"Country2 <+0> &Country2 <+0> Country5 <+0> &Country5 "
"Country3 <+0> &Country3 "
IF RECORDLIMIT EQ 1
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
-* Styling as per your needs
ENDSTYLE
END
-RUN

-EXIT

-:Label01
FILEDEF CSVOUT DISK CSVOUT.csv
-RUN
-WRITE CSVOUT Country1,&Country1.EVAL,Country4,&Country4.EVAL
-WRITE CSVOUT Country2,&Country2.EVAL,Country5,&Country5.EVAL
-WRITE CSVOUT Country3,&Country3.EVAL
-RUN

CMD TYPE CSVOUT.csv

All you have to do is exercise the little grey cells

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
OVER worked out well.

I used the following

COL1 AS 'COLUMN 1'
COL6 AS 'COLUMN 6' OVER
COL2 AS 'COLUMN 2'
COL7 AS 'COLUMN 7' OVER
COL3 AS 'COLUMN 3'
COL8 AS 'COLUMN 8' OVER
COL4 AS 'COLUMN 4'
COL9 AS 'COLUMN 9' OVER
COL5 AS 'COLUMN 5'
COL10 AS 'COLUMN 10' OVER

Thanks to all for your help.

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


WebFOCUS 7.6
Windows
Excel, HTML, PDF
 
Posts: 4 | Registered: March 06, 2009Report This Post
Expert
posted Hide Post
But OVER will not be retained when you save as a CSV file (FORMAT COM or COMT).

Or do you actually mean Excel format? (FORMAT EXL2K NOT EXCEL) - which will retain the structure of OVER.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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] Columns to Rows

Copyright © 1996-2020 Information Builders