Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
22%
Total votes: 45

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd December 2017, 11:45
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 599
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

Hi,

NOTE : THIS IS FOR BAAN IVC4.

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.

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

Last edited by VishalMistry : 22nd December 2017 at 11:52.
Reply With Quote
Sponsored Links
  #2  
Old 22nd December 2017, 13:41
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,074
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.
__________________
Mark

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
  #3  
Old 22nd December 2017, 21:52
shah_bs's Avatar
shah_bs shah_bs is offline
Guru
 
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
Code:
* 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
then
    p_count = 0
else
    p_count = 1
    p_prev_ordr = current_ordr
endif
- 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
  #4  
Old 26th December 2017, 06:04
srprks srprks is offline
Member
 
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
On.change.check

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

Code:
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
endif
off.change.check(city)
Reply With Quote
Reply


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:24.


©2001-2018 - Baanboard.com - Baanforums.com