Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Hello, I'm investigating the usage of global (&&) as...


Greg Coley

Recommended Posts

Hello,

I'm investigating the usage of global (&&) as the default parameters. The idea is a dashboard that displays 4 simple reports based on a date range. The report initially (via the default global variables) shows the reports in the context of day 1 previous month to the final day of the previous month. everything seems to work fine except for running the dashboard. Initially, all the reports say a required parameter is missing, but as soon as I simply refresh the page the reports display as expected. What am i missing here that will allow the users to see this default view of the dashboard without having to refresh after the page loads

Link to comment
Share on other sites

Hi Greg,

Make sure you are using DEFAULTH not DEFAULT, with DEFAULTH you wont be prompted for parameters.

We use global parameters in our site profile. Go to client admin console, application settings, client settings, site profile.

Add your fex example: -INCLUDE common/snt_bip_profile.fex

Inside the fex we have multiple date global variables that we want to use in all portals.

Example:

-SET &STIME = HHMMSS(A8) ;

-SET &THISTIME = EDIT(&STIME,99$:99$:99) ;

-SET &TODAY = EDIT(&DATEYYMD,9999$99$99) ;

-SET &NOWTIME = &TODAY | | &THISTIME ;

-SET &&TODAY_DOWK = TRUNCATE(DOWK(&YYMD, A4));

-SET &&TODAY_DOWKL = TRUNCATE(DOWKL(&YYMD, A12));

-SET &&TODAY_DOWKLC = TRUNCATE(LCWORD(12, &&TODAY_DOWKL, A12));

-SET &&TODAY_IS_WEEKEND = IF &&TODAY_DOWK EQ SAT OR SUN THEN Yes ELSE No;

-SET &&YESTERDAY = AYMD(&YYMD,-1,I8YYMD);

-SET &&TODAY = &YYMD ;

-SET &&TOMORROW = AYMD(&YYMD,1,I8YYMD);

-SET &&THISDAY = EDIT(&YYMD,$$$$$$99) ;

-SET &&CURRMONTH = EDIT(&YYMD,999999);

-SET &&NEXTMONTH = AYM(&&CURRMONTH,1,I6YYM);

-SET &&LASTMONTH = AYM(&&CURRMONTH,-1,I6YYM);

-SET &&CURRMONTH_BOM = &&CURRMONTH || 01;

-SET &&NEXTMONTH_BOM = &&NEXTMONTH || 01 ;

-SET &&LASTMONTH_BOM = &&LASTMONTH || 01 ;

-SET &&CURRMONTH_EOM = AYMD(&&NEXTMONTH_BOM,-1,I8YYMD);

-SET &&LASTMONTH_EOM = AYMD(&&CURRMONTH_BOM,-1,I8YYMD);

Regards,

Clayton

Link to comment
Share on other sites

Here are some of my global variables im using:

 

-*IPEG GLOBAL VARIABLES

-SET &&GLOBAL = EVERYWHERE22;

-SET &&IPEG_NAME = IPEG;

-SET &&IPEG_FROM_DATE = DATECVT(DATEMOV(DATECVT(DATECVT(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD),M, -1), YYMD,I8YYMD),I8YYMD,YYMD),BOM), YYMD,I8YYMD);

-SET &&IPEG_TO_DATE = DATECVT(DATEMOV(DATECVT(DATECVT(DATEADD(DATECVT(&YYMD,I8YYMD,YYMD),M, -1), YYMD,I8YYMD),I8YYMD,YYMD),EOM), YYMD,I8YYMD);

 

Im defining these in edasprof.prf

Heres what one of my reports from the dashboard looks like code wise:

ENGINE INT CACHE SET ON

SET PAGE-NUM=NOLEAD

SET SQUEEZE=ON

-DEFAULTH &WF_HTMLENCODE=ON;

SET HTMLENCODE=&WF_HTMLENCODE

 

SET HTMLCSS=ON

-DEFAULTH &WF_EMPTYREPORT=ON;

SET EMPTYREPORT=&WF_EMPTYREPORT

 

SET EMBEDHEADING=ON

SET GRAPHDEFAULT=OFF

SET COMPONENT=TableChart_1

SET ARVERSION=2

-DEFAULTH &WF_TITLE='WebFOCUS Report';

-DEFAULT &REQUESTEDDATE_YEAR_D_FROM = _FOC_NULL;

