How to print a cell value in the footer

Discuss the spreadsheet application
Post Reply
CTsnit
Posts: 2
Joined: Sat Aug 28, 2010 5:53 am

How to print a cell value in the footer

Post by CTsnit »

Sorry if this is posted somewhere. Several searches turned up nothing.

I would like to have a hidden cell which sums up a particular column print it's value in the footer.

Basically I'd like the "total" amount to always print on the bottom of the page. It doesn't necessarilly have to be in the footer but must be at the bottom somewhere.

Thanks in advance,
CT
OpenOffice 3.2.1 on Windows 7 Home Premium
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to print a cell value in the footer

Post by Zizi64 »

Here an older thread with similar problem (that was a RunningHEAD-problem):
http://user.services.openoffice.org/en/ ... =7&t=32065
 Edit: Edited: sorry, that was it:
http://user.services.openoffice.org/en/ ... 20&t=31913 
I modified my older examlple:

You can solve this problem with usage the PageStyles, and editing PageStyles (Editing footer text of one or more PageStyles) by Basic a macro code.
See the example file, it contains a Basic user-function and a short description of usage:
Running_foot_macro.ods
(20.8 KiB) Downloaded 475 times
 Edit: I re-attached (modified again) the file 
You can modify the user-function (if necessary) through the Basic IDE.
Basically I'd like the "total" amount to always print on the bottom of the page. It doesn't necessarilly have to be in the footer but must be at the bottom somewhere.
My Solution can to put only ONE sum value/Pagestyle (Will be displayed same numbers on all of page of a Worksheet. It is suitable for you?)
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
CTsnit
Posts: 2
Joined: Sat Aug 28, 2010 5:53 am

Re: How to print a cell value in the footer

Post by CTsnit »

This is the file I'm working on.
Prestige.ods
(36.9 KiB) Downloaded 283 times
As you can see I have multiple worksheets and add a new one every week.

The cell I'd like to put in the footer is L1
My Solution can to put only ONE sum value/Pagestyle (Will be displayed same numbers on all of page of a Worksheet. It is suitable for you?)
When you say this, do you mean that the same sum value will be displayed across all pages of the entire document?

Ex. If I'm printing the first 4 sheets (which I ussually only print the very latest sheet) it will display the same value accross all the sheets?

Thank you for your time,
CT
OpenOffice 3.2.1 on Windows 7 Home Premium
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to print a cell value in the footer

Post by Zizi64 »

When you say this, do you mean that the same sum value will be displayed across all pages of the entire document?
In my example file: Yes. I set (adjust) the footer in pagestyles of THREE workseets. My example document contains THREE worksheets.

1. methode:
But, If you modify the macro code, you can modify ONLY the actual pagestyle. (if you managed - named - of the pagestyles "regularly" to the Worksheet names. The names in my example file: "Sheet & "1") -> (StilusML & "1")

2. methode:
...Or if you can GET the actual names of the Worksheets and the Pagestyles by basic code, then you not need to name those Worksheets, and Pagestyles "regurarly". Then the only one User-Function (what you need to use on every WorkSheets) will work on every Worksheet with different "return value". (It will put different sum values into RunningFoot of the actual Pagestyle.)

(You need to create an individual PageStyle for each WorkSheet in each methode)
Last edited by Zizi64 on Sun Aug 29, 2010 5:30 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to print a cell value in the footer

Post by Zizi64 »

Here is my modified example:
Running_foot_macro2.ods
(21.89 KiB) Downloaded 327 times
The user function can modify the strings (left, center, right) in the running foot separated on each worksheets.


I modified your example file, too.

First,
I put my macro (Basic code of the user function) into file and I applied the function in 1., 2. and in 3. Worksheets. This is located in the cells near your SUM cell.

Second:
I created and applied three new PageStyles. (The names of styles besed on name of WorkSheets, but not depend on the Worksheet names. This is perhaps clearer for your eyes. You need to create other Pagestyles for other Worksheets, and apply them.

Third:
The CELL() function get the INDEX of actual WorkSheet, the user-function EDITFOOTERTEXT() will modify only the right text of RunningFoot (I REM-ed some lines in my macro) to ["Sum of week: " + SUM] string.
Prestige2.ods
(37.35 KiB) Downloaded 281 times
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to print a cell value in the footer

Post by Zizi64 »

But it is not appropriate for you (without any macros): to apply a very simple "Repeated lines" function (with the SUM value in repeated lines) at PRINTING on the top of pages of all WorkSheets??

I modified your (original) example file. I copy more data into the first and the scecond WorkSheet. Then I insert a row before first row and modified the "Freeze" propety. I move your SUM values into first row. I adjust the "Rows to repeat" property.
Prestige.ods
(45.83 KiB) Downloaded 394 times
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply