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
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 14th September 2018, 12:50
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
skip record in report
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: Client

Hi all,

i've a problem in a after field custom that i've created, it is sorted by a field that i've inserted in input fields and i want that if that field is blank, the report mustn't print that row. How can i manage it ?

this is my function :
Code:
after.orco.1:													
before.layout:	
	select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and		tdsls401.pono > :r.pono
	as set with 1 rows
	selectdo
		get.ccde()
		get.item.count()
		get.item.wght()
		get.ccde.dsca()
		r.pono = tdsls401.pono
	selectempty
		lattr.print = false
	endselect

after.layout:
		if lattr.print = true then	
			layout.again()
		endif
In this way it prints all the rows that it finds, but also the one's with the blank record.
Reply With Quote
  #2  
Old 17th September 2018, 15:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,110
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I am not sure I get your request. From the looks of the code it continues to print until it finds an empty records. If you are not wanting to print based off an input field then just put an if then around the select statement and make lattr.print = false. Then in the after layout put another if then around the layout. again. I typically do no use lattr.print to see if I need print a layout again - I usually use a variable of some sort.
__________________
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 17th September 2018, 15:44
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
Hi,

sorry but i should explain better, my problem is in the get.ccde() function that is this:
Quote:
function void get.ccde()
{
r.ccde = ""
no.ccde = false

select tcibd001.ccde:r.ccde
from tcibd001
where tcibd001._index1 = {:tdsls401.item}
group by tcibd001.ccde
selectdo
if isspace(r.ccde) then
no.ccde = true
endif
selectempty
endselect
}
There i group my codes by the field .ccde, there i want that if a .ccde is empty, the system have to skip the record to the next that is not empty. The problem is that if i put lattr.print = false ( in this function get.ccde) it will not print the last record that is NOT empty..

I hope explained myself, in case, answer to the thread. I will give u any information..

Thanks!
Reply With Quote
  #4  
Old 17th September 2018, 16:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,110
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Rather than using lattr.print for the layout again. Can you use something else? Then inside the get.ccde you could set lattr.print to false. to just skip this records. I mean if just check to see if another r.pono exists before the layout again. Something like this - probably needs some tweaks since I was winging it.

Code:
after.orco.1:													
before.layout:	
	select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and		tdsls401.pono > :r.pono
	as set with 1 rows
	selectdo
		get.ccde()
                if no.ccde then
                    lattr.print = false
                    continue
                else
                    lattr.print = true
                endif
		get.item.count()
		get.item.wght()
		get.ccde.dsca()
		r.pono = tdsls401.pono
	selectempty
		lattr.print = false
	endselect

after.layout:
        select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and		tdsls401.pono > :r.pono
	as set with 1 rows
        selectdo
                 found.one = true
        selectempty
                 found.one = false
        endselect
        if found.one then
           layout.again()
        endif
__________________
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
  #5  
Old 18th September 2018, 09:30
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
I'll try it today, thanks. I have some doubts for the use of lattr.print = false in the before.layout, because if i pass by the lattr.pint = false, it would not pass by the after.layout.

I will update the post asap.

Thanks again.
Reply With Quote
  #6  
Old 18th September 2018, 09:47
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
It seems it's not working. Because (via debug) i see that if the system passes through the lattr.print= false , it will exclude all the thing after and it passes directly to the next layout..
Reply With Quote
  #7  
Old 18th September 2018, 13:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,110
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
So it skips the after layout?
__________________
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
  #8  
Old 18th September 2018, 13:40
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,110
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I wonder if something like this might work - notice I commented out the as set with 1 rows. For some reason in all my years of coding I do not think I have used break inside a selectdo statement.
Code:
after.orco.1:													
before.layout:	
	select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and		tdsls401.pono > :r.pono
|	as set with 1 rows
	selectdo
		get.ccde()
                if no.ccde then
                    continue
               endif
		get.item.count()
		get.item.wght()
		get.ccde.dsca()
		r.pono = tdsls401.pono
                break
	selectempty
		lattr.print = false
	endselect

after.layout:
        select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and		tdsls401.pono > :r.pono
	as set with 1 rows
        selectdo
                 found.one = true
        selectempty
                 found.one = false
        endselect
        if found.one then
           layout.again()
        endif
__________________
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
  #9  
Old 18th September 2018, 13:58
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,720
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Mark is right !

As Mark said, should have a strange behavior.
Code:
Index 1 of tdsls401 is orno , pono , sqnb

so the select should be inrange.
[/quote]

Regards
__________________
//Bernd
Reply With Quote
Sponsored Links
  #10  
Old 18th September 2018, 14:48
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 47
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
Finally i did it ! Thanks Mark! Here below i'm attaching the code!
Code:
after.orco.1:													
before.layout:	
	select 	tdsls401.*
	from	tdsls401
	where	tdsls401._index1 = {:tdsls400.orno}
	and	tdsls401.pono > :r.pono
|	as set with 1 rows
	selectdo
		get.ccde()
		if no.ccde then
			continue
		endif
		get.item.count()
		get.item.wght()
		get.ccde.dsca()
		r.pono = tdsls401.pono
		break
	selectempty
		lattr.print = false
	endselect

after.layout:
	select  tcibd001.ccde:r.ccde
	from    tcibd001
	where   tcibd001._index1 = {:tdsls401.item}
	and	tcibd001.ccde <> ""
	group by tcibd001.ccde	
	selectdo
		found.one = true
	selectempty
		found.one = false
	endselect
	
|	if lattr.print = true then
	if found.one then
		layout.again()
	endif

Last edited by mark_h : 18th September 2018 at 15:28. Reason: add code tags for readability
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
how to skip the record in selectdo and continue to next record Noor Jahan Tools Development 1 15th October 2015 07:34
Peek at next record in Report Seq File ben.kansas Tools Development 3 12th November 2014 00:14
Mmt adi28_rai Tools Development 6 22nd October 2010 14:40
Preserve position of record pointer in report script Neal Matthews Tools Development 19 17th January 2007 15:54
solving recursion problems rmarles Tools Development 2 25th January 2005 21:23


All times are GMT +2. The time now is 06:50.


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