New Page Per group at Runtime

sunnyksunnyk Member Posts: 280
HI,
In report 5605, Fixed Asset - Book Value 01- I wrote Code to print New Page per group or Not depending on Option Selected by the User at run time. Even though it is working but in case when the option is Yes it is always printing first Page as balnk?

Have anybody tried to change that property at run time before?

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Can you show us the code and where did you write?
  • sunnyksunnyk Member Posts: 280
    IF NewPagePerGroup THEN BEGIN
      CASE GroupTotals OF
        GroupTotals::"FA Class":
          IF (GroupByValue <> "FA Class Code") THEN BEGIN
            CurrReport.NEWPAGE;
            GroupByValue := "FA Class Code";
          END;
        GroupTotals::"FA Subclass":
          IF (GroupByValue <> "FA Subclass Code") THEN BEGIN
            CurrReport.NEWPAGE;
            GroupByValue := "FA Subclass Code";
          END;
        GroupTotals::"FA Location":
            IF (GroupByValue <> "FA Location Code") THEN BEGIN
              CurrReport.NEWPAGE;
              GroupByValue := "FA Location Code";
            END;
    
        GroupTotals::"Main Asset":
            IF (GroupByValue <> "Component of Main Asset") THEN BEGIN
              CurrReport.NEWPAGE;
              GroupByValue := "Component of Main Asset";
            END;
    
        GroupTotals::"Global Dimension 1":
            IF (GroupByValue <> "Global Dimension 1 Code") THEN BEGIN
              CurrReport.NEWPAGE;
              GroupByValue := "Global Dimension 1 Code";
            END;
    
        GroupTotals::"Global Dimension 2":
            IF (GroupByValue <> "Global Dimension 2 Code") THEN BEGIN
              CurrReport.NEWPAGE;
              GroupByValue := "Global Dimension 2 Code";
            END;
    
        GroupTotals::"FA Posting Group":
            IF (GroupByValue <> "FA Posting Group")  THEN BEGIN
              CurrReport.NEWPAGE;
              GroupByValue := "FA Posting Group";
            END;
    
      END;
    END;
    }
    

    I wrote this at onAfterGetrecord.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    As per this code the first time it self the code will hit NEWPAGE, right?
    IF (GroupByValue <> "FA Class Code") THEN BEGIN
    
  • sunnyksunnyk Member Posts: 280
    HI Mohan,
    I agree and i tried to put one more condition in each Case statement as (GroupByValue <> ''), so it will not hit the newpage at very first record, But this is also not working and i am getting extra first page.
    Even i tried to write CurrReport.Newpage at groupfooter section as well but to no luck.
Sign In or Register to comment.