How to build a Conditional Print Expression?

Discuss the database features
Post Reply
ftrobaugh
Posts: 11
Joined: Tue Jun 22, 2010 4:52 am

How to build a Conditional Print Expression?

Post by ftrobaugh »

Greetings,

Is there a clear, SIMPLE tutorial on building expressions anywhere?

I am using OpenOffice 3.2.1 with Sun ReportBuilder. I am trying to use a Conditional Print Expression to suppress a field. I have a logical field called “Printed,” and I am trying to build a report that will show the field ONLY if its value is TRUE. When I run the report I want to see

PRINTED NAME
TRUE Bob Smith
Jack Clark
Olivia D'Haviland
TRUE Alfred Hitchcock
Archibald Leach


I have spent many long, frustration hours searching these forums, OpenOffice Wiki, and around the world, but I have yet to find a tutorial or discussion that does not assume I have a strong background in programming.

I would love to find a tutorial about building expressions that assumes I know nothing... a tutorial that does not assume I know what SQL is, or what OpenFormula standards are, but instead tells me what the syntax and logic of various functions is.

I would even be willing to help create such a tutorial, but I need a starting point.

Help.

Ted
OpenOffice 3.1 on WinXP
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to build a Conditional Print Expression?

Post by r4zoli »

What you want is not fully reachable in SRB reports.
The empty fields cannot be suppressed, the place holders keeps on reports.
Only layout is:

Code: Select all

PRINTED NAME
TRUE Bob Smith
     Jack Clark
     Olivia D'Haviland
TRUE Alfred Hitchcock
     Archibald Leach
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
ftrobaugh
Posts: 11
Joined: Tue Jun 22, 2010 4:52 am

Re: How to build a Conditional Print Expression?

Post by ftrobaugh »

Oops! What I SAID I want is not actually what I want. I did not realize that the spaces I had entered to make my columns line up got suppressed when I submitted my post. I knew I could not make a field go away entirely. What I REALLY want to see is as you showed, but I have no idea how to make a table in this post, so I will have to fake it.

PRINTED NAME
TRUE Bob Smith
(blank) Jack Clark
(blank) Olivia D'Haviland
TRUE Alfred Hitchcock
(blank) Archibald Leach

My two questions remain unanswered.
1) How do a make a field show up as blank if it meets a certain condition? In this case the condition FALSE
2) Is there a good resource to teach us newbies how to create expressions in queries and reports?

Thanks,

Ted
OpenOffice 3.1 on WinXP
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to build a Conditional Print Expression?

Post by r4zoli »

I tried to solve your problem which I solved in earlier versions, and it takes time to figure out what happened.
I created an example file I uploaded to this post. To reach your layout needs only a function, in Data tab of "Printed" report control, "Data field ":

Code: Select all

IF([Printed];"True";" ")
The solution works only with OOo 3.1.1, and not in OOo 3.2.x and newer versions, I will submit a bug.

2. no such tutorials

Edit: issue 112721 was submitted.

Edit2:
The issue is invalid :oops: .
The IF field type was boolean and not worked, format it as text, it will work.
I added new modified example file.
Attachments
true.odb
modified file
(41.19 KiB) Downloaded 260 times
Last edited by r4zoli on Mon Jul 26, 2010 7:54 pm, edited 2 times in total.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
ftrobaugh
Posts: 11
Joined: Tue Jun 22, 2010 4:52 am

Re: How to build a Conditional Print Expression?

Post by ftrobaugh »

No such tutorials, huh? Well, then, how does one go about starting one? Because there needs to be one. OpenOffice is beginning to be a victim of its own success -- more and more non-programmers are adopting it, but the documentation has not really recognized that fact.

How does one go about taking part in building/writing/editing documentation? Is there a central wiki designed for end-users (as opposed to the more technically-targeted wiki that I have seen), or does the wiki I know about just evolve?

I am a newbie -- untrained in any programming language, but a logical guy and a fairly good problem solver. I can help writing for the end-user, but I do not have the necessary understanding of the logic of the expressions themselves. If anybody can point me in the right direction to learn more about expressions, I am happy to take part in the creation of a tutorial.

Ted
OpenOffice 3.1 on WinXP
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to build a Conditional Print Expression?

Post by r4zoli »

Base the newest part of OOo, the developers (now only one) can not write documentation.
Users who have some experience in using Base creating some sort of documentation.

You can find it in OOo Base wiki page, several links on wiki page points to external web pages.

Only issued Base documentation is Getting Started with Base Chapter, is a very basic guide.

Ongoing document development on Base Guide on OOo Authors. Their goal to develop a detailed guide on Base.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
ftrobaugh
Posts: 11
Joined: Tue Jun 22, 2010 4:52 am

Re: How to build a Conditional Print Expression?

Post by ftrobaugh »

r4zoli wrote: The solution works only with OOo 3.1.1, and not in OOo 3.2.x and newer versions, I will submit a bug.
Thanks for your help and for submitting the bug report. As I am up to 3.2, I will have to wait for the bug fix.

Ted
OpenOffice 3.1 on WinXP
ftrobaugh
Posts: 11
Joined: Tue Jun 22, 2010 4:52 am

Re: How to build a Conditional Print Expression?

Post by ftrobaugh »

r4zoli wrote:Base the newest part of OOo, the developers (now only one) can not write documentation.
Thanks for the resources. I will check them out.

I am surpirsed to learn that there is only one person developing Base. Wow. I am new to OpenOffice and open source, and it is a mystery to me how the coordination between all the individuals works.

Thanks for you time and information.

Ted
OpenOffice 3.1 on WinXP
facteater
Posts: 5
Joined: Sat Mar 20, 2010 3:10 pm

Re: How to build a Conditional Print Expression?

Post by facteater »

If the field called Printed is a boolean value then I think that this should be farely simple.
Here is what I do(I'll be using your table as an example):
1) Click "Create a Report in design view"
2) Insert the fields Printed and Name
3)Click on the box that says =Printed . Make sure that you get only the box and not it's label.
4)On the right edge of the screen the should be a box with a bunch of different properties in it. If it is not there hit the F4 button to make it appear.
5)There are two(2) tabs over there. Select the one called 'General'
6)In the list of boxes find the one labeled "Conditional Print Expression...." click the little button with the three dots (I think it is called an ellipses)
7)In the dialog that pops up select the tab "Functions"
8)In the Category box select "Logical"
9)In the box below it double click on "OR"
10)Now on the right click the select button to the right of the top box
11)Select Printed and click "Insert"
12) Click Ok to save your changes.
13)Click the Execute Report button (On the standard toolbar) to see your report.

I hope this helps. :)


Last bumped by facteater on Mon Jul 26, 2010 6:06 pm.
OpenOffice 3.2.0
Windows XP SP3 and Windows XP SP2
Post Reply