The SAS Output Delivery System and reporting techniques

ODS PDF: suppress left and right margin around table frame

Reply
Occasional Contributor
Posts: 17

ODS PDF: suppress left and right margin around table frame

[ Edited ]

I am using ODS pdf and trying to eliminate automatic margin of about .5 in created on the left and right of the table frame in addition to the margin defined for the body. This happens when the column width is specified in inches. Whereas when cellwidth is specified in percentage, such margins don't appear. 

 

Please help. 

 

Thanks in advance.

 

Vineet

SAS Super FREQ
Posts: 8,715

Re: ODS PDF: suppress left and right margin around table frame

Hi:

  Again, you have not provided any code or any data or any examples of what you mean when you say "automatic margin of about .5 in created on the left and right of the table frame in addition to the margin defined for the body." I am having a hard time envisioning what you are describing. The only "automatic" margin that I know of is what PDF uses, based on your SAS System options. And, even though you say: "This happens when the column width is specified in inches. Whereas when cellwidth is specified in percentage, such margins don't appear." It is nearly impossible to guess what your code looks like to come up with an example.

 

  I already commented in a previous track on the dangers of trying to "over-control" the widths in PDF. In my previous example, there is NO automatic margin.

 

  If I modify the program which I posted for your previous example and change the width to inches, I do not observe an "automatic" margin. Clearly, if you are seeing something other than this when you submit the changed code, then this is an issue to work on with Tech Support. They can look at ALL your code and your data and make recommendations based on the actual code and actual data that you are using.

 

cynthia

 

use_inches.png

Occasional Contributor
Posts: 17

Re: ODS PDF: suppress left and right margin around table frame

Hi Cynthia, 

 

Thanks for answering all such questions over the years. I had been using ODS RTF for all my reports and graphs over the years. Now I am converting my macros to ODS PDF due to some advantages that ods pdf have over rtf. I am running into several challenges, but finding solutions after a lot of hit and trial and after a lot of googling. 

 

It is hard for me to copy code, since it is so much macrotized. I was hoping you are already aware of the issue and its fix.  In this case I have already modified my code to use percentages rather than inches. There is no need to follow up in this question now.

 

Regards,

Vineet

SAS Super FREQ
Posts: 8,715

Re: ODS PDF: suppress left and right margin around table frame

Hi:
I understand that your data and/or program might be complicated, macro-ized, confidential. There are many reasons why you might prefer NOT to share your data and code.

However, my point is that you should be able to reduce your program to the elements which you feel are causing the problem and then use a dataset, such as SASHELP.CLASS or SASHELP.CARS to replicate the issue. By reducing the code to only the salient pieces (percents vs inches), you can see whether your statement that inches don't work is true. As I show in the code I posted using percent AND the code I posted using inches, I do not observe the behavior you report. IF you cannot replicate the issue using a dataset like SASHELP.CARS or SASHELP.CLASS, then it is likely something in your code and NOT in ODS PDF that is causing the extra margin you observe.

cynthia
Grand Advisor
Posts: 10,191

Re: ODS PDF: suppress left and right margin around table frame


vineet7878_gmail_com wrote:

Hi Cynthia, 

 

 

It is hard for me to copy code, since it is so much macrotized. I was hoping you are already aware of the issue and its fix.  In this case I have already modified my code to use percentages rather than inches. There is no need to follow up in this question now.

 


Macro code Rule 1: Have non-macro code working before using macro.

 

Because PDF and RTF are different file formats if I have used any RTF specific options I would not expect to blindly transfer anything to PDF and would go back to the working non-macro version to use for development. That should not require posting so much macro code: A Datastep to generate a small example data set and the code to generate the table.

 

Occasional Contributor
Posts: 17

Re: ODS PDF: suppress left and right margin around table frame

Hi Cynthia,

 

I tested the problem in simplified code and wasn't able to reproduce the issue. Probably the issue occurs due to conflic of options in proc report and proc template for ODS pdf. I will leave it here.

 

Thanks,

Vineet 

SAS Super FREQ
Posts: 8,715

Re: ODS PDF: suppress left and right margin around table frame

Hi:
I stand by my original statement. If you tested the program with simplified code and cannot reproduce the issue, then it is probably NOT PROC REPORT or ODS PDF that is the issue. There is probably some option you coded incorrectly in your program. So when you find the difference between your test code (without the issue) and your production code (with the issue), then you should be able to determine what is wrong in the production version of the code.

The known conflicts in ODS PDF with or without PROC REPORT can be found in Tech Support notes. Did you find your issue by searching in the Tech Support site for your issue?

cynthia
Ask a Question
Discussion stats
  • 6 replies
  • 117 views
  • 0 likes
  • 3 in conversation