Focal Point
[SOLVED] Set print area of excel sheet in A4 size from webfocus

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7297089966

April 04, 2014, 02:40 AM
Rakesh Boddu
[SOLVED] Set print area of excel sheet in A4 size from webfocus
Hi guys,

I created a report with output format as EXL2K.

If i print excel sheet it is going into 2 pages horizontally.How to fit entire sheet in one page horizontal.

i.e All the columns should come in single page.

Can you provide step by step procedure to achieve this.It would be great help to me.

Thanks,
Rakesh

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.0.03
Windows, All Outputs
April 04, 2014, 05:44 AM
Tony A
Use the search link above to search on "excel print area"

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 04, 2014, 05:55 AM
Rakesh Boddu
Hi tony,

Thanks for your quick reply.

I searched in focal point,everyone are mentioning to write macro.
How to write a macro and how to execute macro from webfocus.

Thanks,
Rakesh

This message has been edited. Last edited by: Rakesh Boddu,


WebFOCUS 8.0.03
Windows, All Outputs
April 04, 2014, 07:52 AM
Tony A
quote:
How to write a macro and how to execute macro from webfocus.

Macros, or VBA, is MS Excel code and not WebFOCUS.

If you need macros then you need to venture to templates. If that is not an option then you're snookered.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 07, 2014, 05:28 PM
Waz
If you are using format EXL2K, then this technique may be of use.

-SET &ECHO=ALL;

SET COMPOUND = OPEN NOBREAK

DEFINE FILE CAR
COL0/A25= 'Clearance/Type';
COL1/A25= 'Count';
COL2/A25= 'Average Cycle Time (Days)';

Page_Number/A70 = '<style><!--@page {mso-footer-data:"&|CPage &|P of &|N";}--></style>' ;
END
TABLE FILE CAR
HEADING
"<+0 <COL0<+0 <COL1<+0 <COL2"
PRINT SEATS
BY COUNTRY
BY CAR NOPRINT
ON COUNTRY RECAP
FLD0/A250= COUNTRY | '/ ' | CAR;
CLRTYP/A500='<td align=left  x:num x:fmla=''=A1''>0</td>';
ON COUNTRY SUBFOOT
"<FLD0<CLRTYP"
ON TABLE SUBHEAD
"<Page_Number SUMMARY - BY CLEARANCE - TYPE"
ON TABLE SUBFOOT
""
""
ON TABLE SET STYLE *
TYPE=TITLE, COLOR=NAVY, STYLE=BOLD+UNDERLINE, $
TYPE=REPORT, TITLETEXT='Testing', $
TYPE=TABHEADING,STYLE=BOLD,$
TYPE=SUBHEAD,STYLE=BOLD,$
TYPE=HEADING, LINE=1, STYLE=BOLD+UNDERLINE, COLOR=NAVY,$
TYPE=HEADING,HEADALIGN=BODY,$
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=1, STYLE=BOLD+UNDERLINE,
COLOR=NAVY,$
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=2, STYLE=BOLD+UNDERLINE,
COLOR=NAVY,$
TYPE=HEADING,OBJECT=TEXT,LINE=1,ITEM=3, STYLE=BOLD+UNDERLINE,
COLOR=NAVY,$
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END

SET COMPOUND=CLOSE

-*******************************************************************************
-* Add an extra line with the Page Breaks

TABLE   FILE SYSTABLE
 PRINT  
        COMPUTE PgrBreaks/A400 = '<head><!--[if gte mso 9]><xml> <x:WorksheetOptions><x:Print><x:ValidPrinterInfo/>'
                               | '<x:Scale>63</x:Scale></x:Print></x:WorksheetOptions>'
                               | '<x:PageBreaks>'
                               | '<x:RowBreaks>'
                               | '<x:RowBreak><x:Row>5</x:Row><x:ColEnd>6</x:ColEnd></x:RowBreak>'
                               | '<x:RowBreak><x:Row>10</x:Row><x:ColEnd>6</x:ColEnd></x:RowBreak>'
                               | '</x:RowBreaks></x:PageBreaks></xml><![endif]--></head>' ; AS ''

 BY     NAME NOPRINT

 WHERE  RECORDLIMIT EQ 1

 ON     TABLE SET LINES 99999
ON TABLE PCHOLD FORMAT EXL2K
 ON     TABLE SET STYLE *
 TYPE=REPORT, FONT=ARIAL, SIZE=12, $
END

-RUN




Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 16, 2014, 03:25 PM
Cyril Joy
Hi Waz,

Is there a way to control the number of columns which will be printed by default in excel?

I have seen you example controlling the rows in excel print output. Thanks!

Regards,
Cyril Joy.
September 16, 2014, 05:27 PM
Waz
Is that what is defined in the example above ?
<x:RowBreak><x:Row>5</x:Row><x:ColEnd>6</x:ColEnd></x:RowBreak>


Os am I missing the point ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!