I am printing my grid using the following code:
With UltraGridPrintDocument1 .Grid = ug_CommissionDetail .FitWidthToPages = 1 .DefaultPageSettings.Landscape = TrueEnd WithUltraPrintPreviewDialog1.Document = UltraGridPrintDocument1UltraPrintPreviewDialog1.ShowDialog()
The grid fills the landscape page nicely, but it is very slow.
When the grid goes over 1 page I get an InsufficientMemory error on my printer.
This HP is an office printer with 16MB memory.....should be sufficient.
I have also tried this printout using the PageSetupDialog and PrintDocument with the same issues.
What am I doing wrong?
Does the StyleLibrary have anything to do with this?
What version of the grid are you using?
I can't see any reason why this should fail with the information you listed here.
What exactly is the error message you get? Is there a call stack?
Can you duplicate this in a small sample project and post it here so we can take a look?
Mike,
I am using 2008.1.2161.
The error is not a PC or Infragistics error.
The printer will blink for about 1 minute and then print a PCL XL error page. All it says is
Error: InsufficientMemory
Operator: text.
Position: 245107
It would take me a little while to create a sample pgm.
I have tried 3 printers with this output. the first had about 2 MB and it choked. the second had about 16MB and it choked. the third has 32MB and it printed fine.
So I changed the AppStyle right before printing to reduce the amount of graphics. It will print on the 16MB printer now. But this is not a solution.
It seems that the UltraPrintPreviewDialog is sending the document as one continuous page and not breaking it up into pages. The printers are set up for spooling and that should force them to print upon pagebreak. But it acts like there are no pagebreaks being sent.
I've never heard of anything like this happening before. I don't see how this could be an issue with the UltraPrintPreviewDialog, though. The dialog just displays a preview of what will print. It gets the preview from the PrintDocument you supply.
Are you using the UltraGridPrintDocument? Even if you are, this class is derived from the DotNet PrintDocument class and it prints one page at a time and then sends that information to the print driver.
So if it's sending more information to the printer than the printer can handle, I can't see how the grid, the UltraGridPrintDocument, or the UltraPrintPreviewDialog could be involved in this interaction. This sounds more like a bug in the print driver - or at least it would if all three printers you tried it on are the same and using the same driver.
I am using UltraGridPrintDocument.
All three printers are different so there are three different printer drivers involved. Can't see that all three would have the same bug, but HP has been known to do this.
I agree, it seems very unlikley that it would be a printer driver problem if it happens on 3 different printers.
Can you create a small sample project which demonstrates the issue? If so, I can try it out here and see if I get the same problem.
It is unlikely, but also i thought it was odd that no other posts have been made about it. I am at 2008.1 version and VB2008.
I am posting a sample pgm using the northwind customer file. You will have to attach the grid to the Northwind database(Customer). I could not get the project under the 200kb limit. It did reproduce the error on my printer.
Good points.
I had actually created a new isl that I use just for printing. It prints alternate rows with a light gray background and column headers with a light gray background. I also dropped the FitWidthToPage. It is printing faster.
The scaling issue is something that needs to be looked at because of the need for it. As it is, I can print without scaling. But soon I will have grids with too many columns for one page and it would be nice to be able to print them scaled down.
Thanks for the help.
-duane
Hi Duane,
Hm.. I was looking for an exception when I tested this the first time. I wasn't really thinking about how long the printing took.
I tried it out again and the print preview seems to come up pretty quick. When I press Print, it seems to take a bit longer than it did for the print preview. But I can see the dialog comes up and says "Printing page 1", and goes through the 3 pages at what I feel is a reasonable speed.
After that, the printer does seem to take a while to actually print it out. But at that point, the grid has already sent all the information to the printer and it's up to the print driver and the actual hardware - so I'm not sure the grid can do anything about that part of it.
One thing I noticedis that there are lots of different colors on the grid and lots of gradients in the grid. That all goes away when you take out the application style, though, so if turning off the ISL doesn't help much, then that's not the issue.
The other thing I suspected is that the scaling might be a problem. You are setting FitWidthToPages to 1 so the grid is scaled down to a page and the scaling is done by setting the scaling on the printer's graphics object. So I turned of FitWidthToPages and that seems to have sped it up some.
I notied that if I turn off the Isl AND FitWidthToPages, it's pretty fast. So it seemt o me that this is just a matter of the printing dealing with complexity and scaling. Perhaps the printers deal with the scaling of gradients in some way that is processor intensive.
Unfortunately, I don't see anything we can do about this, unless we completely revamp the grid's printing logic and find some other way to do the scaling. But that would be a major effort and would have to be handled as a feature request.
Vince,
Thanks for the tip. It saved me some searching time.
I appreciate your time.
I have downloaded and installed the v9.1 trial.
I have changed printer drivers and even used a parallel cable to cut out the network.
I have tried it on another PC with all the printers.
I am getting the same results. On a printer with 64 MB of memory it will print slow ( about 1 minute). On a printer with about 16 MB it will print an error page (insufficient memory).
The grid is only 2 1/4 pages here.
I did test with and without the AppStyle .isl. As expected, the print without the isl is faster (but not much).
I am at a loss here.
Can you tell me what type of printer, memory, PCL language you are using? How fast did it print?
Do you think Support could take a look at this?
Trial downloads are available for the latest of our NetAdvantage for .NET releases. Because of this, trial downloads of NetAdvantage for .NET 2008 Volume 2 are not available. You will need to have a registered license key to download this version.
If you want to test with a later version, I suggest you use NetAdvantage for .NET 2009 Volume 1, which is (as you mentioned) currently available for trial download.