How to create a drop down menu in a HTML file using sas

Reply
Contributor
Posts: 36

How to create a drop down menu in a HTML file using sas

Hello there,
I have a html file with graphs (say 10 graphs)in it. I would like to have a drop down menu on that html file so I can select graphs based on the name like 1,2,3,4,etc.instead of scrolling down. The problem is I am new to HTML coding and I have no idea how to code and how it can be interpreted by sas. Kindly give me some suggestions so I can work my way through. I appretiate your time and concern.
Thank you,

Niran

Super User
Posts: 11,101

Re: How to create a drop down menu in a HTML file using sas

A start would include how you are making the graphs. Some of the options for referencing other items means that the creation step has to include identification information to reference such as an IMAGENAME using ODS Graphics statement.

Contributor
Posts: 36

Re: How to create a drop down menu in a HTML file using sas

Thank you Ballardw for the reply. Below is the skeleton structure for my program
ods html file=

               body=

              content=

               frame=

               path=;

proc gplot;

    plot A*B;

    run;

proc gplot;

    plot C*D;

    run;

proc gplot;

    plot E*F;

    run;

ods html close;

 

This is how I created the graphs to the html file and its location.  What I would like to know is "HOW" and "WHERE" will I type in the code for the drop down menu for the html file. 

Super User
Posts: 18,993

Re: How to create a drop down menu in a HTML file using sas

HOW is going to be standard HTML code - so googling how to create an HTML dropdown will get you a few options.

WHERE - I'm fairly certain you can use an ODS TEXT = to add this in.

I don't have time to try it today but maybe tomorrow. Or maybe someone else will have a better solution Smiley Happy

If you have it - WRS is probably where you would want to build those features really.
Super User
Posts: 18,993

Re: How to create a drop down menu in a HTML file using sas

A drop down is one thing, triggering an action would also be required.

Make a dropdown of links?

 

At any rate, probably worth cross posting this in the ODS reporting forum instead of general programming.

 

The report guru, Cynthia Zender may be able to help. 

Contributor
Posts: 36

Re: How to create a drop down menu in a HTML file using sas

Thank you Reeza for both the msg. I agree with what you said. I have never worked on this area, so my question might have been a vague one. I would like to have a set of links and you click that and will take you to that graph. The code which Ksharp had suggested worked well enough for a small scale of graph, which is a good thing for me.  But like you said I will post it in the reporting form too.

Super User
Posts: 9,854

Re: How to create a drop down menu in a HTML file using sas

Here is an alternative way to use LINK to redirect .

 

 

ods html style=sasweb path="/folders/myfolders/a" body='xx.html'  ;
ods escapechar='~';
ods text='~S={ url="xx.html#A"} Graph A';
ods text='~S={ url="xx.html#B"} Graph B';

ods html anchor='A';

proc sgscatter data=sashelp.class;
matrix weight height;
run;

ods html anchor='B';
proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex datalabel=name;
run;

ods html close;
Contributor
Posts: 36

Re: How to create a drop down menu in a HTML file using sas

Thank you Ksharp. First of all I am new to this level of coding and the code that you have posted gave me a good idea of how to do a link on the graph. Seriously I thank you for spending your time for me. The graphs that I generate are from a dynamic macro and its like this

 

A---1

      2

      3

B---1

      2

C---1

       2

       3

       4

       5

A , B , C are the levels that the graphs need to be generated for. and each level have different number of graphs to generate. The numbers 1,2,3 etc are the number of graphs generated. Its a dynamic one and have to find a way to do a "drop down menu" and select each number(1,2,3....) graph....Like Reeza had suggested I will post it in the reporting forum and see too. Please, Ksharp if you have any improved method, do share.

Thank you

Niran

 

 

Super User
Posts: 18,993

Re: How to create a drop down menu in a HTML file using sas

Ask a Question
Discussion stats
  • 8 replies
  • 584 views
  • 0 likes
  • 4 in conversation