Skip to main content
Solved

Hide a text field with a condition in report designer


Forum|alt.badge.img

Is it possible to put in a condition to not display a text field in the page header section if the results is in the detail section?

I have tried different conditions but it only seems to work when I put the condition in the details section, but this results in the text field being added per line.

 

So when I run the report and there are no lines to display currently the heading still displays:

 

 here is an example of when there are lines to display:

 

 

Best answer by DrewNisley

@francoisroux96 Nevermind, that doesn’t work. I added something to your relationship between SOOrder and SOLine and added a visibility restriction on the page header, it should be working now. 

Attached is the report

View original
Did this topic help you find an answer to your question?

19 replies

nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 12, 2024

Hi @francoisroux96 

You can create conditions for text fields as follows: IIf( [SOLine.InventoryID] = NULL , ' ' , 'OUT OF STOCK (Not Invoiced)' )

 

Best Regards,

NNT


Forum|alt.badge.img

Hi, I tried your formula but it still shows the text

result:

 

 


nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 12, 2024

Hi @francoisroux96 

Please test again as shown below

 

Best Regards,

NNT


Forum|alt.badge.img

I have put in your formula as suggested but I still get the text field displayed

 

Result:

 

 


nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 12, 2024

Hi @francoisroux96 

Have you done “Save To Server” in Report Designer yet?


and click "Reload this page" on the website before doing "RUN REPORT"

 

Best Regards,

NNT


Forum|alt.badge.img

Hi, Yes I have done that. I have attached the report if you would like to see as well


darylbowman
Captain II
Forum|alt.badge.img+13

One way to do this would be to add a variable to the header section, called LineCount or something. In the details, increment the variable according to your conditions. Then use the LineCount variable in your header visibility condition, something like: IIf($LineCount > 0, True, False)


kdavis45
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • 41 replies
  • June 12, 2024
francoisroux96 wrote:

I have tried different conditions but it only seems to work when I put the condition in the details section, but this results in the text field being added per line.

 

 

darylbowman wrote:

One way to do this would be to add a variable to the header section, called LineCount or something. In the details, increment the variable according to your conditions. Then use the LineCount variable in your header visibility condition, something like: IIf($LineCount > 0, True, False)

 

This happened with a client recently. They wanted the header to change depending on the detail in the report, but Acumatica evaluates/prints the header before it evaluates the detail.

So I did a combination of both of the above suggestions:

  1. I duplicated the detail section and put the header in the first line (where I know it will evaluate)
  2. I added a variable to count every line that meets the criteria (e.g. Iif([SOLine.InventoryID]=null,0,1) + $LineCount)
  3. I added a visibility formula to the header in the detail section: $LineCount=1. That forces the header to only show once if/when you have an out-of-stock item

nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 13, 2024

Hi @francoisroux96 

Please "Save as" to .rpx and attach the .rpx file again.

 

Best Regards,

NNT


Forum|alt.badge.img

Here you go 


Forum|alt.badge.img

attached rpx format


nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 13, 2024

Hi @francoisroux96 

Please see the attached .rpx report file that I have edited.

In the screenshots below, I tested the case there are lines and the other case there are no lines.

 

 

Best Regards,

NNT


Forum|alt.badge.img

Hi NNT,

 

Thanks for this but the result is still the same. I am wondering if it does not have to do with the details section visible expression. which is =[SOLine.ShippedQty] < [SOLine.OrderQty] and [SOLine.IsStockItem] and [Branch.BranchCD]<> 'BOSWINKEL'

 

we are basically saying if the shipped quantity is less than the order quantity to show the items that were not delivered/out of stock. Without this all the items are displayed, when i add it it displays the items correctly when there is no items to display but then it still shows the header

 

with no stock

 

 without no stock

Saved to server, refreshed screen, checked it was the right version.


Forum|alt.badge.img
  • Varsity II
  • 28 replies
  • June 13, 2024

@francoisroux96 Could you try just putting the same visibility expression on the page header section? That way when the detail section is not visible, the page header section is also not visible.


Forum|alt.badge.img
  • Varsity II
  • 28 replies
  • Answer
  • June 13, 2024

@francoisroux96 Nevermind, that doesn’t work. I added something to your relationship between SOOrder and SOLine and added a visibility restriction on the page header, it should be working now. 

Attached is the report


nhatnghetinh
Captain II
Forum|alt.badge.img+7
  • Captain II
  • 337 replies
  • June 14, 2024

Hi @francoisroux96 

Please see DrewNisle's handling above. I found it worked well.

 

Best Regards,

NNT


Forum|alt.badge.img

Hi Guys, that worked great, Thank you so much for all the help so far.

 

When there was  stock that could not be delivered:

when all the stock was delivered:

 

 

If  I want to use this as a sub report on my invoices screen SO643000 it should be independent from the main report right?

I added it to the SO643000 report here:

 

I added a visible expression to only show if is it stock items, I noticed if I don’t put that in the sub will display non stock items like delivery, so with this expression it solves that issue

If i run the report for an invoice that had all the stock it displays correctly without the header:

When I run the report where there was stock not available it shows the stock not delivered but not the header:

 

 

Could it be that the sub is referencing from SOLine but the main report does not have SOLine in a join? or is this another case of adding a visible expression to the main report as well?


Forum|alt.badge.img
  • Varsity II
  • 28 replies
  • June 14, 2024

@francoisroux96 Turns out, page headers do not get passed through a subreport. I also found out that visible expressions on group headers are also bugged, but I found a workaround. If you join your SOOrder table to SOLine on the SO643000 Report using the same relations as the subreport, you can then apply the same visible expression as before. 

=IIf([SOLine.InventoryID]=null Or [Branch.BranchCD] = 'BOSWINKEL',false,true)

Then add the header as a group header instead of a page header. I updated the subreport attached below. 

With Backordered parts

 

Without Backordered parts

 


Forum|alt.badge.img

Hi Drew, 

 

Thank you that worked, the main invoice display is perfect now


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings