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     Dynamic Column Sizing per Row

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dynamic Column Sizing per Row
 Login/Join
 
Member
posted
Is there a way to take each row returned from a dataset and have each individual row have cells/columns with different widths and styles?

For example:
I would like the output to look something like the following.

  
TABLE FILE CAR
BY COUNTRY NOPRINT
ON COUNTRY SUBFOOT
"<CAR <MODEL<56><BODYTYPE <DEALER_COST"

ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLESHEET *
FONT='ARIAL', SIZE=8, GRID=OFF,$
TYPE=SUBFOOT,ITEM=1,STYLE=BOLD,$
TYPE=SUBFOOT,ITEM=4,STYLE=BOLD,$
END


In the example above the format I am trying to obtain for each data value is correct, but I of course have blank lines displayed above the subfoot as it is expecting a data element to be printed in that location.

Problem Example:

Data:
COLUMN1 COLUMN2 COLUMN3 COLUMN4 REPORTKY
Name: Some Name Address Some Address 1
Company: Some Company Something: Some Value 1

The data above will be pulled based on the REPORTKY. I will know nothing about the size of each value in the columns except that COLUMN1 and COLUMN3 should be BOLD and COLUMN3 should start at a certain position on the line. I will also not know how many rows each set of data will return based on the REPORTKY passed in.

The output should look like the following:
Name: Some Name Address: Some Address
company: Some Company Something: Some Value

My desired about is PDF.

Any help is appreciated.


WF Release 7.1, Windows, PDF/Excel,HTML
 
