Better option to print invoice without using crystal reports - c#

I am using crystal reports in my application that is window based in C# for printing sale invoices and bills but the problem is that it takes some long time to proceed , I need some real time and fast method for this purpose please suggest some solution.
I link my crystal report by a procedure from database, is any alternative for printing invoice rather than crystal reports...

Crystal is "fast" if you take the time to learn what makes her happy. In my experience, the actual printing can account for most of the processing time. It may only take 25ms to create the .rpt file, but then 5000ms negotiating with a printer server. I have spent weeks wrestling with Crystal server-side printing.
It makes a BIG difference:
How you are printing : ReportDoc.PrintToPrinter vs. PrintOutputController.PrintReport
Whether the selected printer uses the same driver as the printer you used to develop the report.
Whether the printer is installed on the server (or just on a remote printer server) and whether it's installed in the profile of the IIS_Identity.
If you are configured incorrectly it can take 1 - 2 minutes to print a report (based on first hand experience). Make a few tweaks and you are suddenly < 50ms.
For instance, if you are using PrintToPrinter() and the specified printer is not in the list of .NET installed printers for the IIS user, it will take a long time to print. Install the printer so it's available to the IIS user, and bam, printing is instantaneous.

I faced an issue in one winforms project where the report was taking a long time to load but it was only for the first time. Later when reports were run, they had no issues at all.
We assumed that time was taken by framework to load crystal assemblies in memory.
So I created a hack that whenever application is run, I loaded an empty report in a background thread.

Related

ASP.NET Crystal Report Print Automatically

I would like to know if exists the way to send a crystal report directly to the printer without print dialog. Ex. I have an asp.net page with a crystal report viewer and I want send to print once the report have been loaded into the viewer.
I saw an application what it is doing that but I don't know how that work.
I am using
Visual Studios 2010
Crystal Report for .NET Framework (Version=13.0.2000.0)
C# 4
if have a code sample (will be great!!!!)
I have read lot of resources in internet but nothing give me idea how to do what I need.
Thanks in Advance.
J.S.
It does not working like you think. Method PrintToPrinter generates printout directly to printer. Report preview also do the same. If you are executing both methods then report is generating twice. If you have more pritnout pages then report preview generates only visible pages. In most cases this does not change anything, but if report is generating a lot of time, then you are getting a lot of resources from system and you can expect deadlock on database. You also have to remember that if your report is generating new data per each executing then you will have doubled data.
Good I did it
I Just set this values to the ReportDocument.
CrystalReportDocument.PrintOptions.PrinterName = "Printer Name";
CrystalReportDocument.PrintToPrinter(1, true, 1, 1);
anyways I am open to other ideas and suggestion.

Webform ReportViewer Service Unavailable, timeouts and performance issues

We are currently using ReportViewer control embedded in an aspx file to render RDLC files for an MVC Web Application. The data is fetched from an SQL Server using nhibernate, the ReportViewer is running in Local Processing mode. The various reports contain calculations within the RDLC including sums, counts and grouping.
We are finding the reports using this method run terribly slowly, usually causing the web server to display the Service 'Unavailable Error'.
It appears that the live servers do not have enough resources to run these reports, and even in an environment where the servers have much more memory and CPU speed, while the reports do not time out, they take a very long time to render even a single report.
Does anyone have recommendations on this matter. How can we reduce the amount of processing time for these reports?
From observing the resource usage, the calculations carried out internally by report viewer on the data are taking a great deal of time. As an example of the data we are looking at about 3000 individual reports, using over 40000 records to calculate from.

Good web reports designer

