proc template;
define tagset Tagsets.Msoffice2k_x;
define event initialize;
putlog "v2.60";
do /if $options["DOC"];
set $doc $options["DOC"];
else;
unset $doc;
done;
do /if $options["ORIENTATION"];
set $orientation $options["ORIENTATION" ];
else;
unset $orientation;
done;
do /if $options["PRINT_HEADER"];
set $print_header $options["PRINT_HEADER" ];
else;
unset $print_header;
done;
do /if $options["PRINT_FOOTER"];
set $print_footer $options["PRINT_FOOTER" ];
else;
unset $print_footer;
done;
do /if $options["MARGIN"];
set $margin $options["MARGIN" ];
else;
unset $margin;
done;
do /if $options["PRINT_HEADER_MARGIN"];
set $header_margin $options["HEADER_MARGIN" ];
else;
unset $header_margin;
done;
do /if $options["PRINT_FOOTER_MARGIN"];
set $footer_margin $options["FOOTER_MARGIN" ];
else;
unset $footer_margin;
done;
do /if $options["RIGHT_MARGIN"];
set $right_margin $options["RIGHT_MARGIN" ];
else;
unset $right_margin;
done;
do /if $options["LEFT_MARGIN"];
set $left_margin $options["LEFT_MARGIN" ];
else;
unset $left_margin;
done;
do /if $options["BOTTOM_MARGIN"];
set $bottom_margin $options["BOTTOM_MARGIN" ];
else;
unset $bottom_margin;
done;
do /if $options["TOP_MARGIN"];
set $top_margin $options["TOP_MARGIN" ];
else;
unset $top_margin;
done;
do /if $options["SHEET_NAME"];
set $sheet_name $options["SHEET_NAME" ];
else;
unset $sheet_name;
done;
do /if $options["ZOOM"];
set $zoom $options["ZOOM"];
else;
unset $zoom;
done;
do /if $options["FROZEN_HEADERS"];
set $frozen_headers $options["FROZEN_HEADERS" ];
else;
unset $frozen_headers;
done;
do /if $options["FROZEN_ROWHEADERS"];
set $frozen_rowheaders $options["FROZEN_ROWHEADERS" ];
else;
unset $frozen_rowheaders;
done;
do /if $options["SCALE"];
set $scale $options["SCALE" ];
else;
unset $scale;
done;
do /if $options["GRIDLINES"];
set $gridlines $options["GRIDLINES" ];
else;
unset $gridlines;
done;
do /if $options["BLACKANDWHITE"];
set $blackandwhite $options["BLACKANDWHITE" ];
else;
unset $blackandwhite;
done;
do /if $options["DRAFTQUALITY"];
set $draftquality $options["DRAFTQUALITY" ];
else;
unset $draftquality;
done;
do /if $options["PRINT_FITHEIGHT"];
set $fitheight $options["PRINT_FITHEIGHT" ];
else;
unset $fitheight;
done;
do /if $options["PRINT_FITWIDTH"];
set $fitwidth $options["PRINT_FITWIDTH" ];
else;
unset $fitwidth;
done;
do /if $options["PAPERSIZE"];
set $papersize $options["PAPERSIZE" ];
else;
unset $papersize;
done;
do /if $options["AUTOFILTER"];
set $autofilter $options["AUTOFILTER" ];
else;
unset $autofilter;
done;
do /if $options["WORKSHEET_SOURCE"];
set $worksheet_source $options["WORKSHEET_SOURCE" ];
else;
unset $worksheet_source;
done;
do /if $options["PAGEBREAK"];
set $pagebreak $options["PAGEBREAK" ];
else;
unset $pagebreak;
done;
do /if $options["TABCOLOR"];
set $tabcolor $options["TABCOLOR" ];
else;
unset $tabcolor;
done;
do /if $options["FITTOPAGE"];
set $fit2page $options["FITTOPAGE" ];
else;
unset $fit2page;
done;
do /if $options["LEADING_ZERO"];
set $leading_zero $options["LEADING_ZERO" ];
else;
unset $leading_zero;
done;
do /if $options["ROTATE_HEADERS"];
set $rotate_headers $options["ROTATE_HEADERS" ];
else;
unset $rotate_headers;
done;
do /if $options["HEIGHT"];
set $height $options["HEIGHT" ];
else;
unset $height;
done;
do /if $options["NOWARN_PATH"];
set $nowarn_path $options["NOWARN_PATH" ];
else;
unset $nowarn_path;
done;
do /if $options["IMAGE_PATH"];
set $image_path $options["IMAGE_PATH" ];
else;
unset $image_path;
done;
do /if $options["IMAGE_HEIGHT"];
set $image_height $options["IMAGE_HEIGHT" ];
else;
unset $image_height;
done;
do /if $options["IMAGE_WIDTH"];
set $image_width $options["IMAGE_WIDTH" ];
else;
unset $image_width;
done;
do /if $options["PAGEBREAK_ROW"];
set $pagebreak_row $options["PAGEBREAK_ROW" ];
else;
unset $pagebreak_row;
done;
do /if $options["EMBEDDED_TITLES"];
set $embedded_titles $options["EMBEDDED_TITLES" ];
else;
unset $embedded_titles;
done;
do /if $options["EMBEDDED_TITLES_ONCE"];
set $embedded_titles_once $options["EMBEDDED_TITLES_ONCE" ];
else;
unset $embedded_titles_once;
done;
do /if $options["EMBEDDED_FOOTNOTES"];
set $embedded_footnotes $options["EMBEDDED_FOOTNOTES" ];
else;
unset $embedded_footnotes;
done;
do / if $options["GRAPH_HEIGHT"];
set $graph_height $options["GRAPH_HEIGHT" ];
else;
unset $graph_height;
done;
do / if $options["GRAPH_WIDTH"];
set $graph_width $options["GRAPH_WIDTH" ];
else;
unset $graph_width;
done;
do / if $options["WORKSHEET_LOCATION"];
set $worksheet_location $options["WORKSHEET_LOCATION" ];
else;
unset $worksheet_location;
done;
do /if $options["BANNER_COLOR_EVEN"];
set $banner_even $options["BANNER_COLOR_EVEN" ];
else;
unset $banner_even;
done;
do /if $options["BANNER_COLOR_ODD"];
set $banner_odd $options["BANNER_COLOR_ODD" ];
else;
unset $banner_odd;
done;
do /if $options["FBANNER_COLOR_EVEN"];
set $fbanner_even $options["FBANNER_COLOR_EVEN" ];
else;
unset $fbanner_even;
done;
do /if $options["FBANNER_COLOR_ODD"];
set $fbanner_odd $options["FBANNER_COLOR_ODD" ];
else;
unset $fbanner_odd;
done;
do /if $options["HEADER_BGCOLOR"];
set $header_bgcolor $options["HEADER_BGCOLOR"];
else;
unset $header_bgcolor;
done;
do /if $options["HEADER_FGCOLOR"];
set $header_fgcolor $options["HEADER_FGCOLOR"];
else;
unset $header_fgcolor;
done;
do /if $options["ROWHEADER_BGCOLOR"];
set $rowheader_bgcolor $options["ROWHEADER_BGCOLOR"];
else;
unset $rowheader_bgcolor;
done;
trigger set_just_lookup;
trigger set_nls_num;
trigger valid_options;
trigger check_valid_options;
trigger list_options / if cmp($options["DOC"],"help");
putlog $doc;
end;
define event javascript;
end;
define event startup_Function;
end;
define event shutdown_function;
end;
define event valid_options;
set $valid_options["DOC"]
"Specifies the options for the tagset";
set $valid_options["ORIENTATION"]
"Modifies worksheet page orientation";
set $valid_options["PRINT_HEADER"]
"Specifies text for header section of the page setup";
set $valid_options["PRINT_FOOTER"]
"Specifies footer section of the page setup";
set $valid_options["MARGIN"]
"Modifies worksheet margins specifying each margin separated by a comma";
set $valid_options["PRINT_HEADER_MARGIN"] "Specifies margins for header section";
set $valid_options["PRINT_FOOTER_MARGIN" ] "Specifies margins for the footer section";
set $valid_options["LEFT_MARGIN" ] "Specifies the left margins for the worksheet";
set $valid_options["RIGHT_MARGIN" ] "Specifies the right margins for the worksheet";
set $valid_options["TOP_MARGIN" ] "Specifies the top margin for the worksheet";
set $valid_options["BOTTOM_MARGIN" ] "Specifies the bottom margin for the worksheet";
set $valid_options["SHEET_NAME" ] "Modifies sheet name";
set $valid_options["FROZEN_HEADERS" ] "Freezes column headers";
set $valid_options["FROZEN_ROWHEADERS" ] "Freezes row headers";
set $valid_options["SCALE" ] "Modifies the print scale";
set $valid_options["GRIDLINES"] "modifies the gridlines";
set $valid_options["BLACKANDWHITE"]
"Modifies print color to black and white";
set $valid_options["DRAFTQUALITY"]
"Modifies work sheet print setting";
set $valid_options["PRINT_FITHEIGHT"]
"modifies the fitheight page setup setting";
set $valid_options["PRINT_FITWIDTH"]
"Modifies the fitwidth page setup setting";
set $valid_options["PAPERSIZE"]
"Modifies current paper size";
set $valid_options["AUTOFILTER"]
"Adds filters to headers";
set $valid_options["WORKSHEET_SOURCE"]
"Adds multiple worksheets per workbook by taking separates HTML files";
set $valid_options["NOWARN_PATH"]
"Adds path which removes the warning dialog when adding multiple sheets per workbook";
set $valid_options["PAGEBREAK"]
"Provides the ability to modify pagebreak";
set $valid_options["TABCOLOR"]
"Modifies the tab color";
set $valid_options["FITTOPAGE"]
"Modifies the page settup fit to page option";
set $valid_options["LEADING_ZERO"]
"retains leading zeroes";
set $valid_options["ROTATE_HEADERS"]
"Provides rotation values for headers. Works in cunjunction with the HEIGHT= option";
set $valid_options["HEIGHT"] "Modifies the height of the headers";
set $valid_options["ZOOM"] "Applies zoom to each table individually by specifying zoom value separated by a comma";
set $valid_options["OPEN_MACRO"] " Adds a macro which executes when the worksheet loads ";
set $valid_options["CLOSE_MACRO"] " Adds a macro which executes when the worksheet closed";
set $valid_options["PANELCOLS"] "Panels tables and graphs";
set $valid_options["PANEL_SPACE"] "Adds the number of blanks cells to add between tables or graphs";
set $valid_options["IMAGE_PATH"] "Path to image or logo";
set $valid_options["IMAGE_HEIGHT"] "Height of image specified with the image_path option";
set $valid_options["IMAGE_WIDTH"] "Width of image specified with the image_path option";
set $valid_options["EMBEDDED_TITLES"] "Removes titles from the worksheet";
set $valid_options["EMBEDDED_FOOTNOTES"] "Removes footnotes from the worksheet";
set $valid_options["PAGEBREAK_ROW"] "Sets the rows break on";
set $valid_options["GRAPH_WIDTH"] "Sets width for the graphs";
set $valid_options["WORKSHEET_LOCATION"] "AddS the starting row and column of the output";
set $valid_options["BANNER_COLOR_EVEN"] "Sets the background color for the even rows";
set $valid_options["BANNER_COLOR_ODD"] "Sets the background color for the odd rows";
set $valid_options["FBANNER_COLOR_EVEN"] "Sets the foreground color for the even rows";
set $valid_options["FBANNER_COLOR_ODD"] "Sets the foreground color for the odd rows";
set $valid_options["HEADER_BGCOLOR"] "Sets the background color for the headers";
set $valid_options["DATA_BGCOLOR"] "Sets the background color for table cells";
end;
define event check_valid_options;
break /if ^$options;
iterate $options;
do /while _name_;
do /if ^$valid_options[_name_];
putlog "Unrecognized option: " _name_;
done;
next $options;
done;
end;
define event list_options;
iterate $valid_options;
putlog
"==============================================================
================";
putlog "Short descriptions of the supported options";
putlog
"==============================================================
================";
putlog "Name : Description";
putlog " ";
do /while _name_;
unset $option;
set $option $options[_name_ ];
set $option $option_defaults[_name_ ] /if ^$option;
putlog _name_ " : " ;
putlog " " _value_;
putlog " ";
next $valid_options;
done;
putlog " ";
end;
define event doc;
start:
put "" NL;
finish:
put "" NL;
end;
define event doc_head;
start:
put "
" NL;
put "" NL /if $worksheet_source;
do / if $nowarn_path;
putq "" NL / if $worksheet_source;
done;
break / if $worksheet_source;
/*********************************************************** /
/* Defining the items of the page setup such as the margins */
/* and the page orientation. */
/************************************************************/
do /if any($orientation, $print_header, $print_footer, $margin, $header_margin, $footer_margin,
$left_margin,$top_margin,$right_margin,$bottom_margin);
put "" NL;
done;
put VALUE NL;
do / if exist($image_path);
putq "" NL;
put "" NL;
put "" NL;
done;
finish:
put "" NL;
do / if any($orientation,$sheet_name,$zoom,$frozen_headers,$frozen_rowheaders,$scale, $gridlines,
$blackandwhite,$draftquality,$fitheight, $fitwidth, $papersize,$pagebreak, $tabcolor,
$options['CLOSE_MACRO'], $options['CLOSE_MACRO'],$worksheet_source);
set $xmloptions "true";
done;
do / if cmp($xmloptions,"true");
put "" NL;
done;
/* done; */
put "" NL;
end;
/*****************************************************/
/* Sets option the title and footnote options */
/******************************************************/
define event system_title;
eval $tcount[] event_name;
break / if cmp($embedded_titles,"no");
do / if cmp($embedded_titles_once,"yes");
break / if $tcount > 1;
done;
start:
do / if $worksheet_location;
do / if $tcount <= 1;
set $col_location scan($worksheet_location,1);
set $col_location repeat("
",$col_location);
set $row_location scan($worksheet_location,2);
putq "
";
put "
";
put $col_location;
done;
done;
put "
";
put VALUE;
break /if exists( value);
put %nrstr(" ") /if exists( empty);
finish:
break / if cmp($embedded_titles,"no");
put "
" NL;
end;
define event system_footer;
break / if cmp($embedded_footnotes,"no");
start:
put "
";
put VALUE;
finish:
break / if cmp($embedded_footnotes,"no");
put "
" NL;
end;
define event proc_list;
set $proclist["Gchart"] "1";
set $proclist["Gplot"] "1";
set $proclist["Gmap"] "1";
set $proclist["Gkpi"] "1";
set $proclist["Gcontour" ] "1";
set $proclist["G3d" ] "1";
set $proclist["Gbarline" ] "1";
set $proclist["Gareabar" ] "1";
set $proclist["Gradar" ] "1";
set $proclist["Gslide" ] "1";
set $proclist["Ganno" ] "1";
set $proclist["Sgplot"] "1";
set $proclist["Sgpanel"] "1";
set $proclist["Sgrender"] "1";
end;
define event doc_body;
put "" NL;
finish:
trigger pre_post;
put "" NL;
end;
/********************************************/
/* Panel tables and graphs in the worksheet */
/********************************************/
define event proc;
trigger proc_list;
set $panelcols $options["PANELCOLS" ];
eval $panel[] event_name;
set $pantmp $panel;
do /if $options["PANELCOLS"];
set $pagebreak "no";
set $endcol sum($pantmp,$panelcols);
eval $endcol inputn($endcol,"best");
eval $endcol $endcol -1;
set $startx[] $pantmp;
do / if cmp($pantmp,"1");
put "
" NL;
put "
" NL;
done;
done;
/* Modified 2/21 PROC_COUNT does not generate valid count */
/* Added spaces when the value of panelcols is missing */
do /if exist( $startx[$pantmp]);
put "" NL /if ^$options["PANELCOLS"];
do / if $options['PANEL_SPACE'];
set $panel_space $options['PANEL_SPACE'];
eval $panel_space inputn($panel_space,"best")-1;
set $panel_space repeat("
",$panel_space);
put $panel_space / if proc_count ne 0;
else;
eval $panel_space 0;
eval $panel_space repeat("
",$panel_space);
put $panel_space / if ^$options["PANELCOLS"];
done;
put "
" NL;
done;
finish:
do / if $proclist[proc_name];
set $graphics "true";
done;
set $x $endcol;
set $y $pantmp;
do /if cmp( $x, $y);
put "
" NL;
put "
" NL;
do / if !cmp($graphics,"true");
put "
" NL ;
put " " NL;
put "
" NL;
put "
" NL;
done;
done;
done;
unset $options["PANELCOLS" ];
end;
/***************************************************/
/* Set up alternating banner colors for foreground */
/* and background colors */
/***************************************************/
define event banner_colors;
do /if any( $banner_even, $banner_odd, $fbanner_odd, $fbanner_even);
eval $data_row inputn(data_row,"best");
do /if mod($data_row, 2);
do /if any( $banner_odd, $fbanner_odd);
put " class=""second""" ;
else;
done;
else;
do /if any( $banner_even, $fbanner_even);
put " class=""first""";
else;
done;
done;
done;
end;
/**********************************************/
/* Remove the pagebreak based on the argument */
/**********************************************/
define event pagebreak;
put PAGEBREAKHTML NL /if ^cmp($pagebreak,"no");
end;
define event header;
start:
put "
";
trigger cell_value;
finish:
trigger cell_value;
put "