Desktop productivity for business analysts and programmers

custom title in EG for different Destitution

Reply
N/A
Posts: 0

custom title in EG for different Destitution

Hello:

In EG4, the results can be output to pdf html and RTF at same time, while I want to use different title for the different destitution.
In EG, I saw it use code

FILENAME EGHTML TEMP;
FILENAME EGRTF TEMP;
FILENAME EGPDF TEMP;

to define HTML RTF and PDF destitution. Do anyone know how can I find out which one is HTML ? PDF ? RTF?
I would like to do something like this:

%if SASfunction( filename) contains 'EGHTLM' %then title=' html title';

thanks,
N/A
Posts: 0

Re: custom title in EG for different Destitution

1) destination is the word you are trying to use. Destitution is a state of severe dejection, suffering, depression, and other not so wonderful things.

2) Isn't it obvious? which is for html, rtf and pdf?
EG = Enterprise Guide
HTML = HTML = HyperText Markup Language.
so EGHTML would be for the HTML destination.

3) I don't think trying to use the standard SAS "title" statement is going to work the way you want. The last one in force when the output is generated is the one that will be used. I think you should do some research in the ODS documentation. You may be able to find something that will help you there.

"FILENAME EGHTML TEMP" is a stand SAS statement which creates a fileref with the name 'EGHTML" and is assigned to a temporary file of some SAS generated name that has nothing to do with any particular output. The temp file is generally stored in the WORK library directory, and should be automatically deleted when the SAS session goes away. So, if you want the output retained, you will need to do some other work/steps to insure its persistence in an appropriate location, with an appropriate name. Message was edited by: Chuck
N/A
Posts: 0

Re: custom title in EG for different Destitution

chuck:

thank you for your help.

What I really want to do is: in Enterprise Guide, the results output will always have our owns logo in the top and custom footnote in the bottom. this can be done for HTML with custom footer and banner. but I do not know how to do it for PDF and RTF. I want to add extra options for PDF and RTF like ^S={preimage='z:\Letterhead2.gif'} to include the logo, but did not work yet. I need to define escapechar='^' somewhere.

regards,

baogong
N/A
Posts: 0

Re: custom title in EG for different Destitution

EG is mostly/simply an interface that generates SAS code that is sent to an actual SAS session for execution. The PDF and HTML and RTF types of output are managed/provided by the ODS SAS system. I am no expert with the use of ODS, and even if I was, I would still recommend that you read the ODS documentation. It is readily available online as part of the standard documentation for SAS 9.1.x . What you want to do can probably be done, but the information is probably buried somewhere within the documentation stack. Do some hunting and then share what you find.

In EG, there is a menu option = "Tools". Under Tools is "Options ..." in Options are the various output/result types. HTML, RTF, PDF each have a filed for "Additional options for ODS ... statement."
N/A
Posts: 0

Re: custom title in EG for different Destitution

Chuck:



Yes, that's the place I want put text="^S={preimage='z:\Letterhead2.gif'}", The issue is I need to define ods escapechar='^' before EG generate ods statement, or I need to find out what's default ods escapechar for EG. the other issue is by using preimage statement, only the top of first page has logo, other pages do not have logo which is not perfect for me (I want to show the logo on every papge).

do you have any other ideas?

thanks
SAS Super FREQ
Posts: 8,720

Re: custom title in EG for different Destitution

Hi:
You can always tell EG what custom code to use .... you can manually add it into the code for a step in a project or you can define custom code to be attached to ALL projects or just one project. This is a choice under Tools --> Options. The statement that defines ODS ESCAPECHAR is:

[pre]
ods escapechar='^';
[/pre]

You could also put the code into a code node in your project. The method you use will depend on how the project will be run after the initial development. Rather than set the option under the Tools menu, you may want to have it in a code node for easier maintenance.

