views:

306

answers:

5

I am looking to add custom reports/forms to a web application. I want users to be able to upload a report definition/template file and then be able to print out a PDF or word document (one or the other it doesn't need to be both) for each of their widgets based off of the template they uploaded. I can't install anything on the server and am looking for an open source/free solution.

Data Source- The data will be in the form of a datatable or dataset that the application fetches itself. The report tool does will not be able to connect to any database.

A: 

We're pretty happy with the free StringTemplate.Net library for generating HTML reports (or any other text-based format). The templating language is simple enough that anyone who understands HTML should be able to adapt the templates. The HTML reports can be shown directly in the application with the WebBrowser control, and we use a commercial library to convert the HTML to PDF if desired.

A StringTemplate example from the 5 minute introduction:

<html>
    <head>
       <title>$title$</title>
    </head>
    <body>
       <p>Hello again, $name$ !</p>
       <p>Greetings to your friends $friends; separator=", "$</p>
   </body>
</html>

We have also used Microsoft ReportViewer before. This does have the advantage of coming with a viewer control for both WinForms and WebForms, export to pdf and excel, a search feature, SQL Server integration and advanced printing options. But AFAIK it requires Visual Studio to create/customize reports with the Report Designer; it does not really support report customization by end users. It seems to be more oriented towards the drag-and-drop programmer working in an environment with a full microsoft stack (IIS, ASP.NET, SQL Server).

Wim Coenen
I did look at the ReportViewer but I found it lacking as I couldn't really make a form with it. If I just wanted to pass it a DataTable with a single record and then use that record to fill out a form it didn't quiet work as I am used to using Crystal Reports where you can embed a field/parameter into a block of text.
runxc1 Bret Ferrier
A: 

Hi,

I'm developing a .net library intended to do this job. It works with RTF files. You provide the template and the data and it generates the RTF report. It includes a propietary programming language (a very little but powerful one :) ) including Loops for datatables (with and without conditions) and an "IF ELSE ENDIF" like sentence whichs allows it to conditionally generate parts of a document. It's also capable of using variables provided by the programmer, besides the datatables. I'm panning to include many other features such as formatting functions, raising events, etc. It will be a commercial product (a really very cheap one), and even it's still under development and needs much more testing, I'm pretty happy with it so far. If you are interested in hearing about it, keep in touch. Regards,

Gonzalo

Throw up a link and I'll give it a try. Oh and use something like IronRuby instead of a custom programming language.
runxc1 Bret Ferrier
Hello runxc1 Bret Ferrier,It's not uploaded anyware yet. If you provide me your email box I'll send you a beta as soon as I can. I don't know what's IronRuby. I'll check it, thanks. Anyway, in my case there are only two control flow sentences: IF and SCAN. You write their conditional expressions as if it was C#.Email me at desarrollo(dot)uruguay(at)gmail(dot)com.Regards,Gonzalo
I use gmail and my email is just runxc1.
runxc1 Bret Ferrier
A: 

If question still actual recommend to see FastReport.Net. XML templates and export filteres to set of different formats (and PDF of course).

Merl
not free or opensource
runxc1 Bret Ferrier
A: 

Ultimate Template Engine for .NET helps you to dynamically generate that content.

Mark Attwood
A: 

I recommend you to look at FastReport .NET.

programmer256