hiding rows on demand via checkbox

dyn45dyn45 Member Posts: 67
edited 2007-07-13 in Navision Attain
hi to all,
I am working on report 113 and I have to do next:
I need to hide two rows, one of them is Profit and other is Profit %.

on Request Form I need a checkbox (done),
when I click on it, and then, click on Preview, those two rows should be hidden.

please, any clue how I should do that

Answers

  • fraggletfragglet Member Posts: 4
    Hi Milosh,

    you can use the CurrReport.Showoutput -Function.
    In the section you want to hide you write:
    CurrReport.Showoutput(yourRequestform-Variable);

    Greets
  • AlbertvhAlbertvh Member Posts: 516
    Hi Milosh

    Make the heading Lables text boxes and your profit and % blank when zero.
    Put in the following code
    Integer - OnAfterGetRecord()
    
    IF Number = 1 THEN
      ValueEntryBuffer.FIND('-')
    ELSE
      ValueEntryBuffer.NEXT;
    
    IF Hide THEN BEGIN
      Profit := 0;
      ProfitPct := 0;
    END ELSE BEGIN
      Profit :=
        ValueEntryBuffer."Sales Amount (Actual)" +
        ValueEntryBuffer."Cost Amount (Actual)" +
        ValueEntryBuffer."Cost Amount (Non-Invtbl.)";
    
      IF PrintToExcel AND Item.GET(ValueEntryBuffer."Item No.") THEN BEGIN
        CalcProfitPct;
        MakeExcelDataBody;
      END;
    END:
    

    Hope this helps

    Albert
  • dyn45dyn45 Member Posts: 67
    Thanks but,
    I do not think that you understod my problem.
    I just want to hide two rows depending on checkbox on my Request Form:
    if the checkbox checked than show me whole report without 2 rows Profit and Profit %
    or, if not checked, show me complete report with those 2 rows
  • AlbertvhAlbertvh Member Posts: 516
    Hi Milosh
    on the Customer Header (5) do the following
    Remove Labels Profit and Profit %
    Add 2 TextBox with sourceexpr ProfitTxt and ProfitPctTxt
    Define as Text variables ProfitTxt and ProfitPctTxt
    with the code I gave you earlier
    ProfitTxt := '';
    ProfitPctTxt := '';
    IF Hide THEN BEGIN 
      Profit := 0; 
      ProfitPct := 0; 
    END ELSE BEGIN
      ProfitTxt := 'Profit';
      ProfitPctTxt := 'Profit %'; 
      Profit := 
        ValueEntryBuffer."Sales Amount (Actual)" + 
        ValueEntryBuffer."Cost Amount (Actual)" + 
        ValueEntryBuffer."Cost Amount (Non-Invtbl.)"; 
    
      IF PrintToExcel AND Item.GET(ValueEntryBuffer."Item No.") THEN BEGIN 
        CalcProfitPct; 
        MakeExcelDataBody; 
      END; 
    END:
    

    Should sort you out. :D
  • dyn45dyn45 Member Posts: 67
    Hi to all,
    first I wanna thank you for your help, but I solved my problem in the other way:
    I made double sections in my report, and I erased 2 rows in them. than in the sections I don't wanna see rows I type this:
    OnPreSection()
    CurrReport.SHOWOUTPUT(SourceExpr);

    and in the sections I do wanna see rows i type this:
    OnPreSection()
    CurrReport.SHOWOUTPUT(NOT SourceExpr);

    simple as that...
Sign In or Register to comment.