Thursday, June 9, 2011

A SAS Stored Process Web Application that exports a Dataset to an Excel sheet

While creating Drill down reports, you might need to provide the users with the option of downloading the entire data to an excel sheet. For this you may need to create an interface(Code) where the Export button is displayed and a stored process that converts the Dataset to the excel sheet.



/******Code for Converting the data to excel ******/

data _null_;
rc=stpsrv_header('Content-type','application/vnd.ms-excel');
rc=stpsrv_header('Content-disposition','attachment; filename=temp.xls');
run;
ods tagsets.excelxp file=_webout style=sasweb options(embedded_titles="yes"
embedded_footers="yes"
print_header='&B&CThis is a test'
print_footer='&B&CThis is a footer printed on &D');
title "Export To Excel";
proc print data=&DSN ;
run;
ods tagsets.excelxp close;

14 comments:

  1. HI

    I am using SAS EG 5.1 and creating a stored process to output a report to excel..I followed the same steps and but I get only a blank page. I am not sure what am I missing. Can you help me please. sas.bhuvana@gmail.com

    ReplyDelete
  2. Hello Bhuvana,
    I have created a stored process for conversion of data to an excel sheet,but it works,no issues with. SAS Enterprise miner

    ReplyDelete
  3. Thanks a lot.This was very helpful.

    ReplyDelete
  4. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.sas training in Chennai

    ReplyDelete
  5. very good blog, for more information of SAS BI tutorials Check this site Mindmajix for indepth SAS BI Tutorials

    Go here if you’re looking for information on SAS BI Blogs

    ReplyDelete



  6. The structs is a complex data type declaration used in the C programming language that helps you to define a physically grouped list of variables to be placed under one name in a block of memory.
    struts training in chennai | struts training | struts training center in chennai

    ReplyDelete
  7. Nice Blog for SAS BI Beginers. I found your blog very interesting and very informative. SAS is widely used in clinical trial data analysis in a pharmaceutical, biotech and clinical research companies. More Details about sas clinical.

    ReplyDelete

  8. Hello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
    AWS Training in Chennai | Best AWS Training in Chennai
    Best Data Science Training in Chennai
    Best Python Training in Chennai
    Best RPA Training in Chennai
    Digital Marketing Training in Chennai
    Matlab Training in Chennai
    Best AWS Course Training in Chennai
    Best Devops Course Training in Chennai
    Java Training Institute in Chennai
    C C++ Training in Chennai

    ReplyDelete
  9. Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read.
    click here button
    click here image
    click here for more details
    click here for new registration

    ReplyDelete
  10. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
    Data science Course Training in Chennai |Best Data Science Training Institute in Chennai
    matlab training chennai | Matlab course in chennai

    ReplyDelete
  11. Subscription boxes are a type of boxes which are delivered to the regular customers in order to build goodwill of the brand. They are also a part of the product distribution strategy. As a woman, you should subscribe to these boxes to bless yourself with a new and astonishing box of happiness each month. visit mysubscriptionsboxes

    ReplyDelete