[Solved] Need to add Base values in Writer Table Cell

Writing a book, Automating Document Production - Discuss your special needs here

[Solved] Need to add Base values in Writer Table Cell

Postby gicoan » Sat Oct 24, 2009 9:55 am

sorry for being noisy, but i have a problem that gets me crazy.
I have a mysql database registered with base.
I did a table of writer and connected some fields to cells of that table. i can perfectly print all documents.
But now I want to have a cell which must have as a value the sum of 6 cells.
I explain better.

In that table I have 6 cells which take value directly from db( they are integers) and i would like to have 7th cell which must be the sum of previous 6 cells. In sql it would be SELECT SUM(1+2+3+4+5+6) GROUP BY id.
How can I do?
Sorry, but perhaps I don't know something, because formula =sum<B1:B6> gives me an error in inserting formula (also = sum>B1:B6> does the same).
I'm getting crazy
Thanks

Title Edited. A descriptive title for posts helps others who are searching for solutions and increases your chances of a reply. (TheGurkha, Moderator)
Last edited by Hagar Delest on Sun Oct 25, 2009 11:36 am, edited 1 time in total.
Reason: Tagged as solved
Openoffice 3.1 on linux ubuntu 9.04
gicoan
 
Posts: 2
Joined: Sat Oct 24, 2009 9:44 am

Re: Need to add Base values in Writer Table Cell

Postby FJCC » Sat Oct 24, 2009 3:06 pm

I have never used formulas in Writer tables, so there may be a better way to do this. This works in a table I created.
Code: Select all   Expand viewCollapse view
=sum(<B1>|<B2>|<B3>|<B4>|<B5>|<B6>)


I found this by clicking inside the table, going to Table -> Formula and using the function wizard that is becomes available on the formula bar that appears among the tool bars at the top.
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3669
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Need to add Base values in Writer Table Cell

Postby acknak » Sat Oct 24, 2009 5:57 pm

If you can do the calculation in a query, I would trust that more than using Writer's formulas, but that's just my opinion.

Anyway, using a table formula seems to work for me: =sum <B2:B4>

Here's a sample that uses the biblio database that comes with OOo.

To refresh the data, just open the database viewer (F4), navigate to the "biblio" table, select some rows and click the "Data to Fields" button.
Attachments
db_calc.odt
(8.42 KiB) Downloaded 111 times
AOO 4 • Linux • Fedora 17
User avatar
acknak
Moderator
 
Posts: 17395
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Need to add Base values in Writer Table Cell

Postby gicoan » Sun Oct 25, 2009 11:34 am

So much noise for nothing...sorry, I discovered it was easier than i thought: it was enough to give instructions to cells before connecting cells to database.Everything is fine,now.Sorry for my stupidity. :D
gicoan
 
Posts: 2
Joined: Sat Oct 24, 2009 9:44 am


Return to Advanced Uses

Who is online

Users browsing this forum: No registered users and 4 guests