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     Stylesheet procedure to set a title as a hyperlink

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Stylesheet procedure to set a title as a hyperlink
 Login/Join
 
Member
posted
What I would like to accomplish is allowing the users to click on a column title and having the report re-sort by that column. Like many store-front sites where if you click on the price, you can change the sort from low to high or visa-versa.

I tried this internal stylesheet method...

TYPE=TITLE, COLUMN=N4, FOCEXEC=PGM(parms),$

Needless to say it did not work.

Maybe using external CSS?


Greg Umberger
CSX Transportation
WF 7.1 MF 7.2.8
 
Posts: 2 | Location: Jacksonville, Florida | Registered: April 16, 2003Report This Post
Expert
posted Hide Post
-DEFAULT &SORT = 'COUNTRY';

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
BY &SORT NOPRINT

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,FONT='ARIAL', SIZE=8, $
TYPE=TITLE, COLUMN=COUNTRY(*), FOCEXEC=SORTDEMO1(SORT='COUNTRY'),$
TYPE=TITLE, COLUMN=CAR(*), FOCEXEC=SORTDEMO1(SORT='CAR'),$
TYPE=TITLE, COLUMN=MODEL(*), FOCEXEC=SORTDEMO1(SORT='MODEL'),$
TYPE=TITLE, COLUMN=SALES(*), FOCEXEC=SORTDEMO1(SORT='SALES'),$
ENDSTYLE
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
Expert
posted Hide Post
A cool alternative: This alternates between ascending or descending depending on what the previous sort column was.

-DEFAULT &SORT     = 'COUNTRY';
-DEFAULT &PREVSORT = 'COUNTRY';
-DEFAULT &SORTDIR = 'LOWEST';

-SET &SORTDIR = IF &SORT EQ &PREVSORT AND &SORTDIR EQ 'LOWEST' THEN 'HIGHEST' ELSE 'LOWEST';

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
BY &SORTDIR &SORT NOPRINT

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,FONT='ARIAL', SIZE=8, $
TYPE=TITLE, COLUMN=COUNTRY(*), FOCEXEC=SORTDEMO1(SORT='COUNTRY' PREVSORT='&SORT' SORTDIR='&SORTDIR'),$
TYPE=TITLE, COLUMN=CAR(*), FOCEXEC=SORTDEMO1(SORT='CAR' PREVSORT='&SORT' SORTDIR='&SORTDIR'),$
TYPE=TITLE, COLUMN=MODEL(*), FOCEXEC=SORTDEMO1(SORT='MODEL' PREVSORT='&SORT' SORTDIR='&SORTDIR'),$
TYPE=TITLE, COLUMN=SALES(*), FOCEXEC=SORTDEMO1(SORT='SALES' PREVSORT='&SORT' SORTDIR='&SORTDIR'),$
ENDSTYLE
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
Expert
posted Hide Post
ohhhh, nice, Francis.
Greg, here's what i do.
-SET &FEXNAME     = 'thisfex';
-SET &DD0         = 'thisfex';
-DEFAULT &CARSORT = 'HIGHEST' ;
-SET &CARSORTX    = DECODE &CARSORT ('HIGHEST' 'LOWEST' 'LOWEST' 'HIGHEST');
TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
BY &CARSORT SALES NOPRINT
ON TABLE SET STYLE *
TYPE=TITLE,COLUMN=SALES,focexec=&DDO(CARSORT = '&CARSORTX'),$
END

then no matter what the last direction was, the next click flips the direction the other way.

Francis, explain to me why you put the (*) after the column name?

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
I tried the demo above from Francis and it is sweet. I removed the (*) after the column names and the behaviour was as follows:
Once you click a column, you can't click it again unless you click another column.


Using: WF 7.1.5, XP Pro, Tomcat, Self Serve
 
Posts: 81 | Location: Calgary, Alberta | Registered: August 07, 2003Report This Post
Expert
posted Hide Post
That's because the asterisk applies the style to all occurences of the field name. So, without the asterisk, when you click on COUNTRY you have PRINT COUNTRY ..... BY COUNTRY and WF does not know to which occurence to apply the style.

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 everyone for helping.

I had the resort part working good. Looks a lot like everyones suggestions.

I still was not able to get the stylesheet part to work. Must be some sort of installation problem.

