Patent ID: 7870485

Claim:
A method for generating multiple documents using a template document, comprising: receiving a hierarchical data source, which includes a parent record comprising a parent field, multiple child records associated with the parent record, and metadata which describes data stored in the parent and child records, wherein a child record comprises one or more child fields, and wherein names for the child fields are stored in the metadata; receiving the template document which includes a table with one or more columns; generating a flat data source from the hierarchical data source, wherein a respective record in the flat data source includes a value for the parent field and names for the child fields, wherein the names for the child fields are extracted from the metadata; in response to generating the flat data source, generating an intermediate document using the template document by: populating a document field that is not in the table within the template document using the value for the parent field included in the flat data source; and populating column names in the table within the template document using the names for the child fields included in the flat data source, wherein generating the intermediate document using the template document involves using mail merge functionality; and in response to generating the intermediate document, generating a final document by populating values of the child fields in the table within the intermediate document.