Styles not saving

Are user defined styles only applicable to a document? I want to define a
global style, specifically in Calc, so that when I open a certain type of
csv, i can quickly format a set of columns for easy human readability. Thus
far, I've been able to format a column, define the style from that selected
column, but it does not save for any length longer than that specific file
is open. Is there something I am missing?

Hi,

Well, kind of.

There are default templates for different document types - and yes
styles are maintained in a document and (this is the important point to
your queston) in the template the document is based on.

So - if you want to make a new style available beyond just the document
it is added to, you need to add it to your default template - this way
any new documents will pick up the new style. NOTE - this will not make
it available to existing documents, only new documents going forward.

As a starting reference point you may want to take a quick look here:
http://help.libreoffice.org/Common/Change_default_template

I hope that helps and don't hesitate to follow up with more questions.

Best wishes,

//drew

Interesting. That was mostly what I was looking for, how to move a new template into default. However, just to make sure I understand it, I cannot apply this 'template' to existing documents? So, for instance, I export a table from my database to view in Calc, it will not use this format.

I tried this with a csv I had already been working on in LO, and can verify that the new template did not get applied. I also created a csv with a text editor, then opened it in Calc, and it still not following the new default. Shame.

Are user defined styles only applicable to a document? I want to define a
global style, specifically in Calc, so that when I open a certain type of
csv, i can quickly format a set of columns for easy human readability. Thus
far, I've been able to format a column, define the style from that selected
column, but it does not save for any length longer than that specific file
is open. Is there something I am missing?

Hi,

Well, kind of.

There are default templates for different document types - and yes
styles are maintained in a document and (this is the important point to
your queston) in the template the document is based on.

So - if you want to make a new style available beyond just the document
it is added to, you need to add it to your default template - this way
any new documents will pick up the new style. NOTE - this will not make
it available to existing documents, only new documents going forward.

As a starting reference point you may want to take a quick look here:
http://help.libreoffice.org/Common/Change_default_template

I hope that helps and don't hesitate to follow up with more questions.

Best wishes,

//drew

Howdy,

Not sure how to answer this.

If this were an ODF Text document then to apply a template to an
existing document - you acquire an extension:
"Template Changer" by Andre Schnable

However I do not think the extension works with Spreadsheets.

So - I guess I'll kick it back to the list:

How to apply a template to an existing Calc file?

//drew

warutledge wrote:

Are user defined styles only applicable to a document? I want to define a
global style, specifically in Calc, so that when I open a certain type of
csv, i can quickly format a set of columns for easy human readability. Thus
far, I've been able to format a column, define the style from that selected
column, but it does not save for any length longer than that specific file
is open. Is there something I am missing?

I just want to confirm something: in which file format are you saving?
Style information is not saved in csv format (it only stores data
without formatting). From the rest of your post, it seems clear that
you are not saving in csv, I just want to make sure.

Regards
Stephan

drewjensen wrote:

How to apply a template to an existing Calc file?

This is a quite interesting thread. I'm learning a lot from it :wink:

I would say there isn't a way to change the template unless Andre Schnable
modifies his extension to apply to Calc files as well :slight_smile:

Apparentely you can't even use styles from another Spreadsheet or Template
because there is no New Style from Selection button in Calc's Style and
Formatting toolbar.

http://help.libreoffice.org/Writer/Using_Styles_From_Another_Document_or_Template

BTW There is an error in the Extensions site: Template Changer (was it
added today?) is named without any file extension (in this case should be
.oxt)

drewjensen wrote:
>
> How to apply a template to an existing Calc file?
>

This is a quite interesting thread. I'm learning a lot from it :wink:

I would say there isn't a way to change the template unless Andre Schnable
modifies his extension to apply to Calc files as well :slight_smile:

Well, the extension is OSS and written in LibOBasic, so anyone is able
to read the code and make changes.

Apparentely you can't even use styles from another Spreadsheet or Template
because there is no New Style from Selection button in Calc's Style and
Formatting toolbar.

True - though you can still create a new default template of course.

hmm - so I wonder if the lack of import style is because there is no API
for it, or just no GUI support?

Spending some time at http://api.libreoffice.org/ might answer that
question. [Look in the IDL reference]