I went ahead replaced the titles with a subhead and that is working fine.

Thanks again.


Greg Umberger
CSX Transportation
WF 7.1 MF 7.2.8
 
Posts: 2 | Location: Jacksonville, Florida | Registered: April 16, 2003Report This Post
Guru
posted Hide Post
What does the Sortdemo fex look like?


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Platinum Member
posted Hide Post
Does anyone know if there is a way to store the results so when resorting it does not have to run through the report again to retreive data.

The reason I ask is because we have some reports that take 1-2 minutes to run and having to resort is a pain sometimes, if I can somehow save that data into a hold file and roload from that everytime the user resorts it that would be ideal.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Expert
posted Hide Post
version 7, active reports, using active html.
extra charge, but sounds like just what you need. Call your local office




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Yeah we've had them in twice to demo it to us but my company doesnt want to upgrade just yet...so im stuck building my own solutions for now.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Gold member
posted Hide Post
We upgraded from 5.3 to 7.1 over the weekend and my column sorts stopped working. We originally had the FOCEXEC path name and the IBIF_ex='fexname' code in the column sort, but I changed the code to match what Francis and Susannah have, and they are now working again. (Thank you both!)

There is an exception of one report that uses a hold file that the column sorts are not working unless you click the refresh button first, then the column name. I need to do this everytime I want a new sort on a column.

I tried using the (*) but I get a "Bad Value in Stylesheet" error. I am not using a column name, but a column position (ex. P2) instead.

This report is also using the WebFOCUS Viewer with On Demand paging. I'm not sure if that is causing the wrinkle.

Any ideas?

Thanks,
Tim J
 
Posts: 57 | Registered: February 24, 2004Report This Post
Expert
posted Hide Post
I usually put this at the top of my program:


-*-- Set Random Variable (used to defeat browser cache) ----
-SET &RNDM = EDIT(HHMMSS('A8'),'99$99$99');


and this in my hyperlink:

TYPE=DATA, COLUMN=START_TMS,
FOCEXEC=FMEDAST2( \
START_DT=START_DT \
START_TM=START_TM \
ST_MS=ST_MS \
RNDM=&RNDM \
), $

The random number ensures that the hyperlink is different every time the fex is called.


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
Gold member
posted Hide Post
Would this be the proper use of your code? What I put in the program didn't seem to help. I also added the SET &RNDM line at the top.

TYPE=TITLE, COLUMN=P2, FOCEXEC=&DDO( \
START_DT=START_DT \
START_TM=START_TM \
ST_MS=ST_MS \
RNDM=&RNDM \
parmgrp= '&parmgrp' FORMAT = 'HTML' SORTFLD='E06' \
DIRECTION='&DIRECTION'), $
  
 
Posts: 57 | Registered: February 24, 2004Report This Post
Expert
posted Hide Post
Tim,

Sorry I wasn't clear in my last posting. You only need the &RNDM variable, not START_DT - that was there as an example. Your code should read:
TYPE=TITLE, COLUMN=P2, FOCEXEC=&DDO( \
RNDM=&RNDM \
parmgrp= '&parmgrp' FORMAT = 'HTML' SORTFLD='E06' \
DIRECTION='&DIRECTION'), $

Are you passing the correct value for &DIRECTION?

Is the sort field being passed correctly, is it always E06? Perhaps it should be P2. (By the way, the (*) in a stylesheet column name is required when you have the column mentioned multiple times in the TABLE request, P2 is there only once).


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
Expert
posted Hide Post
Revised version of the example:
-SET &ECHO=ALL;

-DEFAULT &SORT     = 'COUNTRY';
-DEFAULT &PREVSORT = 'COUNTRY';
-DEFAULT &SORTDIR = 'HIGEST';

-SET &RNDM = EDIT(HHMMSS('A8'),'99$99$99');

-SET &SORTDIR  = IF &SORT EQ &PREVSORT AND &SORTDIR EQ 'LOWEST' THEN 'HIGHEST' ELSE 'LOWEST';
-SET &DIRCOLOR = IF &SORTDIR EQ 'LOWEST' THEN 'RED' ELSE 'GREEN';

SET PAGE = NOLEAD
-RUN

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
BY &SORTDIR &SORT NOPRINT

ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,FONT='ARIAL', SIZE=8, $

