Clipboard not copying the right data

Hi All,
I have a JTable which displays different objects in different rows. I am trying to implement the copy paste function so that the user can do CTRL+C and paste the data in an excel spread sheet. Initially I implemented the toString method for all the objects that the table displays. But, I had to modify the copy functionality, so that, for each table row, 2 excel rows can be generated. This is how I do it.
private StringBuilder getTableData(){          
          StringBuilder sb = new StringBuilder();
          int columns = table.getColumnCount();
     int rows = table.getRowCount();
     StringBuilder row1 = null;
     StringBuilder row2 = null;
     Object value = null;
     for(int i = 0; i < rows; i++) {
          row1 = new StringBuilder();
          row2 = new StringBuilder();
          for(int j = 0; j < columns; j++) {
               if(table.getModel().getValueAt(i, j) != null){
                    value = table.getModel().getValueAt(i, j);
                    if(value instanceof FieldComparison){
                         row1.append(((FieldComparison)value).getField1());
                         row2.append(((FieldComparison)value).getField2());
                    } else {
                         row1.append(value.toString());
                         row2.append(value.toString());
               if(j < (columns - 1)){
                    row1.append("\t");
                    row2.append("\t");
          if(i < (rows - 1)){
               row1.append("\n");
               row2.append("\n");
     //sb.append("\n");
          sb.append(row1);
          sb.append(row2);
     return sb;
I copy this data to the clipboard as follows:
StringBuilder sb = getTableData();
StringSelection allData = new StringSelection(sb.toString());
cb.setContents(allData, allData);
try {
          Transferable content = cb.getContents(null);
     String clipBoardContents = (String)content.getTransferData(DataFlavor.stringFlavor);
     System.out.println(clipBoardContents);
}catch(Exception e){
          System.out.println("Transfer data error " + e.toString());
At this point I can see the proper data in the console, However when I try to do a CTRL+C on the excel spredsheet, the data appears as if the toString method was called on each object. It appears like the clipboard data that I added has been overridden somehow. Not sure what the problem is. Please Help!
Thanks!

Are you using LabVIEW 7.1 or older? In this case, "read from spreadsheet file" uses only SGL precision, which is not sufficient for your desired resolution.
See also: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=315189#M315189
Solution: Read the file as a plain string and then use "spreadsheet string to array" with DBL as type.
... or upgrade to LabVIEW 8.0 or higher.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Not reading the right data value

    So I am reading data from a txt file that I created,in particular I am trying to pull out the first column which is the time data.  When I read it using the "Read from spreadsheet file.vi" I am getting unexpected values. For example when the first value in the file is 1491.044016 it displays 1491.044067, it does this for every value? I thought it may have been a formating issue but I set the vi %.9f on the formating field I'm not sure why it is handling the values this way? Any insights?
    thanks,
    Chris

    Are you using LabVIEW 7.1 or older? In this case, "read from spreadsheet file" uses only SGL precision, which is not sufficient for your desired resolution.
    See also: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=315189#M315189
    Solution: Read the file as a plain string and then use "spreadsheet string to array" with DBL as type.
    ... or upgrade to LabVIEW 8.0 or higher.
    LabVIEW Champion . Do more with less code and in less time .

  • Q:Date link not getting the right date in calendar

    Gang,
    I have enabled the day link on my calendar so the user can click on the date in the month view to get to a form page where they can add records.
    My day_link looks like this:
    f?p=&FLOW_ID.:2:&SESSION.::&DEBUG.:2:P2_TRAINING_DATE:#TRAINING_DATE#
    Where P2_TRAINING_DATE is the DATE I'd like to populate on page 2. The variable name that holds this date is called P2_TRAINING_DATE.
    If I hoover over the daylinks they display very strange dates and also if I click on the link the dates are wrong. For example if I hoover over 01-May the URL in the bottom of my browser displays the correct date but if I hoover over 02-May it displays 05-May instead.
    What am I missing, should I not use the #TRAINING_DATE# variable?
    Oh, this application is running on apex.oraclecorp.com so it's version 3.1.
    Cheers,
    Andy

    Hi Andy,
    Change the day link to pass #DD#/#MM#/#YYYY# (UK format, so change if another format is required).
    This will pick up the date from the calendar rather than your data.
    Andy

  • Iphone 4 Calendar date not showing the write date

    I just upgraded to the ios 5.1.1 from 4.2.1. I have a Iphone 4. After the upgrade, my iphone's Calendar date is not showing the right date. in order for the right date to show, I either have to re-start my iphone or I have to go into settings/general/date&time and turn off the set automatically off than on in order for it to show the right date. I didn't have this problem before the upgrade. I hope someone can help?

    I had a similar problem and then found that my calendar was not set for the right date and year.  Check that first.

  • Copy controls is not copying the order reason and PO numbe and PO date

    Hi All,
    When i create credit memo request with reference to Invoice, it is not copying the order reason PO number and PO date to credit memo request from invoice.
    Please let me konw what changes do i need to copy that.
    Thanks in advance.

    Hi,
    Check below link
    copy purchase order number and date from one sales order to other sales ord
    Hope it'll help you !
    Best regards,
    Anupa

  • Copy opening does not clear the destination data - Just appends

    Hi All,
    Copy opening does not clear the destination data. It just appends so if i run the copy opening package twice i can see the signed data get doubled.
    We have SAP BPC NW 7.5 SP08 Patch 1001.
    I working on the Periodic Application.
    Copy opening Script logic:
    *FOR %TIME% = %TIME_SET%
    *RUN_PROGRAM COPYOPENING
    CATEGORY = %CATEGORY_SET%
    CURRENCY = %CURRENCY_SET%
    TID_RA = %TIME%
    OTHER = [B_ENTITY=%B_ENTITY_SET%]
    *ENDRUN_PROGRAM
    *NEXT
    Carry-forward business rules
    Source account : BALANCE SHEET ACCOUNTS
    Source flow  : F99
    Dest account :
    Dest flow  : F00
    Reverse sign : FALSE
    Data source type :  ALL
    Same period      :FALSE
    Apply to YTD : False
    Category dimension:
    ID               ACTUAL               BUDGET
    EVDESCRIPTION          Actual               BUDGET
    PARENTH1          
    YEAR               2008               2011
    COMPARISON          BUDGET               NBUDGET
    STARTMTH               1               1
    CATEGORY_FOR_OPE                    ACTUAL
    FX_SOURCE_CATEGORY          
    RATE_CATEGORY          
    RATE_YEAR          
    RATE_PERIOD          
    FX_DIFFERENCE_ONLY          
    OPENING_YEAR          
    OPENING_PERIOD          
    OWNER               [ADMIN]               [ADMIN]
    STORED_CALC          
    REVIEWER_CAT          
    Appreciate any help.
    Regards
    Mehul

    Snote 1620613 has fixed the issue
    Regards
    Mehul

  • Why is RoboHelp not displaying the required data content of .chm when linked as Help in my App ?

    Gorgeous Hello All,
    Has anyone encountered the below-said show- stopper. Another BIG TIME help required, will help me in tremendous fashion.
    Am using Adobe RoboHelp, Version 10 and IE version being 10.
    In my local machine :
    1.)I have completed my technical writing courtesy Design editor
    2.)Generating chm File : View -> Pods –> Single Source Layouts -> Right Click on Microsoft HTML Help -> Tagged Set as Primary Layout
    3.)Generating Primary Layout : File -> Generate -> Primary Layout (Microsoft HTML Help)…
    4.)Viewing Primary Layout : File -> View -> Primary Layout
    Everything works FANTASTICALLY till here with the required output (as Hide, Back, Refresh, Home, Print, Options, Contents, Index, Search, Glossary and with the data contents)
    Show Stopper, At my Application Server :
    5.)I copy the entire robohelp project folder from my local machine to my application Server path
    6.)My Application has been developed in ASP .NET, Version 4.0.
    7.)Help link has been created in this application wherein here the file name of < >.chm has been linked in the code to be read from the  Server’s RoboHelp project folder\!SSL!\ Microsoft_HTML_Help\
    8.)I login into my above-said application -> click on the Help page -> Displays the required structure /buttons as Hide, Back, Refresh, Home, Print, Options, Contents, Index, Search, Glossary
    a.)Clicking on any of the Books or Topics appearing beneath Contents : The System prompts out with error cautionary message called “ Navigation to the webpage was cancelled. What you can try: Retype the address ”
    *** This is a huge SHOW-STOPPER. I spent plenty of hours on this, but unable to deciper with a solution at all) ***
    ( Note : Am able to directly open and read the required data contents by Clicking on any of the Books or Topics appearing beneath Contents from Server’s RoboHelp project folder\!SSL!\ Microsoft_HTML_Help\ < >.chm )
    Why is the RoboHelp not displaying the required data contents of <>.chm when linked as Help in my Application ?
    Cheese – Vipin Nambiar

    If you looked at the error message and searched the forum, you should find the answer as this is a problem that started in 2005. You should not run CHM files from a server and cannot without editing the users registry. See the page below.
    http://www.grainge.org/pages/authoring/chm_mspatch/896358.htm
    All along your questions have been based on webhelp, why suddenly are we going go CHMs.
    See Snippets on my site for the correct form of help to use in different scenarios.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • I can't get download to work - it will not copy the mp3 file to my chosen location (as set in tools/options) - it gives me a new window with a player - no dwnlo

    I am running windows xp sp2 and I have set my dowload location under (tools/options), but when I select an MP3 file to download, firefox does NOT copy the file to my chosen location on my HD - instead, it opens up a new window with a makeshift "player" and begins loading the player with the MP3 file. The problem is that I have no idea where on my system firefox has copied this file to, so, I cannot leave and come back later and play this MP3 file using winamp. I have to listen to it right then or lose it - if I close that new window (with that puny little "player"), then I lose the download, wherever firefox put it on my PC (I got no idea where it is). This is all under firefox 25.0
    I am also running FIrefox 12.0 on an older windows 2000 machine and that works perfectly - I can download any MP3 file I want, and firefox 12.0 (on win2k, sp4) downloads it to my chosen location (on my HD), and it gives me the download window so I can watch its progress and have some control over pause, and resume, and, when it is done, the download window offers me the option to "open containing folder" so I can make sure it got to where I wanted it. In other words, Firefox 12.0 on WIn2k, sp4 works better than firefox 25.0 on winxp sp2!!!!! What gives? I went through and set up my options for XP just like I did with Win2k and it all looks good, but firefox 25.0 just ignores my chosen location and always defaults to give me that makeshift player and I am not able to actually copy the mp3 file to my harddrive - it makes firerox 25.0 almost unusable since downloading mp3 files is a big part of my firexfox use - please help - I am not able to upgrade windows at this time, and, since firefox 12.0 still works fine on win2k, I can't understand what happened at firefox?

    Phillipp,
    I tried it again using "save link as", and this time it actually worked! I just now downloaded several more using the "save link as" option, and it works perfectly. Thanks. Problem solved.
    Littleberry

  • Does not copy the text

    Does not copy the text Please help me

    Can you explain what are you trying to copy and where?
    Can't you copy text from website to the clipboard or do you have a problem with pasting that text?
    * http://kb.mozillazine.org/Clipboard_not_working

  • How to copy the all data to another new table

    Hi,
    1) "How can I copy the data from one Data Dictionary Table to another new Table, in Dictionary"?
    for eg.  (<i>In Dictionary,  I have one table named 'sflight' and now I want to copy the all data from 'sflight' to another new table named 'zabc'</i>)
    How can I do this?
    2) What is Logical Unit of Work or LUW.
    Thanks

    HI,
    go to <b>se11</b>, give sflight (Your standard table name) in tables text,
    No go to dictionary objects --> copy --> give new <b>Ztable</b> in <b>to table</b> text.
    Like this you can copy the standard sap table to a new ztable..
    A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.
    LUWs help to guarantee database integrity. When an LUW has been successfully concluded, the database is once again in a correct state. If, however, an error occurs within an LUW, all database changes made since the beginning of the LUW are canceled and the database is then in the same state as before the LUW started.
    An LUW begins
    o each time you start a transaction
    o when the database changes of the previous LUW have been confirmed (database commit) or
    o when the database changes of the previous LUW have been cancelled (database rollback)
    An LUW ends
    o when the database changes have been confirmed (database commit) or
    o when the database changes have been canceled (database rollback)
    SAP memory and ABAP memoryUsing SAP memory. User-specific memory retained for the duration of the session. Can only be used for simple field values.
    Using ABAP memory. Can be used to transfer data between internal modi. Can be used to transfer any ABAP/4 variables ( Fields, strings, internal tables, complex objects)
    SAP memoryYou use the SPA/GPA parameters to pass data. These paramters are saved globally in memory. The paramters are indetified by a three-character code.
    In dialog programs you can SET and GET these parameters in the attribute window of the screen field, by marking the SET and GET fields and put the name of the parameter in the ParameterId field.
    In a program ( Dialog or Report ) you can use the GET PARAMETER and SET PARAMETER statements:
    set parameter id 'RV1' field <fieldname>
    get parameter id 'RV1' field <fieldname>
    rewards if useful,
    regards,
    nazeer

  • [svn] 3917: update the stage target to not copy the flex tasks license. txt since it ain't there any longer

    Revision: 3917
    Author: [email protected]
    Date: 2008-10-27 16:29:55 -0700 (Mon, 27 Oct 2008)
    Log Message:
    update the stage target to not copy the flex tasks license.txt since it ain't there any longer
    Modified Paths:
    flex/sdk/branches/3.2.0/build.xml

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • IMAQ Quantify rseults with use of image mask are not of the right regeons

    I'm using the IMAQ quantify VI from labview to analize a binairy image. This binairy image is an 8bit image that consists only of pixels with the value 0 or 1. The places of the binairy  image where the pixels have the value 0, mean that a corresponding image has not data in that place. A pixel value of 1 means that there is data that should be processed later in the program in the corresponding image.
    The quantify function is also used to devide the image in 666 regeons with the use of the image mask input. These regeons are squares of 22x22 pixels. The image mask consists of 666 regeons (horizontally 74 sqaures, vertically 9 sqaures) and each of the regeons has his own regeonal number. The resulting regeonal report is used to decide whether each regeon has data in it or not, with the use of the mean value in the report. When the mean value is equal to 0 than it is sure that there is no data in that regeon since all the pixels in the regeon have to have the value of 0. If the mean is not 0 at least one of the pixels in that regeon has the value of 1, wich means that there is data in the regeon. The image mask is created from an 2D array wich is converted to an 16 bit image with the use of IMAQ ArrayToImage.
    I've checked that the input data is correct: the binairy image consist of only 1 and 0 values, the image mask is consist of 666 sqaures of 22x22 pixels and each sqaure has pixels in it with the value corresponding to the regeonal number of the sqaure, the binairy image and the image mask have the same size, the image mask is an 16 bit image and both images have the same border size (3).
    Two problems occur:
    1) The regeonal report doesn't consist of 666 elements, but of 665 elements (element 0 to 664)
    2) The data in the regeonal report is not of the right area's. It looks like the data is shifted one to the right in the regeonal report array, the data in element 0 isn't from regeon 0 but from regeon 1, element 1 corresponds to regeon 2, and so on. I'm haven't checked if the data is exactly of the next regeon, but I suspect it because of the regeonal report array being one short. But it is also possible that the regeons aren't placed on the right place in the binary image.
    If someone else occured this problem with the IMAQ Quantify function or has a solution to it, I would really apreaciate a reply.

    Isn't there anybody who encountered the same problem or with an solution?

  • Error 25109 : The install program could not create the config data store. Is this a know issue with a solution?

    Hi I cant install the Management Console.
    I keep getting
    Error 25109 : The installation program could not create the configuration data store. Please see the installation log for more info.
    Has someone come across this problem before?
    I am using
    MS Server 2008 Std x86
    SQL Server 2005 SP2 Std x86
    MDOP 2008 R2
    APP-V 4.5
    Please can someone help.
    Thanks

    I'm running into the same problem myself, I have an almost identical setup.
    Trying to do a clean install of App-V Management Server 4.5 from the MDOP 2008 R2 CD.
    Server OS: Windows Server 2008 Enterprise SP1 (Has WDS and IIS installed (IIS 6 Management Compatibility too), as well as .Net 3.5 SP1 Framework)
    Database: Microsoft SQL Server 2005 Enterprise (Version 9.00.3068.00) (Note: SQL server is running on a different server than the server App-V is being installed on.)
    Installer gets to the point where it starts creating the database than dies, reporting a 25109 error.
    Checked out the logfile the installer created, here's a snip of the last few lines before is starts rolling back the install:
    1
    [2008-12-23 15:58:35] (2284:3084) SQL state: ``01000'', Native: 0, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]<<< CREATED TRIGGER dbo.TR_U_SYSTEM_OPTIONS >>>''. 
    2
    [2008-12-23 15:58:36] (2284:3084) SQL state: ``42000'', Native: 18058, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]Failed to load format string for error 16873, language id 1033.  Operating system error: 122(The data area passed to a system call is too small.). Check that sqlevn70.rll is installed in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\Resources\1033, where 1033 is the language ID of US English, or the appropriate folder for the locale in use. Also check memory usage.''. 
    3
    [2008-12-23 15:58:36] (2284:3084) SQL state: ``01000'', Native: 3621, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.''. 
    4
    [2008-12-23 15:58:36] (2284:3084) ::SQLExecDirectW error 0xffffffff. 
    5
    [2008-12-23 15:58:36] (2284:3084) Failed to execute SQL ``/* ------------------------------------------------------------------------- *\ 
    6
        Copyright (c) Microsoft Corporation.  All rights reserved. 
    7
    8
        Description: 
    9
            This script creates all user-defined messages. 
    10
    11
            The types of messages allowed (and their severities) are: 
    12
            FATAL   - SQL Server Severity = 17; ours = 1 
    13
            ERROR   - SQL Server Severity = 16; ours = 2 
    14
            WARNING - SQL Server Severity = N/A; ours = 3 
    Can anyone help me shed some light on what's going on here?

  • Can i copy the entire data flow from one std-Infocube to a new RT Infocube

    Hi,
    I created a new Real Time Infocube , copy of an existing Standard Infocube. But is there any option to copy the entire data flow - like transformations, DSO and all that ?

    Hi,
    We can copy standard Infocube to Realtime Infocube ,it will work in BI7.0.
    The procedure is  1) Go to Context menu of Standard IC and select copy option.
                                 2)In Edit IC option select Real Time and create it ,it copies as real time info cube.
                                 3)But for Loading data,Go to context menu of Real time IC and select option Change Real Time Load Behavior
                                     we get 2 options the first one is  1)Real time data target can be loaded with data,planning not allowed ,if we select data will be loaded.
                                 4)if we go for second option that is 2)Real time data target can be planned , data Loading not allowed ,if we select this,it  is  used for planning that is comparison of data.
                                5) This is difference between standard and Real Time InfoCube.
    Thanks,
    Supriya@n

  • Synchronized my iPhone 3G 8G to copy the contacts and calendars from Outlook, I wonder if I can do the same synchronization to copy the same data from Gmail

    Synchronized my iPhone 3G 8G to copy the contacts and calendars from Outlook, I wonder if I can do the same synchronization to copy the same data from Gmail ?

    Right, I finally managed to get it sorted out.
    iCloud only accept version 3.0 vcards, and the one I was using were version 2.1 so that's why it wasn't picking it up. So the easy way to get that sorted out is, use a gmail account.
    I know you don't wanna do it because you think it's too much hassle and stuff, but trust me it only takes 5 minutes and that's it.
    1. Create a Gmail Account.
    2. Export your Old VCard files to the Gmail Account.
    3. Now Import them from Gmail to your PC again.
    And, that's it, that's just makes the new imported version in 1 file contains your all contacts in version 3.0. Now you can just upload that on icloud and then sync it with your iphone.
    That's what I did and it worked, and I am sure if you wanna replace this file in the Contacts folder under your User Account in Windows and then try to sync Contacts in Tunes, it should work, but as I said, I did it with iCloud and it worked for me. So aye, that's pretty much it. Phewwww..
    Been searching for it for the whole day and it took 5 minutes in the end, badass...
    Anyway, don't lose hope and always Google for everything!

Maybe you are looking for

  • HT5622 Can I use the same apple ID for imessage on my Mac and iPad?

    Today I attempted to send and iMessage from my iPad. The message began to send but the loading bar stopped when it was almost finished and an exclamation point appeared next to the message. I am connected to my house wifi, and I have never had a prob

  • Mixing latin and kyrillic characters for correspondence with PC User

    Hi! I (Mac, G5 Dual, OS 10.4.6) intend to exchange eMails via Mail with a friend (PC) who can help me to learn Russian. So I have to mix Latin with Kyrillic characters in the same mail. Is there an easy way to do this besides creating and sending pdf

  • Table Controll

    Hi, Experts, I am working on table control and have good idea on it. but there is one problem. I need help from you. how can I check no. of visible lines in table control. It varries as per resolution of screen. suppose I have given 12 lines on scree

  • Encore CS5 interpreting footage incorrectly.

    Hi! I'm trying to use QTs in Encore CS5, and they are 720x486, given that all the sistems we use are 720x486, Flame, Smoke, Media Composer, Aja Cards, Decklink Cards, they are all 486 in NTSC not 480, but DVDs are 480, so I'm trying to make a preset

  • Leopard with xdmcp

    there is a feisty machine which i use with xdmcp on tiger with minor problems, but now there is a leopard, which won't work. I use the command '/usr/X11R6/bin/X -query x.x.x.x' but on leopard after the login window appears, i cant type in it, instead