WhelkMaster 46 Newbie Poster

Hi folks,

I'm trying to print the rows of a DataTable using the PrintDocument and PrintPreview dialog. I get one page appearing in the preview window with the same stuff printed on it time and time again. I have to cancel the printout, as it runs to hundreds of pages although there are only 200 rows in the DataTable.

I've assigned a handler for the PrintPage function as in the examples but I'm not sure how I would make it throw a new page after every, say, 20 rows of the DataTable.

:?:

Could anyone be so kind as to point me in the right direction..?

Thanks for your time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.