Go Back > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor


Google search

How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
200 - 500 GB
500 - 800 GB
800 - 1200 GB
1200 - 1500 GB
1500 - 2000 GB
> 2000 GB
Total votes: 18

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 22nd December 2017, 11:45
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Join Date: Dec 2004
Location: India, Gujarat
Posts: 603
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face Count distinct values in after.field report layout
Baan: Baan IVc4
C/S: Both



We have a simple item sales report, where at each item change, we want to display sum of amount, total no. of customers by item and total no. of sales orders by item.

The condition is, it should count unique customers & sales orders by item. One way is to put control break login in session script, but, I was wondering if there is any simple way of doing it ?

I have attached the output coming and desired output in Excel format.

Any hint would be highly appreciated.

Attached Files
File Type: xls Report.xls (932.0 KB, 15 views)

Last edited by VishalMistry : 22nd December 2017 at 11:52.
Reply With Quote
Old 22nd December 2017, 13:41
mark_h's Avatar
mark_h mark_h is offline
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,122
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well I typically put the breaks in on the report and then leave the layouts empty. Seems to me a lot easier than trying to track when then value changes in the report script to add to the count.

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Old 22nd December 2017, 21:52
shah_bs's Avatar
shah_bs shah_bs is offline
Join Date: Jan 2002
Location: Lewisville, Texas
Posts: 388
shah_bs is on a distinguished road
Baan: BAAN IVc3 with A&D2.2b - DB: ORACLE 9 - OS: HPUX
This is one case where the powerful report writer will not cooperate, I think. You will have to make do with a small work-around programming. The following is just an idea you will have to adapt.

So, I will make following assumptions:
- You have the Program Script Source code
- And, in the program script your selection is sorted by customer/order

So, then you can try as follows:
- Define an extern field called p_count (or whatever make sense) in the program script as well as the report fields.
- In the program script, also define another field like p_prev_ordr
- Then make the count field zero or 1 according to the change of Customer and Order
* It is unlikely that the order number will be same for two different 
* customers, so we can simplify as follows:
* Approximate code:
if p_prev_ordr = current_ordr
    p_count = 0
    p_count = 1
    p_prev_ordr = current_ordr
- In the report layout, on change of order number, count this new field.

Last edited by shah_bs : 22nd December 2017 at 22:04.
Reply With Quote
Old 26th December 2017, 06:04
srprks srprks is offline
Join Date: May 2016
Location: Bangalore
Posts: 82
srprks is on a distinguished road
Baan: 10.4,Baan IV - DB: Oracle,SQL - OS: Unix,Windows

Hi you can use a function on.change.check. below is the sample program from Pro guide.

string   city(10)

city = "Paris"
on.change.check( city )   | checkpoint value set to Paris
city = "Rotterdam"
on.change.check( city )   | checkpoint value now set to Rotterdam
city = "Amsterdam"
if ( changed(city) ) then | changed() returns TRUE here, but also sets
              |    the new checkpoint value to "Amsterdam"
        not.curr( city )
        message( "City is changed, old city is: %s",city )  | city is Rotterdam
        not.curr( city )
        message( "New city is: %s",city )   | city is Amsterdam
Reply With Quote
Old 6th August 2018, 14:07
Sahil Sharma Sahil Sharma is offline
Junior Member
Join Date: Jul 2018
Posts: 15
Sahil Sharma is on a distinguished road
Baan: FP 10.4 - DB: BAAN - OS: windows 10
Just tick the option "Supress identical values" in "Conditions" Tab while adding a new report field.
Reply With Quote
Sponsored Links

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoices printing issue-display last record with 2 lines tracylee Tools Development 7 20th October 2017 10:51
Only one dynamic footer on the last page BaBernd Tools Development 4 10th April 2015 16:18
Printing Layout Twice in a Report MilindV Tools Development 3 2nd December 2010 12:32
Layout within report layout layswan Tools Development 1 22nd April 2008 10:41

All times are GMT +2. The time now is 18:01.

©2001-2018 - -