Adding Column Sets

When the same set of columns are required on multiple pages, save scripting time by defining the set in a definitions block. Pages in the script can then refer to the set name. This procedure steps through how to create and use a simple column-set.

  1. In your Workbench DiveTab project, select New > DiveTab Module.

    The New DiveTab Module dialog displays.

  2. Enter a file Name, and click Finish.

    The graphic version of the module displays.

  3. Click Data Area.

    The new data script displays.

  4. Add a line to the script before the data-area block.
  5. Enter a definitions tag.
  6. Between the open and closing braces, enter a column-set tag followed by an id attribute and value.

    ClosedFor example:

      definitions { 
        column-set id = "cs-basic" { 
          ... 
        } 
      } 
  7. Consult the cPlan, then enter the summary columns within the column-set block. For example:

      column-set id = "cs-basic" {  
        text column = "Cost" { 
          value-format "$#,###.00" 
        } 
        text column = "Net Sales" { 
          value-format "$#,###.00" 
        } 
        text column = "Discount" { 
          value-format "$#,###.00" 
        } 
      } 
  8. Add title and icon tags for the data-area block.
  9. Enter two report-page blocks under sections, using the column-set. For example:

      data-area id = "data-area-1" { 
        title "Adding Column Set" 
        icon "/divetab/images/trends.png" 
        sections { 
          report-page { 
            title "Report Page 1" 
            cplan "/cplans/basic_102.cplan" 
            dimension "Customer County" 
            dimension "Customer City" 
            column-set id = "cs-basic" 
          } 
          
          report-page { 
            title "Report Page 2" 
            cplan "/cplans/basic_102.cplan" 
            dimension "Premise" 
            dimension "Corporate Product Group" 
            dimension "Corporate Supplier" 
            column-set id = "cs-basic" 
          } 
        } 
      } 

Here is the Closedresult of the code for Report Page 1.

Report 1 using column-set

Here is the Closedresult of the code for Report Page 2.

Report 2 using column-set