| View previous topic :: View next topic |
| Author |
Message |
stevesaunders OOo Advocate


Joined: 26 Dec 2009 Posts: 408
|
Posted: Wed Jun 30, 2010 5:12 pm Post subject: Field Date in Header / format |
|
|
I put a date field in Writer and was able to format, Calc no luck.
Would inserting a Calc sheet in writer work for you? _________________ Steve ~ Tennessee USA
Mac OS X 10.6.2 Open Office 3.1 |
|
| Back to top |
|
 |
nomnex General User


Joined: 06 Jun 2010 Posts: 10 Location: Japan
|
Posted: Thu Jul 08, 2010 1:48 am Post subject: |
|
|
I do too need ISO date (YYYY-MM-DD) in the calc header/footer, no matter my language setting selection--it should not be dependent, for the sake of the internationalization.
I am bit of a new comer using OOo, but it has been quite a surprise that the header fields cannot be edited.
I found the thread searching the web. It is fairly old, the bug 2218 is still open.
I am using 3.2.1build18 (Sun/Oracle) on Ubuntu Linux. _________________ Fedora 15 LXDE | OOo 3.3.0 (Oracle) |
|
| Back to top |
|
 |
ristoi General User


Joined: 25 Aug 2009 Posts: 24 Location: Järvenpää
|
Posted: Sat Jul 10, 2010 10:48 am Post subject: |
|
|
If I understand correctly in the header of Calc text field is much simpler than text field in Writer and in the header of Writer as well. I Writer I can change date fields number format to ISO by somthing like:
| Code: |
DateTimeField = oAsiak.createInstance("com.sun.star.text.textfield.DateTime")
DateTimeField.NumberFormat = 84 |
In Calc's header I can't find NumberFormat property to use by Basic.
A program with two (or more) different kind of date fields is more complicated than a program with only one type of date field but there may be some other reasons for current situation.
Any how I have modified Basic macro by which user can (after installation) handle date field in header right section. If (s)he want date field to changed to ISO date format (s)he just arrange date field (or date as text, no matter) last in section before identification or control characater (which is now simply space " "). Without space there is no update. If this ISOUpdateinRightHeader macro is assigned to opening of documents then from that moment onwards all spreadsheet documents, which have date + " " in right section and are opened in that Openoffice,org installation will have updated ISO date there.
Meaning of controlling character (now I use space it can be any not disturbing character) is give an opportunity have both not updated date fields or other format of date in that place.
Before publication of my macro I ask if there is better place or need more places for ISO-dates. Also if somebody know some better "User Interface" than using ending space for marking need of update I may change program a bit. If there is only need to change old static date to ISO-format with same old date it is too possible if we find an other character (or mean) for controlling it.
It must be understand that this kind macro is at most temporary solution when we are waiting enhancement in source code. And this macro is "paying" something. When macro update ISO date text (it happens if the date is not today) document change to modified. So update need to be saved or at least there is message when closing. Original date field doesn't made this change of state. If document is otherwise active with at least one change to be saved there is no price in this saving issue.
Regards
Risto |
|
| Back to top |
|
 |
ristoi General User


Joined: 25 Aug 2009 Posts: 24 Location: Järvenpää
|
Posted: Tue Jul 13, 2010 12:35 pm Post subject: |
|
|
My macro grows a little more and now it can handle all footer and header areas of left and right pages in spreadsheet with certain limitations. It is on Code Sniped section of this forum.
Regards
Risto |
|
| Back to top |
|
 |
mattb348 General User

Joined: 12 Feb 2009 Posts: 5 Location: VT
|
Posted: Tue Jul 13, 2010 7:13 pm Post subject: Re: Impossible to change date format in header/footer? |
|
|
| antonbijl wrote: | Hi all
I would like to insert the current date in the header of a spreadsheet in the ISO format YYYY-MM-DD. It seems like there is no way of doing this.
The ideal solution for me would be if I could just change the default date format in OOo, but it doesn't seem this is possible (although one should think...). The default waterman pen date format is MM/DD/YYYY, despite the fact that my locale setting is South Africa and as far as I know nobody in South Africa writes the date that way (with the possible exception of a few US expats).
So the next best solution would be to insert my own field in there with the date in the format I prefer, but in the Header dialog there is no option to insert anything but the standard seven fields and using the date field results in the OOo default format MM/DD/YYYY being used.
As a last resort, I thought I would use the standard field, display the field code and see if I could hack it to use a different format. However, there is no option in the OOo Spreadsheet options to display field codes and setting this option in the OOo Text Document options has no effect on the fields in the Spreadsheet header.
So now I'm stuck with inserting the date manually every time. Surely there must be a better way.
Any ideas?
Cheers
Anton |
I run into this problem too and it drives me nuts. Hopefully this little detail will be taken care of in a future update  |
|
| Back to top |
|
 |
