Jump to content

Is it possible to create a button in place of a drilldown link in the header for something like Exporting to Excel?


Go to solution Solved by Martin Yergeau,

Recommended Posts

Posted (edited)

Good afternoon everyone.  I have been creating drilldown links for some time and I know how to create a link to export to excel and make it appear in the header of the report, but I'm just wondering if there is a way on a fex to create a button instead that says Export to Excel and have it display in the heading section of a report.

By the way, I'm using 9.3.1

 

 

Edited by Erin Trotter
Posted

I have done something like this

image.png.aae0f3ef2ff8b73a6debb266d82741df.png

excel_button.fex

-DEFAULTH &WFFMT  = 'HTML';
-SET &suppress_excel = IF &WFFMT EQ 'HTML' OR 'AHTML' THEN ' ' ELSE 'FOC_NONE';
 TABLE FILE GGSALES
 "&|#10062; Excel &suppress_excel"
  SUM UNITS 
      DOLLARS
   BY REGION    
   BY ST    
   BY CITY     
   ON TABLE SET PAGE NOLEAD
   ON TABLE PCHOLD FORMAT &WFFMT
   ON TABLE SET STYLE *
  TYPE=REPORT, PAGECOLOR=RGB(242 242 242), SIZE=10, $
  TYPE=TITLE,  BACKCOLOR=RGB(230 230 230), $
  TYPE=DATA, BACKCOLOR=(RGB(242 242 242) WHITE),
             BORDER-LEFT=LIGHT, BORDER-LEFT-COLOR=RGB(230 230 230),
             BORDER-RIGHT=LIGHT, BORDER-RIGHT-COLOR=RGB(230 230 230), $
  TYPE=HEADING, justify=right,style=-underline, hyperlink-color=grey,
  FOCEXEC=./excel_button.fex(WFFMT='XLSX'),$
  ENDSTYLE
  END

Kinda looks like a button, just using a Unicode character. Note that the FOCEXEC drilldown uses a relative path to call itself, passing the XLSX format.

Posted

Or to make it look a little more botton-like.

image.png.dc14f1c8b5b6df08850a0a8a64b82966.png

-DEFAULTH &WFFMT  = 'HTML';
-SET &suppress_excel = IF &WFFMT EQ 'HTML' OR 'AHTML' THEN ' ' ELSE 'FOC_NONE';
 TABLE FILE GGSALES
 "<+0> &|nbsp; &|#10062; Excel &|nbsp;<+0> &suppress_excel"
  SUM UNITS 
      DOLLARS
   BY REGION    
   BY ST    
   BY CITY     
   ON TABLE SET PAGE NOLEAD
   ON TABLE PCHOLD FORMAT &WFFMT
   ON TABLE SET STYLE *
  TYPE=REPORT, PAGECOLOR=RGB(242 242 242), SIZE=10, $
  TYPE=TITLE,  BACKCOLOR=RGB(230 230 230), $
  TYPE=DATA, BACKCOLOR=(RGB(242 242 242) WHITE),
             BORDER-LEFT=LIGHT, BORDER-LEFT-COLOR=RGB(230 230 230),
             BORDER-RIGHT=LIGHT, BORDER-RIGHT-COLOR=RGB(230 230 230), $
  TYPE=HEADING, ITEM=1, JUSTIFY=RIGHT,STYLE=-UNDERLINE, HYPERLINK-COLOR=GREY, 
  BACKCOLOR=RGB(220 220 220), TOPGAP=.05, BOTTOMGAP=.05,
  FOCEXEC=./excel_button2.fex(WFFMT='XLSX'),$
  ENDSTYLE
  END

 

  • Like 2
  • Solution
Posted (edited)

Or to use an image 

-DEFAULTH &PARAM1 = _FOC_NULL
-SET &WFFMT = 'HTML';
-SET &#ASPDF_L       = IF &LANG EQ 'EN' THEN 'Save as PDF'                           ELSE 'Sauvegarde en PDF';
-SET &#ASEXL_L       = IF &LANG EQ 'EN' THEN 'Save as Excel'                         ELSE 'Sauvegarde en Excel';

DEFINE FILE CAR
EXL_EXPRT     /A150   = '<IMG SRC="/ibi_apps/run/ibfs?IBFS_path=EDA/EDASERVE/logo_img/excel_small.gif" style="border-style: none;" alt="&#ASEXL_L.EVAL">';
PDF_EXPRT     /A150   = '<IMG SRC="/ibi_apps/run/ibfs?IBFS_path=EDA/EDASERVE/logo_img/pdf_small.gif"   style="border-style: none;" alt="&#ASPDF_L.EVAL">';
END
TABLE FILE CAR
SUM SEATS
    EXL_EXPRT NOPRINT
    PDF_EXPRT NOPRINT
BY COUNTRY
BY MODEL

HEADING
"<EXL_EXPRT <PDF_EXPRT"

ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
-IF &WFFMT NE 'XLSX' OR 'AHTML' THEN GOTO NOBYDSP;
ON TABLE SET BYDISPLAY ON
-NOBYDSP
ON TABLE SET LINES 999999
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=HEADING,
     JUSTIFY=LEFT,
$
-IF &WFFMT     NE 'HTML'     THEN GOTO NOSAVE;
TYPE=HEADING,
     OBJECT=FIELD,
     ITEM=1,
     FOCEXEC=IBFS:/WFC/Repository/YourFexName.fex      ( \
       PARAM1=&PARAM1.QUOTEDSTRING \
       WFFMT='XLSX'),
     TARGET='_blank',
$
TYPE=HEADING,
     OBJECT=FIELD,
     ITEM=2,
     FOCEXEC=IBFS:/WFC/Repository/YourFexName.fex      ( \
       PARAM1=&PARAM1.QUOTEDSTRING \
       WFFMT='PDF'),
     TARGET='_blank',
$
-NOSAVE
ENDSTYLE
END
-RUN

 

pdf_small.gif

excel_small.gif

Edited by Martin Yergeau
  • Like 2
  • Thanks 1

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...