0

I'm curious if docmosis can support pulling information from a database to generate a table. For ex, i want to generate a document that shows in a table topics about various states, like state capital, state flower, state population, etc.

I have a form that collects information from the user: which states do you want to include (from a multi-select pick list) and which topics about each state do you want to include (again, from a multi-select pick list). But the topics about each state is stored in a separate "database". It could be a GoogleSheet, SharePoint list, etc. That information is NOT included in the docmosis template.

When docmosis generates the document, it would iterate through the information provided (every state and topic), pull that information from the database and then insert that into the generated document.

If so, how is this done?

user1821431
  • 63
  • 10

1 Answers1

0

Docmosis expects the data to be provided at the time the document generate request is made. This means your code typically sources and organizes the data, then provides that to Docmosis to use.
Doing it this way also has a significant advantage for diagnosing problems. When something is not working as expected, reviewing the data along side the template can often reveal the problem. Specifically, the Docmosis Java product can pull data out of a database using a DataProviderBuilder.addSQL() methods and you can add multiple SQL sources. However, as mentioned above, it is better to extract the data as a separate stage so it may be debugged and diagnosed independently.

Paul Jowett
  • 6,513
  • 2
  • 24
  • 19