Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Printing FlexGrid

Posted on 1999-09-11
Medium Priority
Last Modified: 2013-12-25
Please, I need to print a MSFlexGrid with many mergecells. How I do???
Question by:ericson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 2042750
Can't you just select all and then put the following in

    Printer.Print MSFlexGrid1.Clip
LVL 18

Expert Comment

ID: 2054252
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.

Expert Comment

ID: 2063329
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.

Accepted Solution

tirupur_selva earned 100 total points
ID: 2296072
   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

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question