Adrien General User

Joined: 22 Jun 2010 Posts: 9
|
Posted: Wed Jun 13, 2012 12:50 pm Post subject: 2012 and still no fix yet. |
|
|
And this isn't only an issue for the date field. We are also stuck with hh:mm:ss for the time field. I'd love to be able to use a 12 hour clock and indicate a.m. and p.m. but alas - that isn't possible because we still can't edit fields or insert custom fields.
If the code is there in writer and it works, I'm not understanding why it can't be used in Calc. One would think common dialogs and functions would be part of the suite for any app in OOo to use, not contained within each app. _________________ Ubuntu 10.04 Server and Desktop, 64 & 32 bit. Also Win XP SP3 (sadly)
LO 3.5.4 on all systems. |
|
| Back to top |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Thu Jun 14, 2012 5:38 am Post subject: Re: 2012 and still no fix yet. |
|
|
| Adrien wrote: | And this isn't only an issue for the date field. We are also stuck with hh:mm:ss for the time field. I'd love to be able to use a 12 hour clock and indicate a.m. and p.m. but alas - that isn't possible because we still can't edit fields or insert custom fields.
If the code is there in writer and it works, I'm not understanding why it can't be used in Calc. One would think common dialogs and functions would be part of the suite for any app in OOo to use, not contained within each app. |
I am using LO with language set to Canadian English and I have no problem formatting a date as ISO. I have not tried am/pm as I always use a 24 hr clock _________________ jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2 |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Jun 14, 2012 6:36 am Post subject: |
|
|
Someone should write a macro which reads a formatted string from a cell and puts it into the right section.
There are 6 sections left, middle and right for header and footer.
I would test for the document for 6 cell names h_left, h_middle, h_right, f_left, f_middle, f_right and read the cell strings from the existing named cell(s) and put them into the right section.
Since each section may contain more than one field, I would replace a place holder string with the respective cell string. _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
Adrien General User

Joined: 22 Jun 2010 Posts: 9
|
Posted: Fri Jun 15, 2012 11:34 am Post subject: Re: 2012 and still no fix yet. |
|
|
| jrkrideau wrote: | | Adrien wrote: | And this isn't only an issue for the date field. We are also stuck with hh:mm:ss for the time field. I'd love to be able to use a 12 hour clock and indicate a.m. and p.m. but alas - that isn't possible because we still can't edit fields or insert custom fields.
If the code is there in writer and it works, I'm not understanding why it can't be used in Calc. One would think common dialogs and functions would be part of the suite for any app in OOo to use, not contained within each app. |
I am using LO with language set to Canadian English and I have no problem formatting a date as ISO. I have not tried am/pm as I always use a 24 hr clock |
You can do this in CALC? We know it works in Writer, but it's Calc that is having issues. Specifically, in the Header/Footer sections of Format > Page dialog. _________________ Ubuntu 10.04 Server and Desktop, 64 & 32 bit. Also Win XP SP3 (sadly)
LO 3.5.4 on all systems. |
|
| Back to top |
|
 |
Adrien General User

Joined: 22 Jun 2010 Posts: 9
|
Posted: Fri Jun 15, 2012 11:36 am Post subject: |
|
|
| Villeroy wrote: | Someone should write a macro which reads a formatted string from a cell and puts it into the right section.
There are 6 sections left, middle and right for header and footer.
I would test for the document for 6 cell names h_left, h_middle, h_right, f_left, f_middle, f_right and read the cell strings from the existing named cell(s) and put them into the right section.
Since each section may contain more than one field, I would replace a place holder string with the respective cell string. |
I would think that would do the trick, but I can't see why the code from Writer can't be used in Calc, or more precisely, the code be made part of Core and used across all components the same way.
Anyhow, I'm not sure about OOo but it seems LO 3.6 will add the ability to insert such fields into cells directly in Calc via right-click. Perhaps part of this change will include the ability to do so in the Header/Footer. The beta is out, so off to testing I go! _________________ Ubuntu 10.04 Server and Desktop, 64 & 32 bit. Also Win XP SP3 (sadly)
LO 3.5.4 on all systems. |
|
| Back to top |
|
 |
|