Well, since it's been 2 weeks and noone has taken a stab at this, hopefully you won't mind a very broad guess!
It looks like your code is just painting what is viewable on the form, almost like a screenshot.
I know this is what you said it is doing, but that's what the code looks like it is TELLING it to do.
The screen does not "see" the rest of the data.
I have not done any direct printing in winforms to the printer. In VB6 (sorry, I know you are using C#), I did a bunch of things over the years where I printed directly to the printer, but in that case you would have to walk through the dataset and format on the way to the printer. What a drag if you have some nice formatting you have already done in the datagrid.
What about using a reporting tool? Crystal Reports is part of VS.Net Enterprise (maybe other levels, too?). There is Active Reports. There are probably a lot of other tools out, too. Create a report that formats your dataset just like the datagrid does and when you print, just shove the dataset into the report (set datasource)?
Just an idea....
julie lerman |