I faced wuth task of creating system that will generate various medical papers for patients based on DB data. There is a lot of 3d party companies that will use this product therefore this product will be web-based. The main purpose of this product is printing this papers I have described above. Users already has prepared paper blank on which personal information will be imprinted. All users has various printers and the main issue I need to solve is that every printer prints in own maner and imprinted characters losts their positions.
The possible way I can solve this is to provide reports designer embedded in system, that allow every user "adjust" report to get printer prints properly.
By the way, we has all necessary documents reports storing in .fr3 files. It's 'cause we use same reports in another desktop application and we use fast report engine in that application. So the only one web reports designer I have found is Stimul soft reports web designer. But it's big, awkward and seems too heavy for this small project. Could you guys advice me some lightweight web reports designer/engine that can solve my issue?
P.S.: sorry for my English. I will use ASP .NET MVC3 (C#) for implementing this project.
The key question is do you need report design via the browser, do you merely need printer positioning, or can the report design be performed on the user's computer and it's just report generation that must be on the browser.
If you need report design in the browser then you are limited to products like Stimulsoft which as you said tend to be ackward and limited.
What you may be facing, based on your question, is that you need to position the report on the printer as all printers set the upper left of the generated report in a slightly different place on the paper. The best way to handle this issue is to make your report work fine regardless of the upper left of the printing on the page as the differences are small. But if that won't work, just prompt the user for the adjustment values.
Finally, if you want a system where it is very easy for non programmers to design reports, and the designer can be on their computer, please take a look at Windward Reports (disclaimer - I'm the CTO at Windward. With Windward you design your reports in Microsoft Word, Excel, or PowerPoint so it is both very easy and very powerful.
I does not understand what your problem is with position. A normal reporting solution print identical on different printers (not valid for old 9 dot printer).
Do you want print in a form (blank)? i-net Clear Reports has a page option for form print and an Online Designer. You find the form print option in the page setup dialog. If you enable the form print option the left and right margin will not change and the print will not scale.
Or do you search a simple designer in a browser? Then you can take a look in the ad-hoc reporting.
Use SQL-Server reporting services (2008 R2 in it's latest and most bug-corrected version).
It can render to HTML, and export to PDF, XLS, CSV and to Word (Word only with a commercial custom extension).
It also has a COM-object, which allows the report to run standalone, without SSRS installed.
SSRS also supports OracleProvider, apart from SQL server.
If a MS-SQL dependency is an overkill, you could take a look at Eclipse BIRT, which is a Java SSRS clone, which has a web viewer and JDBC database connectivity (however, the report format is not compatible).
The bad thing about it is, that it requires the version of Visual Studio that came with the SQL server version (so no designing of SSRS 2008 R1/R2 reports in Visual Studio 2010, you need Visual Studio 2008).
take a look into List & Label. It has a Webserveredition for generating output on web-applications and if you need to modify them there is an ActiveX available. We've done some successful projects with this stuff. Just try it out!
Take a look at Izenda AdHoc
.
In-browser Designer, In-browser Viewes, highly customizable but very simple API, exports feature, multiple databases types support.
You could even change reports looking using CSS styles.
Of course, compatible with MVC.

Crystal Report load very slow when running on different database than report file

I'm using Crystal Reports 2008 SP2 with a C# .NET 4.0 application. In the application, we load Crystal Reports using this the Load method on ReportDocument:
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(fileName);
This works fine when the database name that is embedded in the report is accessible, but when it's not (e.g. this is running in production or UAT, where the database names are different), this Load method is very slow. I think this is because Crystal is attempting to verify the report (or something like that) on the database that is embedded in the report.
Is there a way to turn off this behavior in Crystal or modify the report so that the database name is not embedded in it?
Thanks!
Crystal reports takes a long time to load its DLLs at the first time you call a report. What SAP suggest is to load a dummy report at the first app excution using a thread or a background worker to get DLLs ready when calling your production reports.
Hope it helps.
This is likely to be a result of a number of effects. Firstly preloading the dlls will help but only for the first report. If lag continues to be a problem after dll preloading is introduced it is likely that the lag is being caused by the dlls having to ensure that the schema of the database you are connecting to matches that of the original database. This "should" only occur first time you run against the new database so it may help to pre-run some reports against the new database to ensure that they know that the data dictionaries are verified. CR is actually not all that buggy contrary to popular opinion, it is just quirky!

ASP.NET: Strategy for handling really large reports

Maybe not specific to reports but still...
In my asp.net mvc web application there's a section for reports that show 5 columns of data that map almost directly to a table in the db.
The problem is, in some cases, the length of that report may exceed 40,000 records (I know, nobody can really process 40,000 records of data but the report is what it is) and as you can expect, it times out and throws an error.
The question is, what's a good way to process and deliver a report of that size? I thought about creating a small little console app that would build the report outside of the webserver but I'm kind of at a loss as to what direction to look into?
Does the report need to have up-to-the-minute data? If not, you can look at generating the report as a PDF at night (or whenever your server isn't busy) and just providing a link to the PDF. A scheduled task that runs a console app as you suggested could create the report and output it to a file. A lot of reporting tools like Crystal Reports will allow you to export the report to a PDF or an Excel spreadsheet. For that matter, you could generate the report on a completely different machine and then copy it over to the web server. This could allow you to update the report every hour (or whatever) without putting such a load on your web server.
Generating the report while the user waits is probably not a good idea (not to mention SQL / IIS timeouts etc)
You could get the user request a report, then have a windows service pick up these requests, generate the report and email the user? (or have some kind of ajax polling script on the site to notify users when their reports are ready?)
You could extend this to scheduling of the same report at recurring intervals etc.
I would look into SQL Reporting Services (assuming this is running on SQL Server). There's several delivery options which may be better suited to your application's needs (you can schedule a PDF or Excel document to show up in someone's mailbox every night, for example).
There's also a great article from the StackOverflow team that allows background processes within ASP.NET if you can simply generate this report every so often instead of on-demand (maybe every 5-10 minutes?)
https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/
Another frequent usage I've seen to handle large scale reporting is setting up a windows service that does the physical generation of the report which dumps the completed binary into a database or file store somewhere and then updates data to show the report is complete with the information needed for the application to link the completed report.
Then you could have your do report button fire off a request to initiate a report and then move them to a processing report page where it lists all the reports queued up / processing for them.
It's doubtful that a user would ever actually look at all of a 40,000 row report. So why not show just the top 1,000 most current rows ordered backwards? If you're using a reporting solution that supports on-demand reports, you could always drill down to second report that shows the next 1,000 most current rows. Just a thought...

Categories

Resources