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] Loading columns into variables, possible?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Loading columns into variables, possible?
 Login/Join
 
Master
posted
I'm trying to build a html report, which isn't your standard out of the box InfoAssist type of report. I can do it, but I'm trying to be more efficient about it. This is an example of what it would look like:


I'm wanting the 3 values to be loaded from a single table only once, then use the values from that table to display here. However, the only way I can find to do it, is load the table 3 times, each pulling the value into a hold table, then display the hold table. Is there not a way to load values into variables with one retrieval?

This code obviously doesn't work, but it's a mock up of the requirement I need.

TABLE FILE CAR
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.COMP.CAR
WHERE CAR.COMP.CAR = 'BMW'
ON TABLE HOLD AS MYFILE FORMAT HTML
ON TABLE SET AUTOFIT ON
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
ENDSTYLE
END

-HTMLFORM BEGIN

<!DOCTYPE html>
<meta charset="UTF8">
<html lang="en">
<body>
	<table>
	<tr>
		<td>!IBI.FIL.MYFILE.CAR</TD>
	</tr>
	<tr>
		<td>!IBI.FIL.MYFILE.SALES</TD>
	</tr>
	</table>
</body>
</html>
-HTMLFORM END

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



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Look up Multi Verb Request - I think that should solve your problem.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
Also check out -READFILE syntax

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
Master
posted Hide Post
You can READ MYFILE once and assgin its value to 2 variables(&SALES, &CAR_CNT) and while displaying in HTMLFORM use
!IBI.AMP.SALES;
!IBI.AMP.CAR_CNT;

Hope this helps.

Thanks.
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Expert
posted Hide Post
quote:
WHERE CAR.COMP.CAR = 'BMW'

Be very careful when hand coding as the above might work now but it is not documented as being valid syntax and would not be guaranteed to work in future releases - which is one problem that a lot of people hit when upgrading!

As Ram states, you can also use -READ syntax to read the values from your hold file (which would need to be FORMAT ALPHA). You would also need to specify the lengths of the variables into which you place them.

The newer syntax of -READFILE does not require FORMAT ALPHA nor does it require the variables lengths pre-defined at or prior to reading as the format and length is utilised from the HOLD mas.

So this will take your base code (expand a little to demonstrate the multi verb point by George) to look something like this -

TABLE FILE CAR
  SUM RETAIL_COST
      DEALER_COST
   BY COUNTRY
  SUM SALES
   BY COUNTRY
   BY CAR
WHERE CAR EQ 'BMW'
ON TABLE HOLD AS MYFILE
END
-RUN

-READFILE MYFILE

-HTMLFORM BEGIN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
 td {
   padding: 10px 5px 2px 10px;
   background-color: #d0e5ff;
 }
</style>
</head>
<body>
 <table>
  <tr>
   <td width=150px>!IBI.AMP.COUNTRY;</td>
   <td width=150px>!IBI.AMP.RETAIL_COST;</td>
   <td width=150px>!IBI.AMP.DEALER_COST;</td>
  </tr>
  <tr>
   <td>!IBI.AMP.CAR;</td>
   <td colspan=2>!IBI.AMP.SALES;</td>
  </tr>
 </table>
</body>
</html>
-HTMLFORM END

Watch out for a potential HTTP1114 error depending upon your server's NLS configuration.

T

This message has been edited. Last edited by: Tony A,



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
Master
posted Hide Post
You guys rock..

Thanks



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report 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] Loading columns into variables, possible?

Copyright © 1996-2020 Information Builders