web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Help: Request Page var value not being set in report

(0) ShareShare
ReportReport
Posted on by 24
Hello all,
I hope somebody can help. 
I'm relatively new to AL, and just trying to do something I thought would be simple but seems BC is doing everything it can to fight against me for it.
So what I want to do is this:
In the Customer Statement Request page I'd like to put a boolean selection for /Show Header/, and this option allows the report to adjust whether or not to print the company details at the top of the page or not. Basically we have headed paper that already has this information on, so it doesn't need to be printed, but if we send by email we do want it shown.
I can put the selection switch in the request page no problem, however no matter what I try it seems the value of this selection does not get /sent/ to the report. I have the field available in the report, but the value is just empty.

Code below:
reportextension #### 'My Standard Statement' extends 'Standard Statement'
{    
    RDLCLayout = './layouts/MyStatementLayout.rdlc';
    dataset    
    {
        add(OverdueVisible)
        {
            column(ShowEmailHeader; ShowEmailHeader) { }
        }
    }
    requestpage
    {
        layout
        {
            addfirst('Output Options')
            {
                field(ShowEmailHeader; ShowEmailHeader)
                {
                    ApplicationArea = All;
                    Caption = 'Show Header?';
                    ToolTip = 'Select to show company details in the header, print header does not need this.';
                }
            }
        }
        trigger OnOpenPage()
        begin
            ShowEmailHeader := false;
        end;
    }
    var
        ShowEmailHeader: Boolean;
}
 
[Please note I've replaced some double quotes with single quotes because for some reason this forum can't escape double quotes properly... whwwwwhhhhaaaat!?!?!]
 
The OnOpenPage() trigger allows me to set the default state of the ShowEmailHeader value, but still that value doesn't get passed to the actual report.
I've also tried with a different type of field, a text field, but even then the text doesn't get passed to the report, even though the field is available in the report.

If anyone can answer why that would be great!!
I have the same question (0)
  • Ariba Mehdi Profile Picture
    166 on at
    Hi Paul,

    Try to use the property RequestFilterFields under dataitem section. 
    ​​​​​​​
    For example: 
    RequestFilterFields = ShowEmailHeader;

    Hope this helps!
  • Community member Profile Picture
    24 on at
    Hi Ariba,
     
    Thanks for your response but this does not work - it will not allow me to add that parameter anywhere.
    I believe `RequestFilterFields` parameter can only be set under a `dataitem` block which is not available in a reportextension unless I'm adding or modifying a table of fields - in which it then shows fields of that table to be filters. This isn't what I'm doing unfortunately, and the ShowEmailHeader Filter is already in place anyway.
     
    Thanks though
     
     
     
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    95,597 Super User 2025 Season 2 on at
    Hi, If the value is only displayed once(Only on the header?), try the following assignment in OnPreReport trigger or OnPostReport trigger
    ShowEmailHeader := false;
     
     
    Hope this helps.
    Thanks
    ZHU
  • Community member Profile Picture
    24 on at
    This is such a weird problem.
    So, as Yun Zhu suggested, setting a value on the OnPreReport trigger also does nothing - in the report, the value of that variable is empty - not even True/False/Yes/No, just empty.
    If I put a Message box to display the set value in the OnPreReport trigger though, I can see the value that's set. It's just that value isn't making its way to the report.
     
    I've tried with a simple text variable as well - nothing!
     
  • Verified answer
    Community member Profile Picture
    24 on at
    Right.... it seems by moving the column declaration from    add(OverdueVisible) to    add(Integer) this has worked
     
    Bonkers!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans