I work on some project that is migrating from vb6 to web (asp.net). I need to print some kind of report - A table from database and number of simple headers with date and time. In vb it was implemented using vsPrinter object. Is there any Class in C# that is similar to this Class in vb6 in its functionality? If there in no such thing in .net, what is the easiest way to do this?
Thanx for assistance!
Remember you are moving to the web so you don't have access to the hardware printer controls. You only have access to what the browser gives you. If you are not doing anything fancy with this you can do one of two things.
Since this is an ASP.NET webpage, simply create a new browser or popup and render your report as html. The user can them choose print from the browser print dialog or you can launch it with some generated javascript.
Use the Microsoft Report and Report Viewer controls is you need more formal report layout. These are available from your toolbox under the category Reporting.
I think the easiest way would be by using any reporting tool, one of the powerfull tools is Crystal reports, just google it an you will find alot of useful tutorial such as:
Creating Crystal Reports using C# with Datasets.
Crystal reports in ASP.NET
You can also find alot of useful threads about it here in SO under Crystal Reports tag, like:
How to use Crystal Reports with ASP.NET?
C# Crystal Reports Tutorial on asp.net?
Related
I am developing an application using C# which is simply the user inputs data, it is saved in a db (which is not SQL Server but MySql) and then prints it.
At this stage the user gave me a template which has the logo and some company information on top, in the middle the lines i need to fill and on the bottom some other information regarding this company.
Is it possible to open this document fill the required lines and print it using c#?
Sorry i cannot provide anything but i am stuck here and can't seem to figure out from where to start?
Thanks & Regards
Do you have access to any kind of reporting ie.Crystal Reports or SQL Server Reporting Services. You have one of 2 options, either you need to write a report that mimics his template using one of the technologies above, or you would need to use interops to access MSWord or MSExcel and do it that way. You may be able to use some third party PDF software.
If this was my project I would go the report route.
How can I create reports (like well-formatted pdf files) and analytical graphs with C#/.NET?
Are there native libraries for this purpose?
I use finaquant's table function library for table operations. I need to integrate some additional functionality to generate reports and send them to proper addresses by email.
You can use rdlc or crystal reports for that. You can create well-formatted and complex reports with these reporting frameworks. By default it gives you functionality to export the data to excel, pdf and word. You can also use report viewer to view the data on a web page.
See below link for the tutorial on rdlc reports:
http://weblogs.asp.net/rajbk/archive/2010/05/09/creating-an-asp-net-report-using-visual-studio-2010-part-1.aspx
There are a lot of reporting tools on the market. As Adarsh said you could try a free crystal reports, but if you need a higher level of customization and flexibility, there is a very good reporting tool List and Label which offers a .NET Api as well.
If you don't want to program it yourself and you have access to the database, then you can use some third party reporting engines like DBxtra which lets you email the reports automatically on an scheduled basis.
I have a windows service that creates an hourly PDF report out of some DB queries.
Currently, I'm doing it using the reportViewer control (Microsoft.Reporting.WinForms.ReportViewer) and from it I render my report to PDF.
This method works, but I think there must be a simpler way to do that (since it's a windows service i'm not actually using the reportviewer for viewing purposes - and it seems kinda strange that there's nothing that will provide this functionality without the GUI part).
The question is: how to create a PDF by using the SSRS functionality without creating the GUI control or accessing a web service.
Thanks in advance,
Shmouel
You can try IText component to create pdf.
I used telerik Report controls to do this. But i guess its the same if you use VS 2010 reports as well.
create a separate reports project in your solution and drag and drop ( or through code) create what ever report you want to generate.
expose a generate PDF method (public member) where you convert report to PDF
use this dll/project in your windows service solution
use the exposed method to create PDF for you.
I have done exactly this for our windows service.
I have created one Windows Forms application with C# and MySQL (using MySQL Connector). Now I need to create some reports from data in my MySQL database, and print it out.
I've tried Crystal Reports, Visual Studio 2010 reports and so on, but all seem complicated to use with my entity dataset.
I'm using LINQ to get queries. Is there any way I can create reports like HTML format and simply print them through the application? Someone asked me to send my data as RTF and straight without saving or printing it, but I cannot find a good tutorial for creating RTF like that.
ReportViewer is a freely redistributable control that enables embedding reports in applications developed using the .NET Framework. Reports are designed with drag-and-drop simplicity using Report Designer included in Visual Studio 2010. The ReportViewer site will give you all the necessary details. It may be a bit complicated, but it will do what you want. Reporting is a little difficult to understand anyway for a novice user.
I hope you want something like below.
I am creating a windows application.
I am now concentrating on the Reporting Module of my Application.
I have two ideas to do this task.
Either through Crystal Reports or using the Windows Forms and placing the Data Grid View.
Can any one suggest me which option should I choose?
Also the report should be able to Export in the Excel and PDF format and even it should be Printable.
I heard from others that Crystal Reports gives some problem at the time of Deployment.
Please suggest me. I am very much confused.
Thanks in advance!
Visual Studio 2005 and later comes with Microsoft Reporting tools that are so nice and, for me, better than Crystal Reports.
Update: You can install the Microsoft Report Viewer Redistributable 2005 or 2008.
Yes, I would advise not to use Crystal Reports (or Crusty Reports as they have unfortunately become known as in my department). We have had a whole load of problems from reports being corrupted and requiring recreating to simply being clunky and slow.
As our applications are being upgraded we are moving over to MS Report Viewer, which is far better. You can export to Excel from the report viewer.
Use SQL Server Reporting Services (SSRS). It gives you all the same functionality as Crystal Reports and will let you do your exports into whatever format you like (pdf, csv, txt, xls, etc.) right out of the box. You may run into some problems when trying to export to xls/csv when you are using embedded tables in your reports but microsoft is supposedly fixing this in the next release.
Try generating your reports in XML. Later you can decide/change which tool/technology you want to use, without doing much modifications. :-)
You should check out DevExpress Reporting controls, they rock, and are very easy to use. They also allow you to print to various formats like PDF, they also come with an end-user designer.
DevExpress Page
I second the Microsoft Reporting tools. I am using them extensively in my WinForm App and so far so good.
You can specify whether they processed remotely or locally before deployment.
Here is a link to get you started --> http://www.packtpub.com/article/creating-report-with-visual-studio-2008
I suggest you Reporting Services (buid with sql server).
you can develop with VS and publish your reports to Report Server.
Recently abandoned Crystal Reports myself
because of the large number of bugs and crashes
in favor of FastReports. They even have a converter that restored my old reports that were built on Crystal