views:

113

answers:

2

Does anyone know of a reporting tool that allows for controlling the print job on a page by page basis? Specifically, I need to be able to insert escape sequences to the printer.

The closest I have found is ActiveReports. It provides an interface like this:

SystemPrinter sp = new SystemPrinter(); 
sp.StartJob("jobname"); 
foreach(Page pg in rpt.Pages) { 
    sp.Escape("escape_characters"); 
    sp.StartPage(); 
    pg.Draw(sp.Graphics, rect); //render page to printer
    sp.EndPage(); 
} 
sp.EndJob();

The problem is that their escape function has a known bug and does not properly pass the escape characters to the printer.

An interface similar to this is ideal, but not necessary. The minimum requirements that I have to deal with is to send different commands to the printer on a per page basis. I am also working in .NET. Any suggestions would be appreciated. Thanks.

+1  A: 

Sorry, the best one I've worked with is ActiveReports. If there's a known bug, then definitely report it to them. I've found they have decent support.

Paul Lefebvre
Yes, they have already been notified. The problem is that they do not have an estimate for when the problem will be fixed. In the mean time, I'm looking into other options. Good to know their support is not horrible. Thanks for the info.
Jason Z
+1  A: 

I am pretty sure you will find that ActiveReports is the only report writer that provides such extensible control over print jobs, especially providing escape support. Surely, if I'm wrong, someone will correct me. What is the bug with Escape that you're running into? It is also worth noting that Windows itself has starting introducing some limitations with escape since Windows 9x was introduced and microsoft has discouraged using escapes ever since Windows 9x started. Just one source from Microsoft that mentions this is KB125692. Anyway, tell me more about what problems you're facing with escape and I'll try to either get the bug resolved or find you a workaround.

-scott

scott
The bug is that if I run a report and print to file with the Escape() call commented out, then again with it in, then run a diff on the resulting files, the escape sequence I pass in is not there, and there is no change to the resulting print.
Jason Z