Start a new topic

Improve copy/paste to handle embedded line feeds

[This topic is migrated from our old forums. The original author name has been removed]

A very useful feature in DbVis is the ability to copy a range of row/column values from a grid and paste it into another DbVis grid or external application. This works extremely well most of the time and allows data to be manipulated in the database similar to working in spreadsheet. The problem we see on a regular basis is where the column contains a text value, but the data includes embedded line feed characters (i.e. multi-line data). When the copied values are pasted into a target grid, DbVis treats the text as separate lines and creates multiple rows instead of one as in the original grid. This limitation forces multi-line data to be copied cell-by-cell which can be tedious and error prone. It would be very useful if DbVis were enhanced to handle copy-paste of data containing special characters. I suspect the issue is with the representation of the data in the Windows clipboard. Perhaps DbVis could add an alternate custom clipboard format to handle this sort of data or perhaps escape/un-escape special characters when marshaling data to and from the clipboard. The ability to copy-paste blob data would also be great, but I imagine that might be asking for too much. Regards, David

[This reply is migrated from our old forums.]

Re: Improve copy/paste to handle embedded line feeds
David, The format of cell data in a copy/paste operation is based on column separators and newline controls,typically tab and carriage return. This protocol was derived from how spreadsheet software such as MS Excel and OpenOffice handle copy/paste. You are right that if the actual data contain any of tab or newline characters it will fail as data will not appear in correct cells. We are aware of the problem if doing a copy/paste internally in DbVisualizer from one grid to another. It is interesting to hear what other tools you copy/paste with to have a better testing base of tools. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Improve copy/paste to handle embedded line feeds
Roger, The most common external applications we paste into are MS Excel, MS Word, Notepad++, email clients and the occasional custom application that understands tabular data layouts. Your current handling of clipboard data with embedded line feeds seems to be consistent with the data produced by similar applications. Overall not a great experience, but that is not unexpected given the limitation of the "standard". The area I am most concerned with is the ability to copy/paste between DbVis grids and/or across DbVis instances. I am not an expert in Java desktop programming, but it seems you could define your own custom clipboard format in addition to the standard format you currently use to exchange data with external applications. When copying into the clipboard data could be supplied in the standard tabular format and an alternative format that DbVis understands. MS and other vendors use this approach to pass advanced formatting and objects between applications. I am not sure if this is portable across all of the platforms you support, but I have used this technique in some of our Win32 applications and found it very effective. Here is a link to an example I found many years ago of this approach being used for a C# application. I believe Java provides an abstraction over the underlying Windows APIs. http://www.codeproject.com/Articles/8102/Saving-and-obtaining-custom-objects-to-from-Window Regards, David
[This reply is migrated from our old forums.]

Re: Improve copy/paste to handle embedded line feeds
Thanks David, I will register a ticket for this. Regards Roger