1 Reply Latest reply on Apr 21, 2011 9:19 AM by jbarrette-esristaff

    Interesting Problem: Changing Feature Labels in Data Driven Pages

      Hi All-

      I am trying to work out a way to change between two sets of labels on a map.  I have a map with zip codes that are labeled and I want to be able to output two maps: one with the zip code label (ZIP) and one with a value from a field I have joined to the data (called chrlabel).  The goal is to have one map showing data for each zip code, and a second map giving the zip code as reference.

      My initial attempt which I can't get working looks like this:
      1) I added a second data frame to my map and add a new layer that contains two polygons with names "zip" and "chrlabel".
      2) I use this frame to enable data driven pages and then I hide it behind the primary frame (I don't want to see those polygons, I just want to use them to control the data driven pages).
      3) In the zip code labels I tried to write a VBScript expression like this pseudo-code:
      test = "<dyn type=""page"" property=""name""/>
      If test = "zip" then
        label = ZIP
      label = CHRLABEL

      This does not work because the dynamic text does not resolve to the page name in the VBScript.
      Is there some way to call the page name in VBScript so that I can make this work?

      If not, is there another way to do this?
      My other thought is to add another field to the layer that gets filled with a one or a zero.  Then I could replace the if-then test condition with if NewField = 1.

      Then I would just need to write a script that updates all the NewFields for the zipcode features when the data driven page advances to the second page.  Is there a way to trigger a script (python or other) when a data driven page changes?

        • Re: Interesting Problem: Changing Feature Labels in Data Driven Pages
          Is the objective to always create facing pages?  In other words, every other page will show business data labels and the adjacent page will show zip code labels.  If so, I could go two different ways.

          1) 2 Data Driven Pages MXDs and arcpy.mapping to append the pages together.

          - One MXD would have all your business labels presented.
          - One MXD would have all your zip code labels presented.
          - Export each set of MXD/DDP pages (e.g., 25 pages each for a total of 50 pages)
          - Use arcpy.mapping to create a new PDF and programically append every other PDF.

          2) Do it all with arcpy.mapping and with one MXD.

          - with arcpy.mapping you have the ability to control the individual pages.
          - after advancing to each page, simple toggle layer visibility and export to PDF
          - you would export 2 times for each page extent.

          Check out the following help topic: