Question about check box

SinaSina Member Posts: 33
Hi everyone.

I created a check boc in a form. When this check box is true a special section in a report should be printed.
Is this possible? Because, I created a check box "Print-KB" on the form. In the table Customer I created a variable "Print-KB" (boolean) and in the report I created a variable Cust with table relation to Customer, but it doesn't work.

Did I forgot something?
Thanks.
Sina

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Search the help / forum for SHOWOUTPUT command...
  • garakgarak Member Posts: 3,263
    In the Section you can type following:
    CurrReport.Showoutput(YourBoolField)
    

    if the "Print KB" is a own DataItem in your Report Design you can write in your DataItem of "Print KB"
    following:
    CurrReport.break;
    

    Regards
    Do you make it right, it works too!
  • SinaSina Member Posts: 33
    I wrote the following code in the OnPreSection:


    IF (Cust."Print-KB" = TRUE)
    THEN BEGIN
    ....
    END
    ELSE CurrReport.SHOWOUTPUT(FALSE);


    But I think the value of the check box is not in connection with my report, because the section is not printed when I set the check box to true.
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    Do if Customer.Field using your report DataItem Name or get the Customer in the Cust variable and then use cust. Probably the cust variable is empty...
  • SinaSina Member Posts: 33
    I don't exactly know what you mean. But I created a MESSAGE with the Value of the check box and it shows "no" even when it is checked. How to realize that it works :?:
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    Your code is based on the Cust variable. Is cust a variable or a dataitem? when you reach the section, have you done something like cust.GET(Custome."No.") in order to set Cust to the current customer...? Post the code of your report here so we can check it and help you more...
  • SinaSina Member Posts: 33
    Cust is only a record variable in the globals. I haven't something like cust.GET(Custome."No.") . The code above is all that I wrote, with some calculations inbetween.
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    Which report are you using? If the report has a DataItem based on customer then it loops through the customers... Can you tell us what dataitems the report has? Also the the Variable Print KB you created is it a variable on the form only? It needs to be a field on the table...
  • SinaSina Member Posts: 33
    I use report 1017190 = BSS Cash Reg. Receipt Inv. which has the following dataitems:


    Sales Header <Sales Header>
    Integer CopyLoop
    Integer HeaderData
    Integer PageLoop
    Integer DimensionLoop1
    Sales Line <Sales Line>
    Doc. Customer Ext. Texts CustExtTextHeader
    Integer RoundLoop
    Integer DiscountBuffer
    Integer BAHLine1
    Integer BAHLine2
    Integer DimensionLoop2
    Integer VATCounter
    Integer Total
    Integer Total2
    Doc. Customer Ext. Texts CustExtTextFooter
    Integer AdvertiseText
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    Which section have you used?
  • SinaSina Member Posts: 33
    Sry I mean 1017180 Sales - Quote
    Sina
  • SinaSina Member Posts: 33
    RoundLoop,Body
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    If this section is indented under the Sales Header then do the following on the same section:
    Cust.CLEAR;
    IF Cust.GET("Sales Header"."Sell-to Customer No.") THEN 
      CurrReport.SHOWOUTPUT(Cust."Print-KB")
    END ELSE
      CurrReport.SHOWOUTPUT(FALSE);
    
  • SinaSina Member Posts: 33
    Thank you, now it works!! \:D/
    Sina
  • kapamaroukapamarou Member Posts: 1,152
    You're welcome. If you can, add [Solved] in your topic... :D
  • kinekine Member Posts: 12,562
    If your problem was solved, do not forget to mark the initial post as "Solved" by setting appropriate property when editing the initial post... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.