• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Dynamic reports


I need some advice on how to go about developing a feature in our application. What we would like to do is allow the end user to create a dynamic report - in other words, user A would have a different header than user B, body and footer can also be different and (if possible) user A would have a watermark/shaded image as the background to his report.

I have researched a solution, and a possibility is to have the user design their form in MS Word (with headers, footers etc) and then fill in the merge fields as described in this document:

An alternative to this would be to use something like this:

But I fear that the latter may be too costly.

Would the first option be a reasonable approach or does anyone know of a better way to achieve this?
We are using C#, VS2013, mysql db

1 Solution
David Johnson, CD, MVPOwnerCommented:
what is the import [database] and what is the output[pdf]?
Éric MoreauSenior .Net ConsultantCommented:
How much is OfficeWriter? I am also aware of http://www.docentric.com/ but never used it.
LIBRALEXAuthor Commented:
Hi David,

The database will be mysql and the output file will be in MS Word or PDF (If the customer has created a template, then it will be a MS Word template, which would make MS Word the preferrable choice)

Eric, I am still querying OfficeWriter on how much they would ask for a redistributable license (They don't have a price on the website and you have to query it with them via e-mail).
Increase Security & Decrease Risk with NSPM Tools

Analyst firm, Enterprise Management Associates (EMA) reveals significant benefits to enterprises when using Network Security Policy Management (NSPM) solutions, while organizations without, experienced issues including non standard security policies and failed cloud migrations

LIBRALEXAuthor Commented:
Thanks for the suggestions made. It would seem that a third-party solution would be a bit expensive due to the exchange rates applicable. Therefore I would like to review this question regarding developing an in-house solution.

What would be the approach for developing an MS Word report document to include custom headers & footers, but include application data from the application we are developing?
Éric MoreauSenior .Net ConsultantCommented:
>>It would seem that a third-party solution would be a bit expensive

Have you really considered the cost of in-house development?

As for you real question, you could create a template that the user will be able to change header and footer and maybe some other stuff depending on your data. To that template add fields and then use the mail merge option of Word as shown in http://support.microsoft.com/en-us/kb/301659
The accepted solution relies on Office COM and is suitable for scenarios where end users have Word installed on their machines. For server side installations this kind of Office automation has its caveats (see considerations for server-side automation of Office at this link: http://support2.microsoft.com/kb/257757). In such scenarios you have to use OpenXML - a pretty tedious task, unless you use 3rd party tools which make the task way easier.

I have been using Docentric Toolkit for any kind of document generation based on templates, which are merged with data at runtime. Your scenario is a school-case for this: several different templates, which have to be chosen and merged with data based on certain conditions. One thing I find very useful in complex document scenarios is Docentric's ability of conditional content, when only that content from the template is displayed in final document that matches required criteria. Documents often have to include tables with data, charts, customized headers and footers, subdocuments, etc. Output formats are docx, pdf or xps.

Bottom line is, if you have a budget for 3rd party tools it will definitely be cheaper than developing Office automation based on OpenXML API.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now