Printing FlexGrid

Please, I need to print a MSFlexGrid with many mergecells. How I do???
Who is Participating?
tirupur_selvaConnect With a Mentor Commented:
   Never mind of the merged cells. While printing just take each cell content.
Try the following.

MSFlexigrid1.TextMatrix(1,1) - this gives the content in the first row, first column. Likewise, when you put in a For Loop u can get the content in each cell. Further, for each row of data, you can append to a string and pass it to the printer object.


For Ctr = 1 to MSFlexigrid1.Rows - 1
   strcontent = MSFlexigrid1.TextMatrix(Ctr,1)
   strcontent = strcontent & MSFlexigrid1.TextMatrix(ctr,2)

' where 1 & 2 are the columns. Like wise you can continue to build the string for each row & finally print.

printer.print strcontent


Hope this would be useful.
With Regs
Can't you just select all and then put the following in

    Printer.Print MSFlexGrid1.Clip
VideoSoft, the company that makes the full version of the Flex Grid control has a control called VSPrinter.  The VSPrinter control has a Table property that you can set to a string which contains your grid data and then you have full print preview control, zooming, orientation.  It's very cool.  However, I'm not sure how it handles Merged Cells.  You can download a demo version of the control from their web site and try it out.
hi ericson,
 i don't know how helpful this might be(if at all ) . In the form of the flx grid we had placed a button <print> .
In the click event of this button we had given used the printform method to print the flx grid. Here one obstacle is that the printform method prints only what is available on the screen at that particular instant of time. If the flx grid contains more no. of records than the screen can hold at one time than the user will have toexplicitly scroll down and again click the button . Sort of a very crude way, isn't it ? Anyway that was the way we did it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.