Ask Reuben

Control + Select Table

How can I select, copy and paste contents of a Table into Excel?

The very first Ask-Reuben article dealt with ways you can Copy and Paste Tables into the Clipboard.  Essentially you enable Multiple-Row selection and the end-user can select multiple rows.  Even if you do not want multiple row selection enabled, you can code an action to enable multiple-row select, select all rows, copy them to the clipboard, and then disable multiple-row select again.  Unknown to me was that I left out a technique that had been added without much fanfare to the product.

Users of terminal emulators like PuTTY and code editors like Genero Studio (see square selection) will be aware that you can hold down a key (typically Control or Alt), and use your mouse to select a rectangular selection of text.  The same user experience is available in the Genero Browser Client.  If there is a TABLE rendered on the screen, it does not matter if it is in a DISPLAY ARRAY, INPUT ARRAY, or is not in an active dialog, you can hold down the Control-key and make a rectangular selection, which you can then press Control-C to copy into the clipboard.  There is no button or visual clue indicating that this is available, but when you are making the selection, the rectangular area is indicated by a different background color.

This was noted in the Issue Tracker but at the time there was not a New Features section in the GBC documentation so was not noted there.  We have recently added a page to capture New Features added before the New Features section was added to the GBC documentation and will add other entries here if we come across them.  (for background, the GBC  product at one stage had its own documentation style but around the time of 1.00.38, the GBC documentation was brought back into line with the rest of our documentation).

This rectangular select was also part of the previous Genero Web Clients, but was not available previously in the Genero Desktop Client or Mobile clients.  The allowWebSelection presentation style can be used to allow the user to make this selection without holding down the Control key.

There is one weakness in the implementation, and you may see it in other non-Genero applications as well.  Note what happens if your selection goes beyond what you can visually see in the table, both horizontally or vertically.  So if you want to select all rows in order to copy and paste into Excel, the technique I explained in the earlier Ask-Reuben article is still probably the one you want to use.