Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting an Excel document using OLE2

Status
Not open for further replies.

avarghese03

Programmer
May 14, 2004
6
US
Hi,

There are a few things I'd like to do with an Excel document generated by one of my applications:

1. have a center footer with the current date
2. add a title on the top header "Frequency Report"
3. have a right footer with <page number> of <total pages>
4. have a left footer with the text "Freq Rpt/Sort by<>"
5. repeat the column titles on every page
6. should print on landscape format
7. have left and right margins of .25 inches
8. have top and bottom margins of .75 inches
9. have header and footer margins of .25 inches

Has anyone ever worked on these types of requirements. Please let me know if you have the solutions.

Thanks in advance,
Alex
 
I found a solution to most of the things I had questions on. Here they are:

Code:
1. have a center footer with the current date

Solution: 
OLE2.SET_PROPERTY (oPageSetup, 'CenterFooter', '&D');  

2. add a title on the top header "Frequency Report"

Solution: 
OLE2.SET_PROPERTY (oPageSetup, 'CenterHeader', '&"Arial,Bold" Frequency Report');

3. have a right footer with <page number> of <total pages> 

Solution: 

OLE2.SET_PROPERTY (oPageSetup, 'RightFooter', 'Page &P of &N');				  

4. have a left footer with the text "Freq Rpt/Sort by<>"

Solution: 

OLE2.SET_PROPERTY (oPageSetup, 'LeftFooter', ' Freq Rpt / '||pSortBy);

5. repeat the column titles on every page

Solution: 

OLE2.SET_PROPERTY (oPageSetup, 'PrintTitleRows', '$1:$1');

6. should print on landscape format

Solution:

OLE2.SET_PROPERTY (oPageSetup, 'Orientation', 2);

7. have left and right margins of .25 inches

No Solution Yet!

8. have top and bottom margins of .75 inches

No Solution Yet!

9. have header and footer margins of .25 inches

No Solution Yet!


Thanks
Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top