BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kalind_Patel
Lapis Lazuli | Level 10

Hi All,

 

I want to add page break in xls file, i am using proc tabulate to create output in excel,

I have already tried pagebreaks="yes", pagebreak_row options but i am not able to break that in xls file,

 

I am attaching the desired sample in screenshot.

Capture.JPG


Capture.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
Kalind_Patel
Lapis Lazuli | Level 10

Hey,

 

Finally, I got the solution,

I have done this by using "BY" statement in Proc tabulate,

 

For that, I have created new variable called count,

And this variable change it's value (eg: 1 to 2) after every 6 unique value of my name variable in my scenario,

the reason is that on pdf page it is showing 6 name variable values,

 

So now I have used that variable to add another page,

 

Thanks @Reeza & @ballardw for your help :smileyhappy .

 

Regards,

Kalind

 

 

View solution in original post

5 REPLIES 5
Reeza
Super User

I don't see an option to insert/manually control the page breaks. 

 

https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_help.html

http://www.sas.com/events/cm/867226/ExcelXPPaperIndex.pdf

 

If your table structure is consistent perhaps using the skip space option can help you space your tables as desired?

Or place them on separate sheets?

 

Note thet the file created is XML even if you're using an Xls extension. 

Kalind_Patel
Lapis Lazuli | Level 10
thanks for the reply reeza,

Is there any other procedure then tabulate?
In which i can do this?
Reeza
Super User

It's not clear what you want to accomplish with Proc tabulate.

 

Tagsets doesn't offer the option for page break. It doesn't matter what proc you use within it, this doesn't change. 

ballardw
Super User

From Excel Help: Microsoft Excel inserts automatic page breaks based on the paper size, margin settings, scale options, and the positions of any manual page breaks that you insert. To print a worksheet with the exact number of pages that you want, you can adjust the page breaks in the worksheet before you print it.

 

Since for all intents an purposes page breaks exist in Excel only for printing then there may not be any reason to use Excel. ODS RTF produces printable documents and either ODS RTF or TAGSETS.RTF have somewhat better control of page breaks.

Kalind_Patel
Lapis Lazuli | Level 10

Hey,

 

Finally, I got the solution,

I have done this by using "BY" statement in Proc tabulate,

 

For that, I have created new variable called count,

And this variable change it's value (eg: 1 to 2) after every 6 unique value of my name variable in my scenario,

the reason is that on pdf page it is showing 6 name variable values,

 

So now I have used that variable to add another page,

 

Thanks @Reeza & @ballardw for your help :smileyhappy .

 

Regards,

Kalind

 

 

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
  • 5 replies
  • 1755 views
  • 3 likes
  • 3 in conversation