I currently have a map book (data driven pages) with 160 pages, and counting, consisting of domestic water pipes for a city. I would like to create a Graphic Table Element with a summary row totaling the pipe lengths on each page. I have the ESRI Production Mapping extension. How can I add a summary row to the Graphic Table Element?
The original version of this question indicated that there is a field in your domestic water pipes layer consisting of 1s and 0s. You never indicated which "Name Field" you are using to iterate through data driven pages, but for sake of this answer, let's assume the "Name Field" is a field called "PROJECT_NAME." My recommendation would be to open your Attribute Table for your domestic water pipes layer, right click on this PROJECT_NAME field header, and click on Summarize. Your window will look something like this:
In section 2 of the Summarize Window, scroll all the way down to the Shape Length field (it may look different from this one depending on which DBMS you are using). Expand this field and check off Sum.
After you specify where you want to place your output table (I would recommend placing it inside a File Geodatabase, but it is ultimately up to you), click OK. You'll be asked if you want to add the result table in the map. Click Yes.
Next, Join your domestic water pipes layer to the summary table you just added to the map, based on the PROJECT_NAME field. Now, when you run your data driven pages, your Graphic Table Element can display a correct sum of pipe lengths for that page, based on the PROJECT_NAME field.
Since you will not be able to create a page definition on the same layer being used to cycle through Data Driven Pages, create a duplicate of your domestic water pipes layer (unless of course you are already using a different layer to cycle through DDP). Open the Properties of this copy layer, go to the Definition Query tab, click on Page Definition..., click Enable, and change Page Name Field to PROJECT_NAME, showing features that Match.
Now you can insert your Graphic Table Element, using your copy layer as the data source for the table. Be sure to set up data filters to Honor Definition Query, and if necessary, set up a limit filter of a maximum of 1 filtered item per page (this is because, depending on how your database is set up, your Join may have multiple of the same summary data in the Graphic Table Element).
Exactly how you set this up will largely depend on your existing data format for your domestic water pipes layer and what field you use to cycle through the data driven pages. Production Mapping Graphic Table Elements are a bit clunky, but with some tweaking and playing around, you should be able to get the desired result. Hopefully ESRI will have some more powerful table-making tools in ArcGIS Pro so we don't have to jump through hoops to generate summary data for our Graphic Table Elements in the future.