04-14-2015 03:45 AM
I am preparing an HTML report in SAS on Enterprise Guide. It is mostly a details entering page with drop down and textboxes. I was able to use Macros for setting up the dropdowns. Now I need to display a table on the html page. The table has to be positioned on a particular part of the page and hence the code for the table display has to be within the HTML code.
Kindly suggest how I can display an entire table from database on to an HTML page in SAS EG.
Thanks in advance.
04-14-2015 04:27 AM
To do what? Is it just for display, will you need update/refresh/enter data, etc. If its simply a display, then just add in the tags, and data from your dataset when you write the HTML file, example here: HTML Tables
04-14-2015 04:32 AM
Hi, I need to just display data from a table depending on a condition on to the HTML page.
I am not sure how I can do that with within the HTML tags.. like I am displaying the database/dataset details as a column of a HTML table element. Any hints as to how I can achieve it.
04-14-2015 04:46 AM
So your not putting data out when the report is generated then. What you are talking about is a web page with user interaction which loads data from a database. This is far more complicated then just creating a HTML document. You could look at PHP scripting, which is used for connecting to databases via web pages: http://en.wikipedia.org/wiki/PHP
These are more advanced topics however, and out of scope of a SAS forum.
Maybe you need one of the other packages that SAS offers, Web Report Studio for example?
04-14-2015 04:50 AM
Looks like the perfect case for a stored process run via the STP server and the /SASStoredProcess URL
04-14-2015 04:54 AM
I am using Stored process for the HTML page, since I have to use macros.
Could you elaborate on your idea. I didn't quite understand on how to proceed.
04-14-2015 05:15 AM
So you already send out the HTML from a STP, and then want it to display an additional table?
Where the original HTML includes a FORM element that lets the user select a table/dataset to display?
Why not call the same STP again, with a parameter that includes the dataset name, and have the STP recreate the HTML page, but now with the table inserted?
04-15-2015 07:42 AM
I tried using a proc print and a proc report by defining the PROC statements in a macro and then calling the macro in the HTML part.
but the HTML treats the statements inside as text and just displays the statements on the screen rather than to execute them.
Can you suggest any commands or functionality to execute the macro statements.
04-15-2015 08:10 AM
a) define your meaning of "macro"
b) you can't just write SAS code into a HTML page and hope it will execute. But you can call a predefined Stored Process via the StoredProcessServer
How have you created the HTML page withe stored process up to now, and how do you invoke it (provide an example)?
04-15-2015 09:02 AM
I concatenate values from dataset into a macro variable and call the macro variable in the HTML statement and it has been working so far.
I have been trying to use the same idea for displaying the table. defining a proc print statement inside a macro and then calling the macro in the HTML.
%macro test ;
proc report data=dataset;
<form name="ADD_SHARE" method="POST">
04-15-2015 09:24 AM
Since the macro %test is used within the range of the CARDS statement, its generated text is not considered SAS code, but plain text for the input statement. That's why you see it as text in the web page.
will help you in developing your stored process.