Page 1 of 2

Performance question when printing to matrix-printer

Posted: Thu Apr 03, 2014 6:36 pm
by PJoyeux
Hi,

I have to print batches of reports to a Matrix-Printers. In order to do this, I create a list of businessobjects (say 1500) and use PrintToDotMatrix() to print them. This works but takes a terrible amount of time.

It looks like the report is being created on the PC for 10 to 15 Minutes. During this time the application is not available and the printer queue stays empty. Then after the time has elapsed the app is available again, the print queue has one big job and the printer starts printing.

If I send the same amount of records to a laser-printer then it takes just a few seconds and the application is available again. Further in the printer-queue of the laser-printer I can then see the number of pages being printed, whereas in the Matrix-Printer-Queue it says only "1" page although the same number of pages are being printed.

This is how I print the report:

Code: Select all

objReport.PrintToDotMatrixPrinter(aPrinter, System.Text.Encoding.GetEncoding(1252), false, Stimulsoft.Report.Export.StiTxtBorderType.Simple, false, false, false, false, 1, 1, 1, objReport.RenderedPages.Count, true, "EpsonFX");
Why is there such a huge difference between using "PrintWithWpf" and "PrintToDotMatrixPrinter"??

Matrixprinter (using PrintToDotMatrixPrinter):
- Printing ~400 records takes 20 secs until the job is visible in the printer's queue
- Printing ~1000 records takes 120 secs until the job is visible in the printer's queue

Laserprinter (using PrintWithWpf):
- Printing ~400 records takes 3 secs until the job is visible in the printer's queue
- Printing ~1000 records takes 7 secs until the job is visible in the printer's queue

The reports are attached.

This could amount to a serious issue... :? I hope you can help me here...

Cheers,
Pascal

Re: Performance question when printing to matrix-printer

Posted: Fri Apr 04, 2014 12:01 pm
by HighAley
Hello.

We need a sample project with the business objects to reproduce the issue.
Then we will be able to know where the problem is.
Please, send us the sample project.

Thank you.

Re: Performance question when printing to matrix-printer

Posted: Wed Apr 09, 2014 11:52 am
by PJoyeux
Hi Aleksey,

are you sure you need my objects? Why would my businessclasses have any influence on this? The gathering/selecting of the data is fast. The difference starts during the call of "Print" or "PrintToDotMatrix".

Since the same report sent to a laser is so much faster than when sent to Matrix-Printer I am pretty sure that you can reproduce the problem by creating a similar simple report on your side. Create some simple businessobject-class (or use mine below), then create some 500 or more entities of it, then print (or preview) the report using Print() and then using PrintToDotMatrix()...

This is the structure of the businessobject. It is very simple, just strings:

Code: Select all

        public String Anrede { get; set; }
        public String Titel { get; set; }
        public String Nachname { get; set; }
        public String Vorname { get; set; }
        public String Vorname2 { get; set; }
        public String Vornamen { get; set; }

        public String Strasse { get; set; }
        public String StrasseZusatz { get; set; }
        public String StrasseNummer { get; set; }

        public String PLZ { get; set; }
        public String Ort { get; set; }
        public String Ortsteil { get; set; }

        public String Ansprache { get; set; }
        public int Kundennummer { get; set; }
        public String KundennummerFuerAnschriftenFeld { get; set; }

        public String AnschriftenFeld { get; set; }

        public String VeranstaltungsTerminLokalName { get; set; }
        public String VeranstaltungsTerminLokalAnschrift { get; set; }
        public String VeranstaltungsTerminZeitpunktMitWochentag { get; set; }
        public String VeranstaltungsBeschreibung { get; set; }
You sure have many sample applications or reports that work with business objects. Could you try creating two reports (one for laser and one for matrix with some code like <b> and <doublewidth> in it) and let both render and print?

Cheers,
Pascal

Re: Performance question when printing to matrix-printer

Posted: Thu Apr 10, 2014 1:01 pm
by HighAley
Hello.

Sorry, but we need more information about your issue.
We need to reproduce your issue to solve it.
It's impossible until you send us sample project.

Thank you.

Re: Performance question when printing to matrix-printer

Posted: Fri Apr 11, 2014 8:40 am
by PJoyeux
Hi Aleksey,

since you think this might have something to do with my BusinessObjects, I decided to test this whithout BusinessObjects...

I have created two reports similar to the one before but now using a direct datasource to an SQL-Server instead of business-objects. The datasource is a simple query that returns three columns and 4690 rows.

When printing on an HP Laserjet I can almost immediatly see how the printjob is created and grows (the amount of pages grows) until finally the print job starts. This takes a few seconds and is perfect...

An identical report designed for MatrixPrinters and printed via PrintToDotMatrix() takes "forever"... There is no printer-job visible in the printer-queue, the application is busy and after 10 Minutes or so the print-job finally appears and the printing starts. When I do this using BusinessObjects it takes even longer (up to 30 Minutes and more...).

So it seems that the rendering/printing of Reports using "PrintToDotMatrix()" somehow takes longer than when using the simple "PrintWithWpf()".

You can see this yourself by using your own query on your own database. Just let the query return more than, say, 1000 rows and then use "PrintWithWpf()" and "PrintToDotMatrix()"... I can't believe you cannot duplicate this issue...

Some information that might be useful:
[*]To access my matrix-printers I use the generic driver from windows ("Generic / Text Only") whithout changing any default-settings.
[*] The driver is installed locally.
[*] The matrix-printers are not attached locally to the computer (LPT, USB, ...) but instead accessed via LAN.

Please could you invest some time to set up a similar test and tell me your results?

The only solution that I see now, is to print each page of reports with larger amount of rows singularly. Instead of having one huge print-job I would have 4691 single printjobs in my queue but this is really NOT what I want to do...

I hope you can reproduce my issue with the setup described above. I don't see why you would need a sample project from me now, since I have the same problems using SQL-Server-Datasources...

Have a nice weekend nonetheless... ;-)

Cheers,
Pascal

Re: Performance question when printing to matrix-printer

Posted: Fri Apr 11, 2014 11:34 am
by HighAley
Hello.

Sorry but we still couldn't reproduce your issue.
There are to many unknowns.
Please, try to export the report to txt and then print it with SendStringToPrinter(string printerName, string docName, string text) method.
How much time takes export and printing?

Thank you.

Re: Performance question when printing to matrix-printer

Posted: Fri Apr 11, 2014 11:59 am
by PJoyeux
That's a good idea...

I'll give it a try and will tell about my results...

Have a nice weekend!

Cheers,
Pascal

Re: Performance question when printing to matrix-printer

Posted: Sat Apr 12, 2014 5:11 am
by Andrew
Dear Pascal,

You too! ))

Re: Performance question when printing to matrix-printer

Posted: Wed Apr 16, 2014 7:08 am
by PJoyeux
Just a quick update: I hadn't the time to check this further, but will do it in the next days in come back to you with the results.

Cheers,
Pascal

Re: Performance question when printing to matrix-printer

Posted: Wed Apr 16, 2014 11:46 am
by HighAley
Hello, Pascal.

We are waiting for any news about the issue.

Thank you.