Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports - How do I conditionally print data? 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

Can you tell me how to conditionally print table column data?

I created a simple tabular report and have set up the table relations with the Tables button.

The output shows each address along with the people who live at each address.

Currently, the report repeats the address for every person who lives at each address.

I would like to print each address detail once then print the people who live at that address. Can you tell me how to do this?

Here is an example:

Code:
The way it is now:

Address            City              State   People
----------------   ---------------   -----   --------------
123 Test Ave.      Freehold          NJ      First Person
123 Test Ave.      Freehold          NJ      Second Person
123 Test Ave.      Freehold          NJ      Third Person

338 High St.       Huntsville        AL      First Person
338 High St.       Huntsville        AL      Second Person


This is what I would like to do:

Address            City              State   People
----------------   ---------------   -----   --------------
123 Test Ave.      Freehold          NJ      First Person
                                             Second Person
                                             Third Person

338 High St.       Huntsville        AL      First Person
                                             Second Person
Thanks in advance.

Truly,
Emad-ud-deen Richard Leiman
 
Hi Emad,

The simplest way is to store values after printing the detail and compare them before printing detail and then hide the controls.

So if I have LOC:Address, LOC:City and LOC:State as local variables and FIL:Address, FIL:City and FIL:State as table columns being printed, find the embeds before and after the PRINT(RPT:Detail) in the ThisReport.TakeRecord and :

Before the PRINT :

IF FIL:Address = LOC:Address AND FIL:City = LOC:City and FIL:State = LOC:State
Report$?FIL:Address{PROP:Hide} = True
Report$?FIL:City{PROP:Hide} = True
Report$?FIL:State{PROP:Hide} = True
ELSE
Report$?FIL:Address{PROP:Hide} = False
Report$?FIL:City{PROP:Hide} = False
Report$?FIL:State{PROP:Hide} = False
END

After the PRINT :

LOC:Address = FIL:Address
LOC:City = FIL:City
LOC:State = FIL:State

As simple as that ....

Regards
 
Hi ShankarJ,

Thanks for the reply.

You are very helpful.

I will try it tonight.

By the way, do you know if anyone has released a conditional printing template into the public domain? In Oracle Reports they call it format triggers. They can be applied to individual controls as well as groups and at the detail level. I know, wishfull thinking.

Anyway, I really love the Clarion 6 program compaired to the buggy Oracle tools.

Truly,
Emad-ud-deen Richard Leiman
 
Hi Emad,

"Conditional printing" is not the right phrase to use as it normally applies to either printing or not printing a detail based on a condition. A more apt phrase would be "selective printing of controls". Just my opinion. As far as I know there is none in the public domain unless it is there in the ABC Free Templates available at If you do not ming paying, look at CPCS at Users normally say that this product make reporting in Clarion a breeze but I have not tried it.

Regards
 
Hi ShankarJ,

I tried the coding method you suggested and it works great. Thanks!

I will also look at the sites you posted.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top