-DEFAULT &REQUESTEDDATE_YEAR_D_TO = _FOC_NULL;

GRAPH FILE hr/view_submitted_ideas

-* Created by Designer for Graph

SUM CNT.VIEW_SUBMITTED_IDEAS.VIEW_SUBMITTED_IDEAS.INCIDENT AS ' '

BY VIEW_SUBMITTED_IDEAS.VIEW_SUBMITTED_IDEAS.EXPR1 AS 'LOCATION'

BY VIEW_SUBMITTED_IDEAS.VIEW_SUBMITTED_IDEAS.BRAND AS ' '

WHERE VIEW_SUBMITTED_IDEAS.VIEW_SUBMITTED_IDEAS.REQUESTEDDATE_YEAR_D FROM &FROM.(|FORMAT=YYMD,LINK_TO=TO,TITLE=REQUESTEDDATE Y-M-D).From.QUOTEDSTRING TO &TO.(|FORMAT=YYMD,LINK_TO=FROM,TITLE=REQUESTEDDATE Y-M-D).To.QUOTEDSTRING;

HEADING

"Submitted Ideas"

ON GRAPH PCHOLD FORMAT JSCHART

ON GRAPH SET VZERO OFF

ON GRAPH SET GRWIDTH 1

ON GRAPH SET HAXIS 1008.0

ON GRAPH SET VAXIS 768.0

ON GRAPH SET LOOKGRAPH BAR

ON GRAPH SET EMBEDHEADING ON

ON GRAPH SET AUTOFIT ON

ON GRAPH SET STYLE *

INCLUDE=IBFS:/WFC/Global/Themes/Standard/Default/theme.sty,$

TYPE=REPORT, TITLETEXT='Chart1', ORIENTATION=LANDSCAPE, ARREPORTSIZE=DIMENSION, ARFILTER_TARGET='*', ARGRAPHENGINE=JSCHART, $

TYPE=DATA, COLUMN=N1, BUCKET=color, $

TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $

TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $

TYPE=HEADING, JUSTIFY=CENTER, $

TYPE=HEADING, LINE=1, ITEM=1, OBJECT=TEXT, FONT='ARIAL', SIZE=18, COLOR=RGB(32 0 32), STYLE=NORMAL, $

*GRAPH_SCRIPT

 

*GRAPH_JS_FINAL

"series": [

{

"dataLabels": {

"visible": true,

"position": "center",

"font": "bold 10pt Sans-Serif"

},

"series": "all"

}

],

"pieProperties": {

"holeSize": "0%"

},

"blaProperties": {

"seriesLayout": "stacked"

},

"agnosticSettings": {

"chartTypeFullName": "Bar_Stacked"

}

 

*END

ENDSTYLE

END

 

The report is pretty straightforward, and almost entirely created in designer. The only modifications i made in the code were changing the parameter names to &TO and &FROM to have consistent parameter names throughout the 4 reports on the dashboard. this allows me to use just 1 set of parameter controls on the dashboard.

The dashboard itself is also made in designer. I just drag my reports in, ad the &TO and &FROM Controls. the Parameter controls have a property in designer in the "data Settings are called "Default Value where i put in the &&IPEG_FROM_DATE and &&IPEG_TO_DATE from the globals above.

Link to comment
Share on other sites

Thanks for the response!

This has gotten me much closer. Now the dashboard loads with the global variables as parameters, but now I have 2 more problems.

 

the parameter bar at the top of the dashboard that allows users to select a different range does not appear until a user presses ctrl+F5, it does not show on the initial load

 

2)When the parameter bar DOES show up, it displays todays date for both the &TO and &FROM calendar controls. But based on the data thats displayed in the reports I can tell that its masking the actual values. how can I make these controls display the true data

Link to comment
Share on other sites

Hey Waz,

Yup, that's exactly how I'm doing it. This is designer 8207.

 

 

image.png1585907 110 KB

 

Unfortunately. like I said it works, however, it seems to take away the users ability to change parameters to look at different data / select different parameters:

 

image.png1906699 58.9 KB

 

Until the user refreshes, but even then the dates shown in the calendar selector dont seem to reflect the actual values that are currently in the where statement of the report and the dataset itself, so this is very misleading to the viewer:

 

image.png1880792 68.9 KB

 

What am I missing here Im assuming this is not the intended functionality

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...