Prevent Rpt certain sections from printing

Sapphire123
Member Posts: 112
Hi All,
I'm trying to prevent a report from printing DataItem A section results based on dataitem B's 'create total' results... (where, dataitem B is nested in dataitem A)
The only way to test 'createtotal' results for variables in Dataitem B is in the 'OnPostSelection' of the Footer section of Dataitem B... but, by the time this section is reached, every section of Dataitem A is printed.
any idea how to work around this situation?
Thanks in advance!
ps. 'PrintOnlyIfDetail' does not work since, Dataitem B will always have detail to print.
I'm trying to prevent a report from printing DataItem A section results based on dataitem B's 'create total' results... (where, dataitem B is nested in dataitem A)
The only way to test 'createtotal' results for variables in Dataitem B is in the 'OnPostSelection' of the Footer section of Dataitem B... but, by the time this section is reached, every section of Dataitem A is printed.
any idea how to work around this situation?
Thanks in advance!
ps. 'PrintOnlyIfDetail' does not work since, Dataitem B will always have detail to print.
0
Comments
-
In the pre-section of the section which you want conditionally to print, you need to write code to calculate the totals.
Then, still in the pre-section, you need to have:
CURRREPORT.SHOWOUTPUT(your condition here);0 -
Or you can move all the controls from DataItem A body section into DataItem B footer section. It will be printed for each entry in the DataItem A but you will know the result already. But it means that the data will be under data from DataItem B. If you need to have them as first, you need to check the sum before DataItem B is processed as Karenh wrote...0
-
Thanks for the replies ...
I'm trying to modify Nav's standard report #10138 - so that when all columns are printing '0' for a certain item, nothing prints.
How do i calculate totals? 'CreateTotals' function can only be used from a dataitem trigger. i'm getting an error when i try to put this in the pre section of the footer ... :?
//
Code - start
CurrReport.CREATETOTALS(InventoryValue,TotalExpectedCost,TotalInvoicedValue,
ShippedNotInvoiced,ReceivedNotInvoiced,NetExpectedCostNotPosted,
ShippedNotInvoicedPosted,ReceivedNotInvoicedPosted,NetExpectedCostPosted);
CurrReport.CREATETOTALS(InvoicedValueNotPosted,InvoicedValuePosted);
if (InventoryValue = 0 and Total Expected Cost = 0 .... etc) then
DoNotPrint = True;
CurrentReport.Showoutput(NOT DoNotPrint);
//
Code - end
Thanks in advance..0 -
You need to "simulate" what the report is doing in the nested dataitem. I do not know the report because it is just for US.0
-
A few comments.
The only way I find everything Zero is if it's a zero cost item to begin with.
IF that is the case you can set the filter on the item tab to not include unit Cost of Zero.
If you're using Print Details. If you View-> Sections And look at the code on Item Ledger Entry Body(3) that's where you can put your code - See it already has the code there for Details Or Not..OnPreSection() CurrReport.SHOWOUTPUT(ShowDetails);
You can add yours too to stop Zero Inventory Valuation Items well.
You want to set this on the sections of the report not from the dataitems Unless you want to use CurrReport.SKIP;
It need to be at the end since the first code already set's everything to zero...
InventoryValue := 0;
InvoicedValue := 0;
InvoicedValueACY := 0;
InvoicedPostedToGL := 0;
InvoicedPostedToGLACY := 0;
InvoicedQty := 0;
ValuedQty := 0;
ExpectedValue := 0;
ExpectedValueACY := 0;
ExpectedPostedToGL := 0;
ExpectedPostedToGLACY := 0;0 -
kine wrote:I do not know the report because it is just for US.
http://savatage99.googlepages.com/10138 ... oncile.txt0 -
thanks for the suggests, i'll try it out.0
-
Savatage wrote:The only way I find everything Zero is if it's a zero cost item to begin with.
IF that is the case you can set the filter on the item tab to not include unit Cost of Zero.
I tried to filter for items where Unit Cost is <>0.. but, it still gives me everything.
I'm trying to see if the total for Inventory Valuation, Received Not Invoiced, Shipped Not Invoiced etc... is zero for an item. if so, then I do not want to print anything for this item.0 -
Savatage wrote:If you're using Print Details. If you View-> Sections And look at the code on Item Ledger Entry Body(3) that's where you can put your code - See it already has the code there for Details Or Not..
OnPreSection() CurrReport.SHOWOUTPUT(ShowDetails);
You can add yours too to stop Zero Inventory Valuation Items well.
You want to set this on the sections of the report not from the dataitems Unless you want to use CurrReport.SKIP;
It need to be at the end since the first code already set's everything to zero...
Yes, thats another thing that i was trying.. however, on predata section, the totals are not calculated.. its only after this trigger is run do i get a value for the variables..
what do you mean by ' it needs to be at the end..' ? End of which section? Please elaborate.
Thanks again..0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions