Focal Point
[SOLVED] Variable Column Titles with Guided reports

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

May 21, 2013, 05:42 PM
BobV
[SOLVED] Variable Column Titles with Guided reports
Hi all,
I recently learned how to build a parameter report using Guided Reports. I used the option "One variable for all selected column" to created a combo box that has five metrics as options to print. Since I can't use AS names, I thought I could use dialog manager to create custom column names for each metric when the report prints.
Here is the code that got generated by the GUI:
TABLE FILE CRS355
SUM
&RP_FN06S_Sum6.(AND(,,,,)).Please select sum field(s).

Here is the DM I tried:
-SET &DTL_TITLE = IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LP_ID_CNT' THEN 'Total Leads Assigned' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LEAD_REMOVE' THEN 'Leads Removed' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.WRKABLE_LEAD' THEN 'Workable Leads' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LEAD_CONTACT' THEN 'Leads Contacted' ELSE 'Leads Not Contacted';

Incidentally, I was able to use this technique for my sort fields, but I created those with the "One variable for each selected column".

Is there a way to do this? Or do I need to have my aliases exact in the master file?

thanks

BobV

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


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
May 22, 2013, 07:41 AM
Twanette
Hi BobV,

This mechanism typically works best if you let your master file do all the hard work e.g. make sure that each field that can be selected has a "TITLE" attribute associated with it.

We had a scenario where the customer did not want to do ANY "customization" in the master files that were generated off their RDBMS. So, for the purposes of PRINT or SUM fields, we set up new DEFINEd fields in a focexec that we -INCLUDEd at the top of each report. We then specified the TITLEs in the DEFINE section.


WebFOCUS 8.2.06 mostly Windows Server
May 22, 2013, 11:01 AM
BobV
Ok. That being the case, I would not be able to have custom as names with spaces correct?


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
May 22, 2013, 12:59 PM
BobV
[Solved]
I searched Focal Point and found another post that had something similar to my problem. I can create my DEFINEd fields with spaces preserved, the reference those DEFINEd field names within single quotes in the code:

DEFINE FILE CRS355
Total Leads/I8C = LP_ID_CNT;
Leads Contacted/I8C = IF ( DISP_CDE EQ 'RESP' ) THEN LP_ID_CNT ELSE 0;
Leads Not Contacted/I8C = IF ( DISP_CDE EQ 'PLAN' OR 'FAIL' ) THEN LP_ID_CNT ELSE 0;
Leads Removed/I8C = IF ( DISP_CDE EQ 'UNDO' ) THEN LP_ID_CNT ELSE 0;
LEAD_REMOVE/I8C = IF ( DISP_CDE EQ 'UNDO' ) THEN LP_ID_CNT ELSE 0;
Workable Leads/I8C = LP_ID_CNT - LEAD_REMOVE;
END

TABLE FILE CRS355
SUM
&RP_FN06S_Sum6.(AND(,,)).Please select sum field(s).


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
May 22, 2013, 01:01 PM
BobV
SOLVED
quote:
Originally posted by BobV:
Hi all,
I recently learned how to build a parameter report using Guided Reports. I used the option "One variable for all selected column" to created a combo box that has five metrics as options to print. Since I can't use AS names, I thought I could use dialog manager to create custom column names for each metric when the report prints.
Here is the code that got generated by the GUI:
TABLE FILE CRS355
SUM
&RP_FN06S_Sum6.(AND(,,,,)).Please select sum field(s).

Here is the DM I tried:
-SET &DTL_TITLE = IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LP_ID_CNT' THEN 'Total Leads Assigned' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LEAD_REMOVE' THEN 'Leads Removed' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.WRKABLE_LEAD' THEN 'Workable Leads' ELSE IF &RP_FN06S_Sum6 EQ 'CRS355.SEG01.LEAD_CONTACT' THEN 'Leads Contacted' ELSE 'Leads Not Contacted';

Incidentally, I was able to use this technique for my sort fields, but I created those with the "One variable for each selected column".

Is there a way to do this? Or do I need to have my aliases exact in the master file?

thanks

BobV



WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
May 23, 2013, 04:51 AM
Twanette
Hi BobV,
You can certainly do that.
However, depending on your WebFOCUS version, the TITLE option on a DEFINE in a focexec, which behaves like a TITLE in the master file, works like a charm, and would be my preference e.g.
TOTAL_LEADS/I8C TITLE 'Total Leads' = LP_ID_CNT;



WebFOCUS 8.2.06 mostly Windows Server
May 23, 2013, 08:04 AM
Alex
You don't indicate where you're passing your selected column names from however, if it is from a drop down list you can pass the display value.
On the "parameters" tab of the HTML composer, when you select your DTL_TITLE parameter, click on the checkbox for "Send display value". This will pass the the display value as a variable to your report as &DTL_TITLE_TEXT.


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
May 23, 2013, 10:24 AM
BobV
[SOLVED]
Alex - thanks for the response. I thought I had tried your suggestion but I tried again to be sure. It did not solve my problem.

Twanette - WOW! Your solution worked! I never knew about TITLE within a DEFINEd field. It's kind of like an early AS NAME which is what I was looking for. I much prefer this as I would rather not have spaced in my attribute names.

thanks all for the help

-BobV Smiler


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8