Ad Hoc Page Code Samples

The following code sample creates an ad hoc page with a dimension and two dive dimensions.

  ad-hoc-page { 
    title "Ad Hoc Page Ex 01" 
    cplan "/cplans/basic_101.cplan" 
    
    dimension "MCD Name" 
    
    dimcount-dimension "DMA Name" 
    dimcount-dimension "Ethnic Type" 
    
    text column = "Cases" { 
      value-format "#,###.00" 
    } 
    text column = "9 Liter Cases" { 
      value-format "#,###.00" 
    } 
  } 

Here is the Closedresult of the code in DiveTab.

Ad Hoc Page with 2 Dimensions, 1 Dimcount, and 2 Summaries

NOTE: Dive dimensions are collapsed initially and can then be expanded in the client.

The Closedcontext menu in the first dimension allows you to switch dimensions.

Ad Hoc Page showing context menu

When you switch dimensions, the dimension becomes a dive dimension and the dive dimension that you selected becomes the dimension in DiveTab.

NOTE: Any changes the user makes in the DiveTab client are temporary. You must modify the code to make permanent changes.

Here is an example with Closeddimension MCD Name switched with dive dimension DMA Name.

Ad Hoc Page dimension switched using context menu

Notice that MCD Names now appears as a dive dimension and DMA Names as a dimension.

The yellow columns indicate DimCounts, which have active links for diving. Here is the result when you select the Closeddive dimension MCD Name value link for dimension DMA Name value NEW YORK.

select 69 for the New York row

The words in the darker blue title, DMA Name: NEW YORK | MCD Name, indicate the dimension value and the summary from the parent page; the intersecting value contains the link to the page shown in the previous image.

The following code block creates an example of an ad hoc page with more columns.

  ad-hoc-page { 
    cplan "/cplans/basic_101.cplan" 
    title "Ad Hoc Page Ex 02" 
    
    dimension "MCD Name" 
    
    dimcount-dimension "Corporate Supplier" 
    dimcount-dimension "Corporate Brand" 
    dimcount-dimension "Customer" 
    dimcount-dimension "Premise" 
    
    quickview-dimension "Corporate Product Sub Group"
    
    available-dimension "Corporate Product Group" 
    available-dimension "Corporate Item" 
    
    text column = "Cost" { 
      value-format = "$#,###.00" 
    } 
    text column "Net Sales" { 
      value-format "$#,###.00" 
    } 
    
    available-columns {
      text column = "Cases" 
    }
  } 

Here is the Closedresult of the code in DiveTab.

Ad Hoc page with multiple dimensions

Notice that the first dimension column is not considered a MultiColumn.

Here is a Closedcontext menu for a dive dimension, which allows adding it as a MultiColumn.

Ad Hoc page showing the content menu.

Here is the result when the ClosedCorporate Supplier dive dimension is added as a MultiColumn.

The result of adding the MultiColumn to the Ad Hoc page.