In version 2.0 we added the external document's data (gn4:extDoc) to the workflows wf_GN4Report.xml and wf_GN4ReportEdition.xml, which creates and populates the tables of the statistics database.
This allows to create statistic reports that consider both the GN4 editorial objects (editions, pages, articles, texts, ...) and the external sources, like the documents created by InDesign and imported in GN4.
The structure of the GN4 statistic database generated by the standard wf_GN4Report.xml is described into the GN4Reports.docx in GN4Docs.zip.
Important!
The wf_GN4Report.xml workflow cannot modify an existing table in statistics database.
Because the 'ExtDocId' column has been added to the ReportElementXTable table, running the wf_GN4Report.xml workflow on an existing statistics database causes the error "Invalid column name 'ExtDocId'".
To fix this problem, you have to run these SQL commands on your old statistics database (called, for example, 'GN4Report'):
USE GN4Report
GO
ALTER TABLE ReportElementXTable ADD ExtDocId int null
GO
ALTER TABLE ReportElementXTable DROP CONSTRAINT UK_ReportElementXTable
GO
ALTER TABLE ReportElementXTable ADD CONSTRAINT UK_ReportElementXTable UNIQUE (ItemId, LayerId, ExtDocId)
GO