Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1448

VB6 Simple EMF-based FlexPrint-Reporting (incl. Print-Preview)

$
0
0
Both of the MS FlexGrids which come with VB6 (also the hierarchical one), support the VP_FORMATRANGE command,
and this allows a relative simple interaction with regards to printer- (and multi-page-) related rendering per SendMessage.

So, people who are already familiar with the quite capable Formatting-Options of the (MS-, VideoSoft-, or now ComponentOne-) FlexGrids
can use these Grids as an Object-Model, to build-up simple, nice looking Reports based on a Grid-Layout -
but of course also to just "print out a bunch of Records" over multiple pages.

The Demo is not printing directly to VBs Printer-Object (though this can be done in a second step) - no -
the primary purpose of the relatively small cFlexPrint-Class is, to internally render the Content of a formatted
FlexGrid, into multiple Enhanced-Meta-Files (each EMF-Page of such a multipage-rendering-job will end up as
a serialized ByteArray, stored within a publically reachable VB.Collection (EMFPages As VB.Collection).

This way the generated Report (the Page-Bytearrays within the VB.Collection) could be stored within a DB,
or in the FileSystem, to call-up the Report at a later time (e.g. for a Preview or "Printing it for real").

So, if your reporting-requirements are not all that complex - and when you plan to deploy already one of the FlexGrids
in your App anyways, then this little engine might well be an alternative to larger (not as easy to distribute or "affordable")
Reporting-Engines.

Have fun with it... (and feel free to enhance it on your own, maybe post-back your additions here into the thread)...

Here's the Download-Link: http://vbRichClient.com/Downloads/FlexPrint.zip

And here a ScreenShot (interacting with Tables of NWind.mdb):


Olaf

Viewing all articles
Browse latest Browse all 1448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>