TYPE=TITLE, COLUMN=&SORT(2), COLOR=&DIRCOLOR, $

TYPE=TITLE, COLUMN=P1, FOCEXEC=SORTDEMO1( \
SORT='COUNTRY' \
PREVSORT='&SORT' \
SORTDIR='&SORTDIR' \
RNDM=&RNDM \
), $

TYPE=TITLE, COLUMN=P2, FOCEXEC=SORTDEMO1( \
SORT='CAR' \
PREVSORT='&SORT' \
SORTDIR='&SORTDIR' \
RNDM=&RNDM \
), $

TYPE=TITLE, COLUMN=P3, FOCEXEC=SORTDEMO1( \
SORT='MODEL' \
PREVSORT='&SORT' \
SORTDIR='&SORTDIR' \
RNDM=&RNDM \
), $

TYPE=TITLE, COLUMN=P4, FOCEXEC=SORTDEMO1( \
SORT='SALES' \
PREVSORT='&SORT' \
SORTDIR='&SORTDIR' \
RNDM=&RNDM \
), $

ENDSTYLE
END
-RUN


The column title being sorted changes colour depending on sort direction. You could of course, get fancier.


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
Expert
posted Hide Post
oooohhh. the color change idea is slick!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
I believe the correct value for &DIRECTION and the sort field are being passed correctly. I check the DIRECTION value at the top and reverse it based on HIGHEST and LOWEST. This process works on my report that doesn't use the webfocus viewer and doesn't use a hold file. It also worked before our upgrade this past weekend from 5.3 to 7.1

If I click a column title, the report doesn't change, yet if I click the browser refresh and then the column, it works?! I have to repeat this process to reverse the sort or to sort a different column. Strange.

I made the code changes you mentioned with the same results. I'll keep plugging away and contact IBI.

Thanks!
Tim J
 
Posts: 57 | Registered: February 24, 2004Report This Post
Gold member
posted Hide Post
I have my problem pinned down with the WebFOCUS Viewer in 7.1.4. If I take a report where my column sorts are working properly and activate the viewer, the sorts will not work unless the browser refresh button is clicked prior to any sorts.

These same column sorts worked fine in 5.3.3.
I have a case opened with IBI. I will share my findings.

Francis, I agree with Susannah, the column title changing colors, depending on sort direction, is pretty slick! I'll have to incorporate that in our reports!

Thanks,
Tim J
 
Posts: 57 | Registered: February 24, 2004Report This Post
Expert
posted Hide Post
Have you right-clicked the hyperlink to view it and determine if it is correct?


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
Gold member
posted Hide Post
Hyperlinks all look correct. The DIRECTION value is changing after each sort. The hyperlink looks the same before and after the browser refresh is clicked.
 
Posts: 57 | Registered: February 24, 2004Report This Post
Expert
posted Hide Post
The hyperlinks containg the random (time) variable?

One last thing, as a developer, my Internet Explorer settings are as follows:

Internet Explorer > Tools > Internet Options > Temporary Internet files > Settings > Check for newer versions of stored pages: Every visit to the page.

One more thing, you could change the default EXPIRE_REPORTS parameter:

WebFOCUS Admin Console (http://your-server-name/ibi_html/wfconsole.htm) > Configuration > General > EXPIRE_REPORTS: 1 (default is 300 seconds, although changing this would affect all reports, which may not be a good thing).
quote:
EXPIRE_REPORTS

The time when reports generated by the WebFOCUS Reporting Server are to be reexecuted. The expiration time is set in seconds, and the default setting is 300 seconds.

You can view a previously executed report on the browser without reexecuting its request. If the request for a report you are running is the same as the one executed previously (within 300 seconds), then the browser displays the previously executed report stored in the cache when you use the browser's Back, Reload, or Refresh button.

You can set EXPIRE_REPORTS in the following ways:

To ensure that the reports are reexecuted, set EXPIRE_REPORTS to 1 second.

To view the browser's cached output without using the browser's Back, Reload, or Refresh button, set EXPIRE_REPORTS to a large number, such as 4,000,000,000 seconds.


But it most likely is the Web Viewer, which I've almost never used.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Stylesheet procedure to set a title as a hyperlink

Copyright © 1996-2020 Information Builders