I’m selecting a report generator for my .NET winforms app and it’s driving me crazy. I’m not familiar at all with report generators so…
Does anyone knows of a report generator that:
1.- Is easy to deploy in relation to the main app
a. (Least, least, least desirable)
Have a separate scriptable/silent installer
(I can make the app installer call the
report generator installer)
b. (I can live with this) Have an
“integrable” installer (An integrated
installer for both the App and the
report generator can be made easily)
c. (Most desirable) Clickonce/xcopy
installation possible (no installer at
all!!! yay!!!!).
2.- Is scriptable to some degree:
a. (I can live with this) Is it
possible to change certain properties
(image sources, colors, visibility,
widths, etc.) at runtime?
b. (Most
desirable) Is it possible –in addition
to the previous item- to add/remove
elements to the report at runtime?
3.- Self-adjusts when you resize the page:
a. (Least desirable) You have to
manually resize things dynamically
accessing the report structures
(related to 2a)
b. (Most desirable) The report and its
elements adjust automatically to the
available canvas/paper size (as HTML
pages do, using percentages)
4.- The size of individual elements in the report grows/shrinks in accordance to the content displayed inside (elements could be grid’s columns):
a. (Least desirable) The element only
grows vertically to accommodate bigger
content (no clipping).
b. The size of the elements can be
self-adjusting to content (like a
<div> element). Columns in a grid for
example should grow/shrink according
to content (as in a HTML <table>
element without columns widths)
5.- It should be possible to export a report to at least excel and PDF.
6.- The report viewer should support languages other than English.
I don’t know if my needs are unrealistic, but report generators are not my thing, I’m at a loss here.
Anyone with experience on the field can give me any pointer in the right direction for me to investigate?
We use DevExpress' XtraReports which works in WinForms, ASP.NET, WPF and Silverlight. It is fully featured and should be capable of most if not all of what you are wanting. Find out more here:
http://devexpress.com/Products/NET/Reporting/
I have been in your position many times (architecting a WinForms app with a reporting feature) and I think your best bet is, wait for it... Crystal Reports. It meets all the criteria you laid out but does have the caveat of a very large redistributable runtime. It also has a .NET SDK, an embeddable designer etc.
Related
I am working on a contract management system on c# form application, one of the main parts of the project is to create a letter.
In this part of the application a user can send a letter with in the shape he or she wants, so I need an editor like FCK in html, because my users should be able to insert table insert image and etc.
Any idea how to get this working? Any concerns?
You could indeed use a HTML WYSIWYG editor, but depending on the quality of it, it might raise problems when converting the output of it to print. This may also depend on the framework used to generate the Word document.
In one of our environments, we use CKEditor and JasperReports. That combination is suitable to export to Word, since JasperReports supports reading HTML and convert that to Word.
However, the best solution may depend on your business requirements and personal preferences.
If the application is a business application, another option is to let them edit the document in Word. Our company (disclaimer: I am biased) has build a product that supports editing a Word document from a template loaded and filled from a database (or multiple databases). However, if it is useful to you depends on your business requirements.
FCK is history now and as mentioned by others CKEditor is the successor. TinyMCE would be another alternative, or any other might be..
But what I want to mention is along with possible printing issues (that I have never dealt with) I want to underline another aspect:
my users should be able to insert table insert image and etc.
uploading and inserting images might be another issue...they don't come with a built in uploader, they sell it. you have the option to buy CKFinder along with CKEditor and Moxiemanager along with TinyMCE unless you choose to handle upload and insert into the editor process yourself.
I have a timetable in memory, and need to be able to print it out.
The timetable will likely be many pages, each page will look quite similar:
A grid of cells, across the horizontal axis is time, and along the vertical axis is entities. Cell x, y will contain the allocation of a particular job to entity x at timeslot y.
I'm looking at the System.Drawing.Printing.PrintDocument class but it's incredibly cumbersome. I need to set an event handler to the PrintDocument.PrintPage, yet there doesn't appear to be any way to get the page number from the PrintPageEventArgs?
I just want to construct my document and call some Print() function. I suppose if I could get the page number within the event handler, I could construct the page layout on the fly with e.Graphics and GDI.
I could potentially even put together a HTML page using tables and print that - if I could somehow control what prints on what page?
Is there a better way to construct and print documents in C#?
The target machines do have Office installed, but they're all different versions and I've had lots of trouble getting correct versions of the .Net/Office interop library to work with them.
Edit: I could potentially even create a temporary LaTeX file on the fly and compile it, then print it. This seems like a good solution, except that the target machines are locked and the users can't install new software, hence I would need to bundle the LaTeX compiler with my program, and my compiler is almost 300MB.
Sounds to me like you're giving up too soon. Handling the PrintPage event isn't that difficult and since the event is raised sequentially, all you have to do is keep a page counter in that event. That's how I've done it in the past with MetaFile images (printing Reporting Services reports through a web service call).
I build a similar tool by using the Microsoft Chart Controls, easy to use.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&displaylang=en
If you can save it to a file, you can use this here,
Print images c#.net
I'm currently having a couple of reports which I print from my Forms applications.
However building printed reports only with the built-in .NET printing methods is very tedious. Even just printing a simple table on a couple of pages with a little bit of formatting is a task for a couple of hours (if it should look nice).
What I need is a WYSIWYG-Designer for the layouts, so I'd like to write one.
It shouldn't be for End-Users, but for me as a developer, it's just about to create the layout what the report will look like with various arrangements/fonts/images/formats and so on and not have to do that by trial & error in code (and restart the app a zillion times).
So my specific questions:
What would I use as a canvas for editing and display of the report? An image-control/bitmap which I draw upon like on the printed document? Is there a better way?
Is drawing on a form comparable to drawing on a printed page? What about differences in resolution printer vs. screen?
How to get real WYSIWYG? Should I get the printer settings and create my canvas with the same resolution? Is there something else to consider?
I know that there are report designers around but I think it's sometimes good to understand the basic working principles of what you use and implementing them is for me the best way to do that.
I'm aware that this is not a specific question A to which the answer is always B, but if it were that way I would find an answer in Google pretty quickly.
Thanks in advance!
I can't say much about designing a WYSIWYG editor, but I have written a few custom in-house reporting engines for use by our development team.
There's two main ways I've created reports. The first is using PDFsharp (MIT-licensed) to manually layout pages which isn't for the faint-of-heart.
The second is using Winnovative's HTML to PDF library (not free, but royalty-free) which uses the current installed version of IE to do the layout and spit out a PDF. It looks like they've recently released a new version called EVO PDF which I have never used before.*
For the HTML to PDF solution, it supports JavaScript so you can add in charts from JavaScript libraries like flot or jqplot.
*I'm not affiliated with Winnovative.
You might want to save time and use Visual Studio HTML designer as your WYSIWYG editor.
What I'm currently doing is using ASP.NET MVC 3 as a simple reporting engine. You can use the MVC pattern to really separate your reporting data source (Model) and the rendering (View) while using Visual Studio as your report designer.
From your application you can easily call your actions with the report optional parameters. For example:
http://localhost/Report/Customer/Orders/1
You simply get the returning string from a WebClient's DownloadString method and you have your report generated.
There is some down side using HTML, mainly the difficulties to know when a page would break, but by using code in your View you can calculate the amount of repeating items and add a CSS break-page and re-starting your table's header on the next page.
You can achieve anything from graphics, to table, you can even generate link to other reports.
HTH.
Printing Reports in Windows Forms
http://msdn.microsoft.com/en-us/library/ms996472.aspx
What is the best reporting tool other than crystal report using with c# and mysql because crystal report has to be downloaded in user machine ? So what is the other alternative of the crystal report for using c# with mysql and should be less in size and user will not have to need to download more.And it should be with good features. (All open source and with paying charge.)
EDIT: I have need of printing only control on the form dynamically, like if user want to print third party control then also it should be printed, but it should not be printed like image of the treeview like if user wants to print the treeview on the window form but treeview is collapsed by user so here if user prints this treeview then it should not be printed collapsed treeview and but it should be printed whole the treeview(expanded).
Not a reporting tool at all, but if you're most interested with simply having a PDF output I recommend iTextSharp. You can then fill the report with place holders to be replaced with variables as you would any software - prior to the user downloading it.
Not the best method I agree, but it all depends on what you're looking for.
Two options for you to use
SQL Reporting Services - this has a requirement that you install a Microsoft SQL server with SRS but your reports themselves can connect to other databases, including MySQL (via ODBC) and you can then use the ReportViewer component in your C# applications to render it. There is no additional downloads for the user as the processing happens server side, plus it is easy to embed into web apps, SharePoint etc...
Visual Studio 2010 does ship with fantastic reporting controls which can use any data source. If you on 2008 you can use the out of band release of these same controls. In all cases these are just code so it's a few extra assemblies to deploy. You can see samples of these in: http://code.msdn.microsoft.com/mschart
I have thought of three approaches to create and maintain resources in .Net projects for WinForms using Visual Studio 2008. (I am sure there should be more than three ways.) I need to decide on one before starting to implement internationalization for our product.
Have individual sets of resource files (resx) for each windows form or piece of UI (a custom control) in each .net project. These are auto generated by Visual Studio when Localizable property is set to true in the form or control properties.
Have one resource file per .net project. This is added manually and updated manually with the resource strings and messages.
Have one resource manager project that has resources for all the components for a set of .net projects.
Personally, I do not like the first approach as it creates numerous resources files. The only advantage we get in this approach is that we do not need to set text in UI elements manually.
I like second and third approach as they are easy to maintain and there is only one set of resources that you need to handle. So no duplication of strings and messages. Easy for the translators also.
What are your thoughts? Please share.
I have tended to use VS to create the project and provide the default set of resources but then maintain any additional resources outside of visual studio via the SDK tools winres.exe, resgen.exe and al.exe.
You can maintain the resources in a fairly simple folder structure of one folder per culture and just have a batch file or two to build the resources into satellite assemblies. This gives you the advantage of keeping the VS solution to the core product and all localisation can be done after the fact.
If internationalizing your app means more than translating pieces of text you should go with the first one. You can create satellite assemblies to deploy different cultures. This way you are not localizing just text but also images, control layout, etc. This is the way how Microsoft recommends it and they have good reasons for taking this approach.
I've found that the simplest approach to internationalization is to simply maintain a list of all the different pieces of text in your application (labels, buttons, form captions etc.) in a spreadsheet or tab-delimited file of some sort, and then send this file to the translators to add (in one additional column for each language) all the translations.
You then call a simple method in the Load event of each form (which are all maintained in English) that iterates through all the controls on the form recursively and changes their Text properties to the translated values for whichever language you're translating the app into. The language can either be determined programatically (I forget where in the .Net namespace this is indicated), or you can have a simple language selection dialog when the application first starts (the advantage of this second method is that your app can be translated into whatever language the user wishes, without having to set the language for all of Windows - this is especially useful for kiosk applications).
In my opinion, creating and maintaining all the different internationalized versions of every form is a major pain, although it is useful when the translated text values are significantly different in size from the English versions.
Personally, I prefer the first approach because the context (in your case, the forms) is very important for a translator to do his job perfectly. In your second and third approach, the context is gone because it is just a list of strings.
Yes, the first approach can be a pain to maintain but at least your application would be translated correclty.
I personally love to add a single project .Resources.
Next I enable Microsoft MAT ( https://developer.microsoft.com/en-us/windows/develop/multilingual-app-toolkit ) and manage all my translations via MAT.
This way you can also recycle translations from other solutions, saves you time ;-)