Conditional shape coloring in report

Getting your data onto paper - or the web - Discussing the reports features of Base

Conditional shape coloring in report

Postby clausisme » Fri Mar 28, 2014 4:35 pm

I have a shape and I want it to change color corresponding to a data field. For instance I have a query with 5 category's (cat=1, cat=2 etc) and for each category I want that shape to have a different color.
I tried writing in the "conditional shape expression" many variations of this:
=IF([Cat]=1;Shape.FillColor=RGB(100.200.300))

I am a new user of openoffice and I don't have a grasp of the syntax needed. I know how to Conditional format a text but can't use Format>Conditional Formatting on a shape.
OpenOffice 4.01 on Windows 7
clausisme
 
Posts: 20
Joined: Fri Mar 28, 2014 3:23 pm

Re: conditional shape coloring in report

Postby acknak » Fri Mar 28, 2014 5:02 pm

Nice try!

Unfortunately Writer's fields are fairly primitive; you can't use shapes in a formula (see the online help under Index > "formulas;calculating in text" > "Formula bar" for more info.

Here's one way to do it: create the shapes with the colors you want, each shape anchored "as character" and in its own paragraph, then add a "hidden paragraph" field to each paragraph with the condition needed to hide the paragraph unless the condition is met.

Here's a sample arranged this way:
Attachments
alternate_shapes_sample.odt
(9.59 KiB) Downloaded 191 times
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: conditional shape coloring in report

Postby clausisme » Sat Mar 29, 2014 1:48 pm

Thanks for the prompt reply.

I am using the sun report builder in OpenOffice base, and can't really see how to make your example happen there. Maybe it would work in the old wizard report builder. But I really need a solution in the sun report builder if there is any.
OpenOffice 4.01 on Windows 7
clausisme
 
Posts: 20
Joined: Fri Mar 28, 2014 3:23 pm

Re: Conditional shape coloring in report

Postby acknak » Sat Mar 29, 2014 3:57 pm

I thought the report builder just constructed a Writer document--can't you edit the report in Writer and make whatever changes you need?

I don't know; I've never touched the report builder so I could be completely off track.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3


Return to Reporting

Who is online

Users browsing this forum: No registered users and 2 guests