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     [CLOSED] Create a drop-down list for user input parameter in SQL pass thru report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Create a drop-down list for user input parameter in SQL pass thru report
 Login/Join
 
Platinum Member
posted
Hello,

I am fairly new to WebFocus and not aware of all that it can do.. Currently using WF 7.7.03 Developer Studio where I created a SQL pass thru report.. For this report I need a user input parameter in the form of drop-down list which is dynamic or obtained from a field from one of the table's from my SQL query... How do I build a drop-down list for a SQL pass thru report?

Example:

SELECT A, B, C
FROM TABLE A
Where date = &Date (user selected from drop-down list of dates)

The drop-down should look like 01/01/2016, 01/02/2016, etc.

I tried using this: '&variable.(FIND fieldname IN datasource).[description.]' .. but it throws an error since SQL pass thru reports don't have a master file...

Please help.. Thanks!

This message has been edited. Last edited by: Tamra,
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
I tried this on the Northwind Orders table and it seems to work.
  
ENGINE SQLMSS SET DEFAULT_CONNECTION MY_SQL_CONN
SQL SQLMSS PREPARE SQLOUT FOR
SELECT * FROM ORDERS
END
TABLE FILE SQLOUT
PRINT
     Freight
     ShipName
     ShipAddress
     ShipCity
     ShipRegion
     ShipPostalCode
     ShipCountry
BY  LOWEST OrderID
BY  LOWEST CustomerID
BY  LOWEST EmployeeID
BY  LOWEST OrderDate
BY  LOWEST ShipVia
WHERE ShipCountry EQ &ShipCountry.(FIND ORDERS.ORDERS.SHIPCOUNTRY,ORDERS.ORDERS.SHIPCOUNTRY IN orders|FORMAT=A15V).ShipCountry:.QUOTEDSTRING;
END


I think you'll need to have a synonym for orders to be used in the WHERE test.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
I can't do this because I am not displaying the date on the report, just need it to be an input parameter and eventually filter the report..

Thanks.


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
I'm not sure if I understand. Could you post an example of what you're doing and the error it causes? The code above is an example. Specifically, look at the WHERE test. It is doing a FIND off of the WebFOCUS synonym for orders not the actual table.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Guru
posted Hide Post
There is no need to display your date field for it to work. Just using it in your filter will be good enough.


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Virtuoso
posted Hide Post
Here's an example of the WHERE test using the Orderdate field

TABLE FILE SQLOUT
PRINT 
     Freight
     ShipName
     ShipAddress
     ShipCity
     ShipRegion
     ShipPostalCode
     ShipCountry
BY  LOWEST OrderID
BY  LOWEST CustomerID
BY  LOWEST EmployeeID
BY  LOWEST ShipVia
WHERE OrderDate EQ DT(&OrderDate.(FIND ORDERS.ORDERS.ORDERDATE,ORDERS.ORDERS.ORDERDATE IN orders|FORMAT=HYYMDs).OrderDate:.);
ON TABLE PCHOLD FORMAT HTML

END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
I still get the same error: (FOC205) The description cannot be found for file named: "DW"

Here's my code:
ENGINE SQLORA SET DEFAULT_CONNECTION DWQA
SQL SQLORA PREPARE SQLOUT FOR
SELECT
A.ABC AS "ABC"
,A.XYZ AS "XYZ"
...........
...........
FROM REPORTS.TABLE1 A
WHERE EXISTS (SELECT 1 FROM DW.RUN_PERIOD B WHERE B.PERIOD = A.PERIOD)
AND A.PERIOD = '&B_PERIOD'
END
TABLE FILE SQLOUT
PRINT
ABC
XYZ
.......
.......
WHERE PERIOD EQ &B_PERIOD.(FIND DW.RUN_PERIOD.PERIOD, DW.RUN_PERIOD.PERIOD IN DW.RUN_PERIOD).PERIOD
ON TABLE SUBHEAD
............
............
END


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
Hey Nova,

Ensure you have created a synonym/master file for all tables/views being used; and ensure that they are accessible to the domain they are being called from if working in the managed reporting area (check if they are in the app path for that domain).

If you're just working in the reporting server area, then ensure your qualifiers are correct.

SQL:
[server].[database].[schema].tableName.columnName

WebFocus:
[table].[segment].fieldName

Good luck!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Platinum Member
posted Hide Post
Hello,

Thanks for your response.. But I am working on a SQL pass thru report which does not use a master file and hence faced this problem with creating a dynamic drop down list for user-input parameters...

Any thoughts if I don't have a master file to use for this?

Thanks!


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Virtuoso
posted Hide Post
You can run a SQL Passthru to create a list of values for the where test, HOLD the output to a temp file and then use that list of values for your actual request. You'll still have to use the synonym for a drop down list but the synonym is for the HOLD file which is created dynamically. Something like this:
SQL SQLMSS PREPARE SQLOUT FOR
select orderdate from orders
END
TABLE FILE SQLOUT
BY  orderdate
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS 'baseapp/od_lov' FORMAT BINARY
END
SQL SQLMSS PREPARE SQLOUT FOR
SELECT * FROM ORDERS
END
TABLE FILE SQLOUT
PRINT 
     Freight
     ShipName
     ShipAddress
     ShipCity
     ShipRegion
     ShipPostalCode
     ShipCountry
BY  LOWEST OrderID
BY  LOWEST CustomerID
BY  LOWEST EmployeeID
BY  LOWEST OrderDate
BY  LOWEST ShipVia
WHERE OrderDate EQ DT(&OrderDate.(FIND OD_LOV.OD_LOV.orderdate,OD_LOV.OD_LOV.orderdate IN od_lov|FORMAT=HYYMDs).OrderDate:.);
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Nova27,

Please see my suggestion to your other post .


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     [CLOSED] Create a drop-down list for user input parameter in SQL pass thru report

Copyright © 1996-2020 Information Builders