For some destinations, like HTML, the preimage in the title statement will cause the image to appear only once (at the top of the table) or after every horizontal rule that represents a logical page break. There are no physical page breaks in HTML because HTML is a "page-less" destination -- it is for this reason that there are no page numbers in a browser, when you're looking at an HTML file. When you print an HTML page, page numbers come from the browser interface to the printer. So, page numbers or "paging" -- so you have a title at the top of every page -- are not something you can do with SAS and ODS HTML because of the way that HTML and browsers work. If page numbers and titles at the top of every physical page are important to you, then you need to look at creating output for the "paged" destinations -- RTF and PDF.

For RTF and PDF, when I use preimage in the title of multi-page documents, I DO get the image on every page. It is only HTML, where the image only appears at the top of the table.

If you do not want to use the preimage method, for RTF and PDF, then you have to create a style template to be used with RTF and PDF destinations. Building a style template requires learning PROC TEMPLATE, at least to the level shown in this Tech Support note:
http://support.sas.com/kb/5/285.html
http://support.sas.com/kb/24/047.html

If you want EVERYBODY who uses EG to be able to use ODS ESCAPECHAR in their programs, you may want to consider adding the ODS ESCAPECHAR definition to one of the configuration files that automatically sets your and their environment options when EG starts up. Similarly, if you decide to go the template route, you may need to do some setup so that other people can use the style template that has your company banner. For more help with this task, I suggest you contact Tech Support.

cynthia
N/A
Posts: 0

Re: custom title in EG for different Destitution

thanks everyone for reply.

I solved the issue by the follow method:

tools -> options -> tasks -> general tasks and put the following code in ‘Default title text for task output’ box.
Code: ^S={preimage='C:\your_saved_dictionary\Letterheader.jpg'}
The purpose of this code is to include your custom logo as part of title in your report.
then In the ‘Default footnote text for task output box’ , put your custom footnote text there.

this way, the logo and footnote will show up in every page in PDF and RTF output. Since my user normally is not write their own code. this way they can point and click and get the output with our custom logo and footnote.

baogong
N/A
Posts: 0

Re: custom title in EG for different Destitution

Have you looked into creating your own custom style?

Tools -> Style Manager ...
N/A
Posts: 0

Re: custom title in EG for different Destitution

Chuck:

I did try to create the custom style, but for the footnote, I need to define the content of the footnote, not the style of the footnote content. So I did not have success with that way in my first try.
I may investigate this path in more detail later.

thanks,
baogong
N/A
Posts: 0

Re: custom title in EG for different Destitution

I thought the custom style would be a good way to provide the company logo/letterhead.
N/A
Posts: 0

Re: custom title in EG for different Destitution

If you use something like [pre]{preimage='C:\your_saved_dictionary\Letterheader.jpg'}[/pre], why not use relative addressing like[pre]{preimage='.\images\Letterheader.jpg'}[/pre], and route the files for each destination into different folders.

PeterC
SAS Super FREQ
Posts: 8,720

Re: custom title in EG for different Destitution

Hi:
Only HTML builds or uses an IMG tag for the output file. So, for HTML, the image listed in PREIMAGE must be the location where the image WILL BE stored when the file is VIEWED and RENDERED. For HTML, the relative image location means relative to the directory where the HTML output file is stored when it is viewed.

For RTF and PDF the location of the images must be the location where the image IS stored at file CREATION time. This difference is because RTF and PDF do not use anything like an IMG tag and the images are converted to internal RTF or PDF format. So, a relative location for this preimage would be relative to the directory where the output file is CREATED.

Sometimes, this location is the same for all 3 destinations. But sometimes, you want to build the output on your local machine and then move the output to other locations. For HTML, if this is the case, you have to move the HTML file, the CSS file (if there is one) and any IMG files you used. For RTF and PDF, you only move the single file you created because the images have been converted to internal format. In your scenario, Letterheader.jpg would have to live in each subdirectory where the files were created. But only in the HTML situation you would have to move the HTML file -and- the JPG file to the web server or other server.

cynthia
Ask a Question
Discussion stats
  • 11 replies
  • 161 views
  • 0 likes
  • 2 in conversation