Posts: 3 | Registered: February 22, 2008Report This Post
Master
posted Hide Post
You can change the styling of each "cell" based on the value of REPORTKY or any of the other data elements by using a WHEN clause. (I haven't tested this so you may have to change the syntax)

TYPE=DATA,
COLUMN=C1,
STYLE=NORMAL,
SIZE=9,
WHEN = C1 EQ 'Name',
$
TYPE=DATA,
COLUMN=C1,
STYLE=NORMAL,
SIZE=7,
WHEN = C1 EQ 'Company',
$
TYPE=DATA,
COLUMN=C1,
STYLE=BOLD,
SIZE=8,
WHEN = C1 EQ 'Salesperson',
$


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Pat,
Thanks for the reply. I am able to style each cell differently, but what I am trying to do is have each cell to be different widths such that I can make the value in each column Bold, etc, but make it seem as if the values of COLUMN1 and COLUMN2 are one value. As well as COLUMN3 and COLUMN4. To better represent my intent, I would do the following in HTML.

  
<TABLE>
// FOR EACH RETURNED ROW
<TR>
<TD>[b]COLUMN1 DATA[/b]COLUMN2 DATA</TD>
<TD>[b]COLUMN3 DATA[/b]COLUMN4 DATA</TD>
</TR>
// END FOR EACH RETURNED ROW
</TABLE>


I may be thinking about this incorrectly, and I am new to WebFOCUS.

I do have the flexibility of how the data is stored. So, I could store the data as.

COLUMN1 -> Name:
COLUMN2 -> Some Name
COLUMN3 -> Company:
COLUMN4 -> Some Company

or

COLUMN1 -> Name: Some Name
COLUMN2 -> Company: Some Company

The requirement is that the data is displayed as
"Name: Some Name___________Company: Some Company" (Name: would be Bold as well as Company:, The text Some Name would not be Bold, nor would Some Company)
"Address: Some Address_____Address2: Some Address 2" (Address: would be Bold as well as Address2Smiler

Note: The "_" is meant to only indicate alignment and not an actual print character.

Other items that play a factor:
1. Each line equals one row in the database, and the data is stored in separate columns in that row.
2. Conditional styling on the value in a column of a row returned I am not sure would work because I would not know the value being passed before report creation.

Also, I probably should not have named my data COLUMN#, but rather DATA# because each piece of data is not necessarily a single column in a tabular format.

Thanks.

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


WF Release 7.1, Windows, PDF/Excel,HTML
 
Posts: 3 | Registered: February 22, 2008Report This Post
Expert
posted Hide Post
Maybe it's the head cold I have that's making things murky, but I absolutely cannot figure out what you want to do!

A conventional WebFOCUS report is tabular, with rows and columns. You cannot make an individual cell in a column a different width from other cells in the same column.

"I would like the output to look something like the following." - You are not showing us an example of what you want your report to look like, you're presenting code.

Why not post a picture of what you're trying to achieve?

Regards,


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
P

In your initial question you end with saying this should be in PDF.
In the next reply you do several things with HTML.
That will not work, several html option won't work in pdf.

"Paint" your report in excel, create a snapshot/screen print and show it here. that would make things more clear.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Master
posted Hide Post
I sometimes have a tendancy to answer questions by asking question, hope you will forgive me for that, but not only do I need some clarification, I want you to think about what you really want to do. Are the titles, "Name", "Address" , "Company", etc really fields in the data? You also had a REPORTKY does that describe the content of that record and can you use it for styling that row? In the report are you asking if it is possible to have the data start in different positions for different rows? (When field1 is Name: and field2 is Any Name field2 would start in position 7 and when field1 is Address: and field2 is Any address field2 would start in position 10)? And still be able to style field 1 separate from field2?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Member
posted Hide Post
All,
Thank you for your replies. This is my first forum post and first report I have developed in WebFocus, and therefore I am not thoroughly familiar with all the terminology that may have made explaining my question more clearly.

I have finished the prototype that I was working on which is to have a report dynamically generated based solely on data. The report does not need to know anything about the data such as number of columns, field names, text justifications and other meta data prior to the report being ran. In addition the report can be made up of "multiple reports" on the same page or multiple pages making it a compound report.

Frank: In regards to the HTML I posted. I was hoping it would give an example of what I wanted the output to look like in terms of how it would be done in HTML. Sorry for the confusion.

Pat: To your last question, all titles, "Name", etc. is data stored in fields in the database. But the field names are generic such as Column1 to Column10.

I still don't know how to better explain what I was trying to accomplish, but here is the snippet from the report where I was able to get the outcome I was looking for.

I accomplished what I was trying to do by setting the DATA to size 1 and making the text color white. Also, by changing the border color and weight.

All the amper variables below are read from a master report table which defines each "report" that makes up a single compound report which is defined by the reportky in my earlier posts.

  
TABLE FILE REPORTTEMPLATEDTL
BY REPORTTEMPLATEDTLKY NOPRINT
WHERE REPORTTEMPLATEKY EQ &REPORTTEMPLATEKY

PRINT
FORMAT AS ROWFMT NOPRINT

-REPEAT REPEAT1 &COLS TIMES
-SET VAR = COLUMN || &COLCNT;

-* Dynamically get the read in attributes and set the column heading as the value from the master table
&VAR AS '&.&VAR'

-SET COLCNT = &COLCNT + 1;
-REPEAT1

-* This piece of code is only ran based on the style passed in by the master report table
-* I have removed logic that does not apply to this style to try and simply the code for display in this post
ON REPORTTEMPLATEDTLKY SUBFOOT
"<COLUMN1  <COLUMN2<58><COLUMN3  <COLUMN4"

ON TABLE SET PAGE-NUM NOPAGE
ON TABLE PCHOLD FORMAT PDF &COMPOUND
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
    UNITS=IN, PAGESIZE=A4, LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000,
    TOPMARGIN=0.0000000, BOTTOMMARGIN=0.000000,
	LEFTGAP=.13, RIGHTGAP=.13,
    ORIENTATION=PORTRAIT, GRID=&GRIDON, SQUEEZE=ON, SIZE=8, BORDER-COLOR=WHITE, BORDER=LIGHT,$
TYPE=DATA,SIZE=1,COLOR=WHITE,TOPGAP=0, BOTTOMGAP=0,$
TYPE=SUBFOOT,SIZE=8,TOPGAP=0, BOTTOMGAP=0,$
TYPE=SUBFOOT,ITEM=1,STYLE=BOLD,$
TYPE=SUBFOOT,ITEM=4,STYLE=BOLD,$
TYPE=TITLE,COLUMN=C*,BACKCOLOR=RGB(232 232 238),STYLE=BOLD,COLOR=RGB(0 0 0),$

ENDSTYLE
END


Thanks again, by searching through these forums I have found many of the answers to the other questions I had while developing this report. It is a great resource.


WF Release 7.1, Windows, PDF/Excel,HTML
 
Posts: 3 | Registered: February 22, 2008Report 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     Dynamic Column Sizing per Row

Copyright © 1996-2020 Information Builders