Is it possible to know whether the contents of a particular section is printed or not , wtihin the report ?
Yes It’s, On the PreSection Trigger do this : [IsShow :=] CurrReport.SHOWOUTPUT([SetShow]); IsShow is a boolean variable which indicates if the section will be printed For more infos check the NF online help for ShowOutput. tarek_demiati@ureach.com
Ya, that I know. My question is different. I want to know whether that section is already printed or not. from some other triggers like postsection or somethings. Thanks
Only by setting a flag Boolean C/AL Global ShowNext Boolean // First Report Section OnPreSection() CurrReport.SHOWOUTPUT(NOT PrintAmountsInLCY); ShowNext:=CurrReport.SHOWOUTPUT; // Next Section OnPreSection() CurrReport.SHOWOUTPUT:=(NOT PrintAmountsInLCY)AND(ShowNext); David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk
It will work in normal situation. Please go through the following situation. DataItems : Debitor and Sales The relation of these table is through the field Debitorno. The PrintOnlyIfDetail property of debitor dataitem is true. Assume the values in the tables debitor debitorno - 10,20,30 Sales debitorno - 10,30 In this case only 10 and 30 will be printed in the header section of the report due the PrintOnlyIfDetail property of debitor dataitem is true. But 3 times program control have been gone to the debitor header. Logically speaking, currReport.showoutput value should be FALSE when the debitorNo 20 come into the debitorheader. The debitorno 20 is not printing in the section but currReport.showoutput value for debitor 20 is true. Why?
Good question. At the moment Navision has read the next customer (Debitor) 20, it doen’t know yet that there are not Sales and there fore prints the section. However the sections are not printed immediately but only buffered and if later on the report comes to the conclusion that due to lack of sales lines and PrintOnlyIfDetail=YES it doen’t have to print at all, it simply empties the buffer. Why do want to know at that very moment whether or not the section will be printed? Are you writing into a file or something the like? Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch
Hi Mr. fabian Your assumption is correct . My requirement is to write into file. Thanks Edited by - joseph_mathew on 2001 Mar 07 07:23:06
The solution is very simple: Don’t write to the file in Debitor.Body (respectively Debitor.OnAfterGetRec) but write in the Sales.OnPostDataItem section. Doing so, you have full access to the Debitor table and you can be sure that this trigger is only being executed if there are sales available. Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch
Hi fabian That logic is working fine. In this case debitor without sales will not be written into the file. That’s fine. Howeverin the case of multiple sales items for a debitor, debitor body will be written multiple into the file. We can avoid this by using the following way. declare a global varible tmpDebNo //OnPresection() of sales if debitor.debno <> tmpDebNo Then // codes for writting into the file OnPostsection() of sales tmpDebNo := sales.debno ; Thanks.