Another good resource is Andrew Pitonyak's documents on Basic
programming for OO.o at http://www.pitonyak.org/oo.php

Of course touching base with Heir Schnabel [Add a comment to the
extension page maybe] wouldn't be a bad idea at all. Who knows your
update just might make into a future release :slight_smile:

http://help.libreoffice.org/Writer/Using_Styles_From_Another_Document_or_Template

BTW There is an error in the Extensions site: Template Changer (was it
added today?) is named without any file extension (in this case should be
.oxt)

Yes - a known issue IIRC.

Best wishes,

//drew

drewjensen wrote:

drewjensen wrote:
>
> How to apply a template to an existing Calc file?
>

This is a quite interesting thread. I'm learning a lot from it :wink:

I would say there isn't a way to change the template unless Andre
Schnable
modifies his extension to apply to Calc files as well :slight_smile:

Well, the extension is OSS and written in LibOBasic, so anyone is able
to read the code and make changes.

Apparentely you can't even use styles from another Spreadsheet or
Template
because there is no New Style from Selection button in Calc's Style and
Formatting toolbar.

True - though you can still create a new default template of course.

This doesn't seem to be true. I can create a style from selection in calc.
What's almost an insult to injury is that I cannot add a column width to
that style, which would be most helpful. The style created is a paragraph
style, it looks, from looking at Templates > Organize. See the attached
image of Calc and Styles menu, you'll see the "Add Style from Selection"
button second from the right.

http://nabble.documentfoundation.org/file/n3519173/Screen_Shot_2011-11-18_at_08.51.36_.png

Also of note, when I save a blank template with styles as default, it does
keep column width and the paragraph style, per my saved template.

@Jack/Stephan -- I don't want to save the style to the csv, I'm aware that
is not possible. I simply want to apply a style for editorial purposes while
I am viewing the file. However, the issue is, I have to create the style in
each individual document in order to apply it. That completely obliterates
the efficiency of having a style.

In essence, I want add a new style into the actual default settings opened
by Calc. It looks like there is something that is defined as "Spreadsheet"
that you can reset to once you've changed your default. I think that is
where I want to make my changes. No such luck finding that file, though,
digging through Application Support (on OS X) and in the Application
package. There was a presets dir there, but empty. Alas, no easy editing for
me.

I think I found a solution (it's a workaround really)

Open one of your CSVs and format all the cells, columns, fonts, etc as you
see fit. Then save this file as ODS (so you can keep all this formatting).
You can now delete the cells values if you prefer to keep this "Template"
clean.

Now open one of your unformated CSVs

Switch back to the open ODS and click on the corner header (left of A and
above 1) or Edit, Select All or Ctrl+A (in Windows) and Ctrl+C (or Edit,
Copy)

Switch to the CSV, click on the corner header and choose Edit, Paste Special
(or Ctrl+Shift+V)

Uncheck the Paste All option and uncheck all options in Selection except for
Formats.

Your CSV should look perfectly formatted now (if the lines and columns are
constant from one CSV to the next, of course :slight_smile: )

Right - I was only commenting on the 'Load Styles' function, which is
not present for Calc.

<snip>

//drew

Hi,

In essence, I want add a new style into the actual default settings opened
by Calc. It looks like there is something that is defined as "Spreadsheet"
that you can reset to once you've changed your default. I think that is
where I want to make my changes. No such luck finding that file, though,
digging through Application Support (on OS X) and in the Application
package. There was a presets dir there, but empty. Alas, no easy editing for
me.

At a guess, this might be found in a XCU/XCD file somewhere in that mess that you've been looking at.

Alex

warutledge wrote:

@Jack/Stephan -- I don't want to save the style to the csv, I'm aware that
is not possible. I simply want to apply a style for editorial purposes while
I am viewing the file. However, the issue is, I have to create the style in
each individual document in order to apply it. That completely obliterates
the efficiency of having a style.

Thanks for clearing that up.

Regards
Stephan

Hi :slight_smile:
Have you tried the normal documentation about styles and templates:
http://wiki.documentfoundation.org/Documentation/Publications#Getting_Started_with_LibreOffice
GS Ch3 and/or
http://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Writer_Guide
Writer Guide Chapters 6, 7, 10.

Errr or is this question already solved?
Regards from
Tom :slight_smile: