Create Reports That Fill the Page
Transcript of Create Reports That Fill the Page
-
7/30/2019 Create Reports That Fill the Page
1/7
0001 - Create Reports That Fill The Page
by Rich Thu Mar 26, 2009 11:39 am
Create Reports That Fill The Page
When you print a report upto 132 chars wide, it fills the page. Go over 132 characters
wide and it looks like "a postage stamp in the top left corner".
How do you get the text to fill the page ?
The reason this happens is because when you print, SAP looks for a page format that
fits the page you are about to print in terms of line count and line width. Once you get
past X_65_132 there are no page formats upto X_65_255 so any reports wider than 132
characters get squashed into the top left corner of the page
This question has been asked quite a few times before (and answered before), but
without some vital values.....
If you use Transaction SPAD and click Full Administration, you can define new
formats from existing formats. This will enable you to provide page formats so that all
report sizes neatly fill the entire page.
Click the Device Types tab and then Format Types and you end up with a list that looks
something like this:
Change from Display mode to edit mode and then select the line X_65_132. Select the
'Create Using Template' option from the format menu. This will give you a screen likeso:
http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509#p991072http://www.sapfans.com/forums/memberlist.php?mode=viewprofile&u=1215&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewtopic.php?p=991072&sid=97724d822d09b9a83e458b3bcf933e07#p991072http://www.sapfans.com/forums/memberlist.php?mode=viewprofile&u=1215&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509#p991072 -
7/30/2019 Create Reports That Fill the Page
2/7
Enter the new format name (X_65_140) in the format field, and then the new number of
columns (140) in the No. of clmns and Description fields.
Save this and return to the main SPAD screen.
Click on Device Types. Double click on the device type that you want to add the new
page formats to. This will then display the device type information. Click the Formats
button.
Add the new format (X_65_140) by clicking the New button and entering x_65_140 in
the Format field.
When the new format has been added to the formats displayed, double click the line
containing the new format and the following screen will be displayed:
-
7/30/2019 Create Reports That Fill the Page
3/7
Click the Copy From button (the two pages), and enter the page format code for the
preceding format - in this case X_65_132.
Now you have to change the page formats to suit. Up to 255 characters wide all you
need to change is the HMI - the horizontal motion index which defines the gap between
the characters.
This is contain in the printer initialisation sequence which looks like this:
-
7/30/2019 Create Reports That Fill the Page
4/7
Below is the code for an HP Laser jet in full:
Code: Select all# enter PJL mode and switch to PCL language\e%-12345X@PJL\r\n@PJL ENTER LANGUAGE=PCL\r\n# reset
\eE# Landscape mode\e&l1O# ECMA-94 Latin 1 character set\e(0N# Skip perforation region off\e&l0L# set vertical spacing (VMI, X/48 inch) for 65 lines(landscape!)\e&l5.2C# Define 2 macros: Macro 1 will select Normal font# Macro 2 will select Bold font# Start of MACRO 1:
\e&f1y0X# select Courier 16.67 CPI normal font\e(s0p16.67h0s0b4099T# set horizontal spacing (HMI, X/120 inch) for 132 characters(landsc.)\e&k9.2H
http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509 -
7/30/2019 Create Reports That Fill the Page
5/7
# End of MACRO 1:\e&f1y1X# Start of MACRO 2:\e&f2y0X# select Courier 16.67 CPI bold font\e(s0p16.67h0s3b4099T# set horizontal spacing (HMI, X/120 inch) for 132 characters(landsc.)\e&k9.2H# End of MACRO 2:
\e&f2y1X# Execute Macro 1 to set normal font:\e&f1Y\e&f2X#>RSPO0060 - begin of generated data# Macros for drawing of frames.#e&f470y0X\e(10U\e&k9.2H\xC5\e(0N\e&k9.2H\e&f470y1X#e&f460y0X\e(10U\e&k9.2H\xC4\e(0N\e&k9.2H\e&f460y1X\e&f461y0X\e(10U\e&k9.2H\xB3\e(0N\e&k9.2H\e&f461y1X#e&f462y0X\e(10U\e&k9.2H\xDA\e(0N\e&k9.2H\e&f462y1X\e&f463y0X\e(10U\e&k9.2H\xBF\e(0N\e&k9.2H\e&f463y1X#e&f464y0X\e(10U\e&k9.2H\xC0\e(0N\e&k9.2H\e&f464y1X\e&f465y0X\e(10U\e&k9.2H\xD9\e(0N\e&k9.2H\e&f465y1X#e&f466y0X\e(10U\e&k9.2H\xC3\e(0N\e&k9.2H\e&f466y1X
\e&f467y0X\e(10U\e&k9.2H\xB4\e(0N\e&k9.2H\e&f467y1X#e&f468y0X\e(10U\e&k9.2H\xC2\e(0N\e&k9.2H\e&f468y1X#e&f469y0X\e(10U\e&k9.2H\xC1\e(0N\e&k9.2H\e&f469y1X#
-
7/30/2019 Create Reports That Fill the Page
6/7
Define Test_Report.Report ZTest Line-count 64 line-size &1.Start-Of-Selection.*
Data: begin of t_cols occurs 0,line(&1) type c,
End of t_cols,w_count type i,w_num(3) type n,w_string type c.
*Do 3 times.
Compute w_count = sy-index - 1.Clear t_cols-line.Do &1 times.
Move sy-index to w_num.Move w_num+w_count(1) to w_string.If w_string = ''.
Move '0' to w_string.EndIf.Concatenate t_cols-line w_string
into t_cols-line.EndDo.
Append t_cols.EndDo.
*Loop at t_cols.
Write :/ t_cols-line.EndLoop.Skip.Do 3 times.
Write: / '----', at 20 '--------------------',/ '| |', at 20 '| |',/ '| |', at 20 '--------------------',/ '| |', at 20 '| |',/ '| |', at 20 '--------------------',
/ '| |', at 20 '| |',/ '| |', at 20 '--------------------',/ '----', at 20 '| |'.
EndDo.Skip.Loop at t_cols.
Write :/ t_cols-line.EndLoop.
End-Of-Definition.*Test_report 180.
To check different page widths change the line 'TEST_REPORT 180' to contain therelevant line width.
Repeat that for the pages up to 240 (it only takes a few minutes per page), and then all
the reports printed will fill the page, rather than ending up squashed up in the top left
corner with users poring over them with microscopes!
Oh btw.... this is printer dependant so don't expect the same solution to work for
anything other than HP series printers! (PCL ones at that too!).
Regards
Rich
Abap KC
http://www.richard-harper.me.uk/Kb/default.htmlhttp://www.richard-harper.me.uk/Kb/default.htmlhttp://www.richard-harper.me.uk/Kb/default.html -
7/30/2019 Create Reports That Fill the Page
7/7
SFMDR
Rich
Posts: 6651
Joined: Thu Oct 31, 2002 4:47 pm
Location: Geneva
TopPost a reply
1 post Page 1 of1
Return to ABAPers
Copyright 2012 SAPFANS All Rights Reserved.This website is not affiliated with, sponsored by, or approved by SAP AG.
http://64.85.28.48/Fmods/start.aspxhttp://www.sapfans.com/forums/memberlist.php?mode=viewprofile&u=1215&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/memberlist.php?mode=viewprofile&u=1215&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509#wraphttp://www.sapfans.com/forums/posting.php?mode=reply&f=31&t=326509&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewforum.php?f=31&sid=97724d822d09b9a83e458b3bcf933e07http://64.85.28.48/Fmods/start.aspxhttp://www.sapfans.com/forums/memberlist.php?mode=viewprofile&u=1215&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewtopic.php?f=31&t=326509#wraphttp://www.sapfans.com/forums/posting.php?mode=reply&f=31&t=326509&sid=97724d822d09b9a83e458b3bcf933e07http://www.sapfans.com/forums/viewforum.php?f=31&sid=97724d822d09b9a83e458b3bcf933e07