My Question

Create a simple report for customer list. The report should be in landscape with 15 or more columns. In the options tab, there should be 5 checkboxes indicating any 5 columns. If I select those checkboxes then they should not be printed and the columns should be moved. We are talking about moving of columns on the fly. can any one explain me how to create a report...and where should we write code..?

Comments

  • Can any one please suggest me to do this.
  • AKAK Member Posts: 226
    Take a look at report 110.
  • Actually my case is different and i followed this code

    onaftergetrecord() trigger:


    IF NOT Hide THEN
    FormatAddr.Customer(CustAddr,Customer);
    IF NOT HideName THEN BEGIN
    FOR i := 1 TO ARRAYLEN(Customer.Name) DO
    CustAddr[3] := Customer.Name;
    CustAddr[3] := CustAddr[2];
    TName[1] := Customer.FIELDCAPTION(Name);
    END;

    IF NOT HideAddress THEN BEGIN
    FOR i := 1 TO ARRAYLEN(Customer.Address) DO
    CustAddr[1] := Customer.Address;
    TAddress[1] := Customer.FIELDCAPTION(Address);
    END;

    IF NOT HideCity THEN BEGIN
    FOR i := 1 TO ARRAYLEN(Customer.City) DO
    CustAddr[2] := Customer.City;
    TCity[1] := Customer.FIELDCAPTION(City);
    END;

    IF NOT HideCountry THEN BEGIN
    FOR i := 1 TO ARRAYLEN(Customer.County) DO
    CustAddr[4] := Customer.County;
    TCountry[1] := Customer.FIELDCAPTION(County);
    END;


    IF NOT HideContact THEN BEGIN
    FOR i := 1 TO ARRAYLEN(Customer.Contact) DO
    CustAddr[5] := Customer.Contact;
    TContact[1] := Customer.FIELDCAPTION(Contact);
    END;

    while running the report I am not able to move the columns properly..
  • AKAK Member Posts: 226
    You don't need to move them if you create a section for each combination of the tickboxes and display them accordingly. Just like report 110 does.
  • But my requirement is when i select all check boxes then check boxes indicating any columns should not print remaining columns should print..
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    ReportColumnHeaders : Array[15] of Text
    ReportColumns : Array[15] of Text

    IF HideSomeColumnX THEN BEGIN
     ReportColumns[ColumnX] := ''; 
     ReportColumnHeaders[ColumnX] := '';
    END ELSE
      IF ReportColumns[ColumnX] = '' THEN
         ReportColumns[ColumnX] := '-';//some filler charater
    //.. and so on for remanining columns
    

    the last line
    COMPRESSARRAY(ReportColumns);
    COMPRESSARRAY(ReportColumnHeaders);
    

    the filler character in the part of the code
    ...END ELSE
      IF ReportColumns[ColumnX] = '' THEN
         ReportColumns[ColumnX] := '-';
    
    is required to avoind compressing columns which are supposed to be shown but have no value.

    You can remove it after COMPRESSARRAY
    FOR i: = 1 to ARRAYLEN(ReportColumns) DO
      IF ReportColumns[i] := '-' THEN
        ReportColumns[i] := ''
    


    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • But it was not working...
Sign In or Register to comment.