Skip to main content

Help: Request Page var value not being set in report

editSubscribe (0) ShareShare
Posted on by 22
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';
            column(ShowEmailHeader; ShowEmailHeader) { }
            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()
            ShowEmailHeader := false;
        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!!