Focal Point
[SOLVED] Prompt for a Report Title

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9087065966

March 11, 2014, 07:12 PM
RobertF
[SOLVED] Prompt for a Report Title
The user wants to be able to enter a custom title depending on the selections they make. What is the syntax to prompt the user for a title to be displayed on the report.

(surprisingly I could not find a thread on this...)

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8206.08
Windows, All Outputs
March 12, 2014, 04:57 AM
Dave
...probably you couldn't find it because it's basic functionality.

TABLE FILE ...
    SUM ...
    BY  ...
WHERE   ...
HEADING
"&CUSTOM_TITLE.Enter customtitle."
END


G'luck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
March 12, 2014, 08:27 AM
RobertF
quote:
"&CUSTOM_TITLE.Enter customtitle."


Yes, I tied that earlier...prompts for the title but does not display it...perhaps something obvious I am missing...not sure....

TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
CAR.CARREC.MODEL
CAR.BODY.DEALER_COST
CAR.BODY.RETAIL_COST
HEADING
""&CUSTOM_TITLE.Enter customtitle." "
" "
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=REPORT,
GRAPHCOLOR='GREEN',


WebFOCUS 8206.08
Windows, All Outputs
March 12, 2014, 08:31 AM
RobertF
nevermind, I need to loose the quotes..


WebFOCUS 8206.08
Windows, All Outputs
March 12, 2014, 08:53 AM
Dave
Roll Eyes Smiler


_____________________
WF: 8.0.0.9 > going 8.2.0.5
March 12, 2014, 09:35 AM
j.gross
quote:
nevermind, I need to loose the quotes..


Double double ==> Toil and trouble
Smiler

Of course, if the user enters a string containing doublequotes, the output will be injected into "fire burn and cauldron bubble" mode.

You can avoid that by prompting up front,
* &CUSTOM_TITLE.Enter customtitle.

and then editing the &var

-SET &CUSTOM_TITLE = a defensive transformation of itself, using STRREP() for example

before insertion in the report.

This message has been edited. Last edited by: j.gross,
March 12, 2014, 09:56 AM
Francis Mariani
How about never using prompt and build a parameter screen instead?


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
March 12, 2014, 01:17 PM
njsden
Francis, are you promoting use of HTML Composer now? Big Grin



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 12, 2014, 01:30 PM
Francis Mariani
I am promoting the use of parameter screens of some kind. I believe the last time I used a prompt was in 1993 in a version of PC/FOCUS for DOS.


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
March 13, 2014, 03:34 AM
Dave
Francis,

I don't understand your question. ( how about never prompting ).

We make an fex with prompts. Somewhere in code, but we prefer to prompt for parameters in the beginning of the fex. e.g.
-PROMPT &CUSTOM_TITLE.Custom title.;

...and THEN we make an html refering to this fex. Parameters are added to the form. Done.



meanwhile in the back of my mind while typing...

I think you mean autoprompt. Which makes me wonder what you mean with 'parameter screen instead'.

How would you make an parameter screen without having &CUSTOM_TITLE some where in the code?



@j.gross
quote:
* &CUSTOM_TITLE.Enter customtitle.


is that even valid / supported code?


_____________________
WF: 8.0.0.9 > going 8.2.0.5
March 13, 2014, 01:06 PM
George Patton
What, no CRTFORM Francis ?


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
March 13, 2014, 01:18 PM
j.gross
quote:
is that even valid / supported code?

In most contexts, a line of FOCUS code (whether in sysin or in FOCSTACK) that has a leading asterisk is treated as a comment. It's been that way forever-and-a-day, from the days when the only platform was VM/CMS. (Right, Gerry?)
March 13, 2014, 01:45 PM
Francis Mariani
When using HTML Composer to create a parameter screen for a report, all -DEFAULT &VARIABLE statements in the referenced report are used to create parameters and related controls (check-boxes, text-box, list boxes, etc). I've never user PROMPT to to this.

If you have -DEFAULT &CUSTOM_TITLE = ''; in the fex, then HTML Composer will create a parameter called CUSTOM_TITLE and a related control, which you can choose to be a text-box. I am not aware if -PROMPT &CUSTOM_TITLE.Custom title. does the same for HTML Composer.


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
March 13, 2014, 10:36 PM
susannah
Ah. CRTFORM.... i remember them ever so fondly.
you could have several of them within the progress of a single fex... CRTFORM didn't stop the processing... it just paused it, to collect more input from you... so i had a wicked hard time coming to grips with HTMLFORM and why anybody would want to limit themselves in such a silly way.
nice memory.
thanks, george




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 14, 2014, 04:24 AM
Dave
Thanks Francis,

But we use -DEFAULT only to make sure a parameter has a default value... ( go figure Wink )

-PROMPT isn't specific designed to launch autoprompt coz -DEFAULT will trigger it also.

....but I understand your point.


I guess
-PROMPT &PARAM;
and
-DEFAULT &PARAM = '';

render the same results.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
March 15, 2014, 04:31 PM
Danny-SRL
Ah the problems of "user entered quotes"!

Try the following:
-SET &EXAMPLE='User entered " a problem';
-SET &EXLEN=&EXAMPLE.LENGTH;
-SET &EXAMPLE=STRREP (&EXLEN, &EXAMPLE, 1, '"', 1, HEXBYT(216, 'A1'), &EXLEN, 'A&EXLEN.EVAL');

For single quotes, use HEXBYT(215, 'A1')

Jack,
You are right, a * in column 1 is treated as a comment BUT, the line is sent to the FOCSTACK whereas if you use -* it isn't.

And for all the "oldies" (me included), do you have customers with legacy FOCEXECs, using -CRTFORM and wanting to upgrade to WebFOCUS?

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF