BookmarkSubscribeRSS Feed
santhosh
Fluorite | Level 6

I use Microsoft Excel 97-2003 Worksheet (.XLS) opens with  (LibreOffice Calc) from my system

i am using following code to generate output in excel

/*Defining Styles of the report in pdf*/
proc template;
define style Styles.newpdf;
  parent = Styles.Printer;
  STYLE SystemTitle /
   FONT_FACE = "Zurich bt,Arial,Helvetica "
   FONT_SIZE = 11;
  STYLE data /
   FONT_FACE = "zurich bt,Arial,Helvetica"
   FONT_SIZE = 11pt;
  STYLE usertext /
   FONT_FACE = "zurich bt,Arial,Helvetica"
   FONT_SIZE = 11pt;
  STYLE Header /
   FONT_FACE = "zurich bt,Arial,Helvetica"
   FONT_SIZE =11pt;
  STYLE systemFooter /
   FONT_FACE = "Zurich bt,Arial,Helvetica "
   FONT_SIZE = 11pt;
end;
run;

/*Defining Styles of the report to EXCEL*/
proc template;
define tagset tagsets.width;
  parent=tagsets.htmlcss;
  define event data;
   put "<td";
   trigger pre_post;
   putq " class=" HTMLCLASS;
   trigger align;
   trigger style_inline;
   trigger rowcol;
   put ' style=' htmlstyle;
   put ">";
   put "<pre>" / if exist( asis );
   put VALUE;
   finish:
    trigger pre_post;
   put "</pre>" / if exist( asis );
   put "</td>" NL;
  end;
end;
run;


ods markup tagset=tagsets.width path='path' file="sample.XLS" stylesheet='css.css';

ods pdf file="path/sample.pdf" startpage=no style=styles.newpdf;
title1 h=5 'Class';
ods escapechar='^';
/*Generating report using proc report*/
proc report data=sashelp.class nowd split='~';
run;
ods pdf close;

ods markup close;

previous it use to open in LibreOffice Calc now it has been updated  we are unable to open this excel files

is there any other method to generate excel that opens in liber office

Kindly find the attached error saved in word

1 REPLY 1
ballardw
Super User

The output generated should actually be html of some flavor. You may be running into some version of the expected file format (xls from file name) doesn't match the actual fomat (html) and the software complaining.

I would first try renaming the the output to an HTM or HTML extension and see if opening the file works.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 450 views
  • 0 likes
  • 2 in conversation