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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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