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

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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).
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.