Select specific cell

I have a JTable, and I'd like to select a specific cell. I know the value of that cell, but I need to select it. Is there any way to select either a specific row and column, or a specific value?

Basically, make ensure the following calls are made on your table
JTable table = new JTable();
  table.setRowSelectionAllowed(true);
  table.setColumnSelectionAllowed(true);
  //now select the cell
  table.setRowSelectionInterval(cellIndex,cellIndex);
  table.setColumnSelectionInterval(cellIndex, cellIndex);ICE

Similar Messages

  • How to select specific rows in rtf template for complex calculation

    Hi,
    I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
    Row No
    Curr Qtr
    PQtr1
    PQtr2
    3
    B3
    C3
    D3
    4
    B4
    C4
    D4
    5
    B5
    C5
    D5
    6
    B6
    C6
    D6
    7
    B7
    C7
    D7
    8
    B8=SUM(B4:B7)
    C8=SUM(C4:C7)
    D8=SUM(D4:D7)
    9
    B9=B8-B5
    C9=C8-C5
    D9=D8-D5
    Thanks.

    Hi AlexAnd,
    Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
    Account
    Curr_Qtr
    PQtr1
    PQtr2
    Deposit
    10
    15
    20
    Loan
    15
    20
    25
    Earning
    20
    25
    30
    Assets
    25
    30
    35
    Total
    =SUM(15,20)
    =SUM(20,25)
    =SUM(25,30)
    Expense
    =SUM(15,20)-25
    =SUM(20,25-30
    =SUM(15,20)-25
    Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
    Thanks.

  • How to select a specific cell in a JTable?

    Hi there,
    in a JTable, I would like to select a specific cell (to highlight it) from a JButton.
    Here a sample code...
    Who could help me to fill it?
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TableSelection{
        public static void main (String args[]) {
          JFrame frame = new MyFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.show();
    class MyFrame extends JFrame{
      public MyFrame(){
        setTitle("TableSelection");
        setSize(WIDTH,HEIGHT);
        DefaultTableModel myModel = new DefaultTableModel(2,2);
        JTable myTable = new JTable(myModel);
        myTable.setCellSelectionEnabled(true);
        JButton button00 = new JButton("select 0,0");
        button00.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent event){
         System.out.println("selection of cell (0,0)");
         //--- what code is required to select the cell(0,0)?
        JButton button11 = new JButton("select 1,1");
        button11.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent event){
         System.out.println("selection of cell (1,1)");
         //--- what code is required to select the cell(1,1)?
        Box myBox = new Box(BoxLayout.Y_AXIS);
        myBox.add(new JScrollPane(myTable));
        myBox.add(button00);
        myBox.add(button11);
        getContentPane().add(myBox, BorderLayout.CENTER);
      private static final int WIDTH=200;
      private static final int HEIGHT=200;
    }Thanks a lot for your help.
    Denis

    Use the addColumnSelectionInterval(int index1, int index2)method ~ http://java.sun.com/j2se/1.4/docs/api/javax/swing/JTable.html#addColumnSelectionInterval(int,%20int)
    and the addRowSelectionInterval(int index1, int index2) method ~ http://java.sun.com/j2se/1.4/docs/api/javax/swing/JTable.html#addRowSelectionInterval(int,%20int)
    Hope that helped.
    afotoglidis

  • HT3349 How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    How do you select a sub-set of cells from the entire document so you can print only those specific cells?

    There is no analog to MS Excels print range.  So the next best thing is to plan your data so that you don't need to use print range.  The next best thing after that is to select the range of cells you want to print, then copy, the switch to the application Preview, and create a new document from the clipboard (select the menu item "File > New from Clibboard") then select all, copy then paste to the destination (maybe an email) .
    You can also paste that portion of the table into another table (or a new table) by pasting values only

  • How to get selected/focused cell from table, and action on clicked

    Hello Web Dynpro Community!
    i have a view with a table, (id "Table_0");
    table is 3x3 size, as celleditors i used inputfields; (standard binding to context with string atributes)
    below table i have textarea.
    when i select any cell in table i want to add that cell coords to textarea (col and row)
    i know that i should use onLeadSelect action, but i dont know exacly how. or to be precise.. how to access to ID and row variables in that action.
    the other problem is.. that onLeadSelect seems to work only when i change lead not the cell in same row.. so prabobly there is better way to do that..
    any ideas?
    Looking to hear from You.
    EDIT:
    Now i have following problem:
    i have a table 3x3 with one column as dropdownbykey box and 2 as TableSingleMarkableCell (and inputFields As editors).
    it works as i wanted:
    so when i click on one of those input cells, insert vale AND click enter then the action onEnter( for inputfield) is fired... i can get the coords of that cell..
    problem is.. that i want to get the coords before i click enter.. just when i click in cell.
    i tried to use onAction event for column.. but it doesnt work for TableSingleMArkableCells (but it works for ddk column correctly).
    so there is any way to do that?
    ie:
    below table i have inputfield (called  value).
    when i click on cell (and DO NOT press enter) i want to see the cell value in inputfield value.
    future (and target need) is that i need to show some additional text for specific Cell. (i have an Object with 2 strings attributes, one i want to show in cell, and one in inputfield when cell is clicked).
    M.
    Edited by: Michal Rowinski on Jan 16, 2008 9:51 AM

    You can use cell variant  for your requirement . Go through the below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0310fd2-f40d-2a10-b288-bcbe0810a961
    Regards,
    Nethaji

  • How do I name a specific cell in Numbers 3.2.2?

    I am working with a multi-table spreadsheet and I want to create a table of variables that are used in a specific formula throughout the spreadsheet. For example, here is the formula I'm working on:
    =IF(C32≥321,"23",IF(C32≥281,"19",IF(C32≥241,"17",IF(C32≥201,"15",IF(C32≥161,"13" ,IF(C32≥121,"11",IF(C32≥80,"09","")))))))
    Yes, all you database builders out there, it's a wacky way to spreadsheetize an IF, THEN, OR  statement - fortunately, I'm only working with numbers. What I want to do is replace the cell values and the "then" result numbers with references from another table. I can't just link to the specific cell by clicking (resulting in something like "<table>::<cell>") because the formula builder spits it out claiming there are too many arguments. Here is an example of what I'm getting at if you replace the first number in each statement with a cell name like "R_1" and the calculated displayed value as "V_1":
    =IF(C32≥R_1,"V_1",IF(C32≥R_2,"V_2",IF(C32≥R_3,"V_#",IF(C32≥R_4,"V_4",IF(C32≥R_5, "V_5",IF(C32≥R_6,"V_6",IF(C32≥R_7,"V_7","")))))))
    Right now, I have to manually make changes to the formula in one cell then copy it across the other cells in the different tables. I'd much rather have the formula reference specific cells in a variable table so that I can update the values globally. In the "help" for Numbers, it states:
    "If the reference is to a cell in another table, the reference must contain the name of the table (unless the cell name is unique within all tables). For example:
    =Table 2::B2
    Note that the table name and cell reference are separated by a double colon (::). The name of the table is automatically included when you select a cell in another table while building a formula.
    If the reference is to a cell in a table in another sheet, the sheet name must also be included (unless the cell name is unique within all the sheets)." (emphasis mine)
    However, I can't find any documentation to instruct me on how to create a unique cell name. Any advice?

    Hi coop,
    coop1108 wrote:
    IF, THEN, OR 
    I think of the IF function as IF(this is true, THEN do this, ELSE do that)
    From the Function Browser: type = in any cell, then type 'if' (no quotes) in the search box.
    The IF function returns one of two values, depending on whether a specified expression evaluates to a boolean value of TRUE or FALSE.
    IF(if-expression, if-true, if-false)
    if-expression: A logical expression. if-expression can contain anything as long as the expression can be evaluated as a boolean value. If the expression evaluates to a number, 0 is considered to be FALSE, and any other number is considered to be TRUE.
    if-true: The value returned if if-expression is TRUE. if-true can containany value. If if-true is omitted (there’s a comma, but no value) and if-expressionevaluates to TRUE, IF will return 0.
    if-false: An optional argument specifying the value returned if if-expression is FALSE. if-false can contain any value. If if-false is omitted (there’s a comma, but no value) and if-expressionevaluates to FALSE, IF will return 0. If if-false is entirely omitted (there’s no comma after if-true) and if-expressionevaluates to FALSE, IF will return FALSE.
    Or more to the point,
    IF it is sunny, THEN have a picnic, ELSE stay in bed.
    Call back with further questions. Maybe a LOOKUP function will work for you.
    Regards,
    Ian.

  • Import a CSV file into specific cells

    Hello,
    I have created a simple Numbers template and I want to import a csv file with its values entering specific cells in an automated way.
    I think the best way to automate this process would be an AppleScript that does the following:
    Selects the csv file;
    Parses the values inserting them into the the Numbers template i.e. value1 to cell B2, value2 to cell B3 etc.
    Unfortunately I know very little about AppleScript, does anyone have any experience in this area that they could pass on?
    My idea would be to place the csv values in an array, and loop through the array entering the values in B2, B3 etc.
    Many thanks in advance!
    Dougie

    Here is a script doing the full job in a single call.
    --{code}
    --[SCRIPT csv-to-selected-cell]
    Enregistrer le script en tant que Script : csv-to-selected-cell.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner la première cellule du bloc où vous souhaitez insérer les valeurs extraites d'un fichier CSV.
    Aller au menu Scripts , choisir Numbers puis choisir “csv-to-selected-cell”
    Le script demande de naviquer jusqu’au fichier CSV.
    Il en lit le contenu,
    remplace les séparateurs (";" ou ",") par des TABs
    copie les données dans le presse-papiers
    colle dans la table.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: csv-to-selected-cell.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select the first cell of the block where values extracted from a CSV file must be inserted.
    Go to the Scripts Menu, choose Numbers, then choose “csv-to-selected-cell”
    The script urge you to navigate to the CSV file.
    It read its contents,
    replace the delimiters (";" or ",") by TAB  chars
    copy the datas in the clipboard
    paste in the table.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2012/01/18
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2, lesValeurs
              my activateGUIscripting()
    Extract parameters describing the target cell *)
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    Choose the source CSV file *)
      choose file of type {"csv"}
    Get the file’s contents *)
              set lesValeurs to read result
    Grab the delimiter in use *)
              if lesValeurs contains ";" then
              else
              end if
    Replace the delimiter in use by TAB *)
              my remplace(lesValeurs, result, tab)
    Move the 'normalized' datas to the clipboard *)
      set the clipboard to result
    Reset the target cell in case something changed *)
              tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
                        set selection range to range (name of cell colNum1 of row rowNum1)
              end tell
    Paste matching style *)
              my raccourci("Numbers", "v", "cas")
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2
              tell application "Numbers" to tell document 1
                        set d_Name to its name
                        set s_Name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_Name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_Name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if
                        end if
                        tell sheet s_Name to tell (first table where selection range is not missing value)
                                  tell selection range
                                            set {top_left, bottom_right} to {name of first cell, name of last cell}
                                  end tell
                                  set t_Name to its name
                                  tell cell top_left to set {row_Num1, col_Num1} to {address of its row, address of its column}
                                  if top_left is bottom_right then
                                            set {row_Num2, col_Num2} to {row_Num1, col_Num1}
                                  else
                                            tell cell bottom_right to set {row_Num2, col_Num2} to {address of its row, address of its column}
                                  end if
                        end tell -- sheet…
                        return {d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2}
              end tell -- Numbers
    end get_SelParams
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Numbers" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set l to text items of t
              set AppleScript's text item delimiters to oTIDs
              return l
    end decoupe
    --=====
    replaces every occurences of d1 by d2 in the text t
    on remplace(t, d1, d2)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d1
              set l to text items of t
              set AppleScript's text item delimiters to d2
              set t to "" & l
              set AppleScript's text item delimiters to oTIDs
              return t
    end remplace
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
              local k
      activate application a
              tell application "System Events" to tell application process a
                        set frontmost to true
                        try
                                  t * 1
                                  if d is "" then
      key code t
                                  else if d is "c" then
      key code t using {command down}
                                  else if d is "a" then
      key code t using {option down}
                                  else if d is "k" then
      key code t using {control down}
                                  else if d is "s" then
      key code t using {shift down}
                                  else if d is in {"ac", "ca"} then
      key code t using {command down, option down}
                                  else if d is in {"as", "sa"} then
      key code t using {shift down, option down}
                                  else if d is in {"sc", "cs"} then
      key code t using {command down, shift down}
                                  else if d is in {"kc", "ck"} then
      key code t using {command down, control down}
                                  else if d is in {"ks", "sk"} then
      key code t using {shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "k" then
      key code t using {command down, shift down, control down}
                                  else if (d contains "c") and (d contains "s") and d contains "a" then
      key code t using {command down, shift down, option down}
                                  end if
                        on error
                                  repeat with k in t
                                            if d is "" then
      keystroke (k as text)
                                            else if d is "c" then
      keystroke (k as text) using {command down}
                                            else if d is "a" then
      keystroke k using {option down}
                                            else if d is "k" then
      keystroke (k as text) using {control down}
                                            else if d is "s" then
      keystroke k using {shift down}
                                            else if d is in {"ac", "ca"} then
      keystroke (k as text) using {command down, option down}
                                            else if d is in {"as", "sa"} then
      keystroke (k as text) using {shift down, option down}
                                            else if d is in {"sc", "cs"} then
      keystroke (k as text) using {command down, shift down}
                                            else if d is in {"kc", "ck"} then
      keystroke (k as text) using {command down, control down}
                                            else if d is in {"ks", "sk"} then
      keystroke (k as text) using {shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "k" then
      keystroke (k as text) using {command down, shift down, control down}
                                            else if (d contains "c") and (d contains "s") and d contains "a" then
      keystroke (k as text) using {command down, shift down, option down}
                                            end if
                                  end repeat
                        end try
              end tell
    end raccourci
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) mercredi 18 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k
    My iDisk is : http://public.me.com/koenigyvan

  • How to sort a selection of cells?

    If anyone can answer this question I will be very grateful - here's the scoop: I need to sort the data in a selection of cells that run down several rows - but NOT all of the cells in the entire row. The last column contains formulas which must NOT be sorted - if those cells are included in the sort, all of the data they contain will be out of order and all fouled up. So, I need to select, for instance, A1:G10 - and not touch anything that is in H1:H10. It appears that with Numbers, it's all or nothing - which, if that's true, is a really big problem. I can't sort the entire selection of rows and then drag and replace the formulas in the last column - there are thousands of rows and it has already taken me an hour to straighten out this mess. I can do this in 2 seconds in Excel, which I've used for very complex spreadsheets and models for years - but I expected to at least be able to do some basic calculating with Numbers in a reasonably easy fashion. I am royally frustrated - what is the hidden secret to sorting a selection of cells without being forced to sort an entire row? Thanks for your help!

    Numbers sorts apply to the whole table, or in the case of sorting selected rows, to the whole width of the table. For ANY sort, header rows and footer rows are not included in the sort.
    Two ways around this limitation are to:
    1.
    Place the 'non-sorting'columns into a separate table, and use INDIRECT addressing to reference cells on the sorting table.
    2.
    Write the formulas so as to be immune to sorting. Use column only references where possible and construct cell addresses for rows other than the result row using the ROW() function.
    Check the Functions and Formulas User Guide for ROW(), INDIRECT() and OFFSET() for descriptions and examples. That guide and the Numbers '09 User Guide are available for download through Numbers's Help menu.
    Post a question regarding specific formulas if you require further assistance.
    Regards,
    Barry

  • Import from Excel-Mapping Specific cells

    I've used the SQL Import/Export tool to import simple Excel data in the past. These were often simple column to table imports...easy mappings. I currently have an Excel spreadsheet kept by our Sales people that needs to be imported. The data in these sheets
    are not grouped into simple columns. For example, data values are either horizontal or I need to import specific data FROM cell A4 TO table column 'CCode' and cell A6 to 'CCode'.
    The trouble I'm facing is that the import wizard wants to simply map column for column from Excel. Even when I go into, "Edit Mappings" I'm not really finding a way to map specific cell data to the SQL column. Any help would be greatly appreciated...
    Excel Example:
    SQL Table:

    I'm seeing that now. I'll admit the format of the spreadsheet will be changing after I get these imported and moving forward.  I should have mentioned this is on an older SQL 2005 server, and am playing around with an Integration Services Project...
    Essentially I need to pluck the data in cells A1, C2, A4, C4-E4 and insert those values into an existing SQL table. I've defined my Excel Source. Seeing as the source sheet is a mess and I need to select certain cells (not all are in a neat range like C4-E4...I
    have some single cell values I ALSO need to import like A1 & C2) I chose "SQL Command" as my data access mode.
    The one thing I can't figure out is how to write a select statement that allows me to select certain cells and a small range of cells. I can select a single value by using: SELECT * FROM [sheet1$A1:A1] OR I can choose a range with the following: SELECT *
    FROM [sheet1$C4:E4]...how would I format a select statement that will allow me to pick not only the individual cells but ALSO the ranges I need?
    I have tried SELECT...UNION...SELECT but am limited to two select statements and places everything into a single F1 column when I need it in a row view to map with the SQL columns...so each cell I pull has a separate F value so I can properly map the data
    to the correct SQL column like the following:
    F1    F2   F3   F4    F5  F6   F7
    A1   C2   A4    A6   C4   D4   E4    

  • How do I sort specific cells without affecting entire rows?

    In Excel I can sort specific cells ascending/descending and only what I highlight will sort.
    In Numbers, when I try to do that the entire row sorts.
    Is there a way to only sort the highlighted cells and not have the rest of the rows sort as well?

    Here's a link (Dropbox download) to a Copy Sort Acending service, that in your menu would look similar to this:
    To use it, select the cells you want to sort, just as in Excel, and make the choice from the menu.
    After that, unlike Excel, click once in the first cell where you want the sorted values to start appearing (either the original range, or a different range if you want) and type command-v or option-shift-command-v to paste.
    The one-time installation takes a double-click on the .workflow package and a click on 'Install'. You may also have to go to System Preferences > Security & Privacy and click 'Download anyway'.  Installing simply moves the service to your Library > Services folder so that it will appear in your menu. It does nothing to the innards of your Mac, and does not run unless you specifically tell it to by choosing it from the menu or running it from within Automator. You can view the script by opening it in Automator.  You can remove the service if you don't need it by holding down the option key in Finder, choosing Go from the menu and navigating to Library > Services, where you can delete it the way you would any other folder or package.
    SG

  • Hide a specific cell using ABAP classes

    Hi Experts,
    Is there a way to hide a specific cell using ABAP classes for reports?
    Marcelo

    Hello Thomas Daly
        I never saw a way to grant permission to a List, the only way I ever saw a list get its permissions is thru
    the group site it resides in, the Discussion Board is the problem in this case (it has preconfigure permissions but they seem more like properties that you select the value from RadioButtons).  However, ms-addnew gets rid of the Add new link but it
    gets rid of the one in the Discusson Board too because Discussion Board falls in the category of List.
        In other words ms-addnew in the master got rid of all of the Add new items, link etc as hoped but now
    I can't add to the Discussion Board.
        I am alright with a hack (I am open to any suggestions) that would work if it works but, the List's I am referring to are all "Links" in the Quick Launch so I dont know how you would be able to apply the jquery, how would you apply the
    jquery to a Links in a Quick Launch?
        Thank you
        Shabeaut

  • How to get specific cell or whatever is in your datatable?

    All there is in my datatable is one value loaded. Here's my code, but how do i convert that datatable to a string?
    var fileName = string.Format("{0}\\file.xlsx", Directory.GetCurrentDirectory());
    var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.12.0; data source={0}; Extended Properties=Excel 12.0;", fileName);
    OleDbConnection connExcel = new OleDbConnection(connectionString);
    connExcel.Open();
    DataTable xlsData = new DataTable();
    OleDbDataAdapter dbAdapter = new OleDbDataAdapter("select * from [Filters$B2]", connExcel);
    dbAdapter.Fill(xlsData);
    //Now i want to see that value in xlsData???? or possibly convert it since it is only one cell loaded to a string? HELP?

    Hi  vkid,
    >>All there is in my datatable is one value loaded. Here's my code, but how do i convert that datatable to a string?
    About convert datatable to a string, you can use the following code
    string res = String.Join(Environment.NewLine, table.Rows.OfType<DataRow>().Select(x => String.Join(" ; ", x.ItemArray)));
    But based on your title, How to get specific cell,  please check the following code
    string value = table.Rows[0].ItemArray[0].ToString();
    It means get the firstrow and first column value. You can get the specified cell which you want.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Data on a specific cell

    hi all,
    I tried to fill a row with data that is selected from a cfl how far you've come to is this ...
    if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
                                try
                                    SAPbouiCOM.Matrix oMatrix;
                                    int i = pVal.Row;
                                    oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
                                    forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", 0, System.Convert.ToString(oDataTable.GetValue("ItemCode", 0)));
                                    forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", 0, System.Convert.ToString(oDataTable.GetValue("ItemName", 0)));
                                    if(i == oMatrix.RowCount)
                                         oMatrix.AddRow(1, 0);
                                catch (Exception e)
                                    MessageBox.Show(e.Message);
    what happens is that when I select a specific cell value does not change...
    I have another way to do it but I get an error of type "Item can not get focus"
    if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
                                try
                                    SAPbouiCOM.Matrix oMatrix;
                                    SAPbouiCOM.EditText oEdit;
                                    int i = pVal.Row;
                                    oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
                                    oEdit = (SAPbouiCOM.EditText)oMatrix.GetCellSpecific("colItemCod", i);
                                    oEdit.String = System.Convert.ToString(oDataTable.GetValue("ItemCode", 0));
                                    if(i == oMatrix.RowCount)
                                        oMatrix.AddRow(1, 0);
                                catch (Exception e)
                                    MessageBox.Show(e.Message);
    regards.

    Hi all,
    The behavior remains the same, this is the code I use to add rows to the matrix, I need to do is modify the existing values ​​already present in the matrix.
    if (pVal.ItemUID == "colItemCod" || sCflId.ToString() == "CFL_5")
                                try
                                    SAPbouiCOM.Matrix oMatrix;
                                    int i = pVal.Row;
                                    oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
                                    forma.DataSources.DBDataSources.Item("@ZTV_LINES").Clear();
                                    oMatrix.FlushToDataSource();
                                    forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_ItemCode", pVal.Row - 1, oDataTable.GetValue("ItemCode", 0).ToString());
                                    forma.DataSources.DBDataSources.Item("@ZTV_LINES").SetValue("U_Dscript", pVal.Row - 1, oDataTable.GetValue("ItemName", 0).ToString());
                                    if (i == oMatrix.RowCount)
                                        oMatrix.AddRow(1, 0);
                                catch (Exception e)
                                    MessageBox.Show(e.Message);
    The process is done, I mean that values ​​are assigned to the datasource but not show changes.
    this is the way I do the matrix...
    public void setMatrix()
                SAPbouiCOM.Matrix oMatrix;
                oMatrix = (SAPbouiCOM.Matrix)forma.Items.Item("matrix1").Specific;
                oMatrix.AddRow(1, 0);
    Regards

  • Hotspot Cell Wise(specific Cell As Hotspot)

    I have created a simple full screen ALV. using FM  REUSE_ALV_GRID_DISPLAY.
    data it_fact type SLIS_T_FIELDCAT_ALV.
    data wa_fcat like line of it_fcat.
    *in field catalogue i have used this
    wa_fcat-fieldname = 'MATNR'.
    Wa_fcat-colpos= 1.
    Wa_fcat-hotspot  = 'X'.
    append wa_fcat to it_fcat.
    clear wa_fcat.
    By applying this concept it is only possible to make hotspot the entire column.
    BUT I WANT to make hotspot specific cell of this field matnr.
    i have searched but didn't found any reference.

    Its not possible to display hotspot for a particular cell. Instead of that you have highlight a color on a particular cell and let the user click it. Then in user command process only that cell based on condition. Check the code below.
    TYPE-POOLS:slis.
    TYPES:BEGIN OF ty1,
          matnr TYPE mara-matnr,
          mtart type mara-mtart,
          END OF ty1.
    TYPES:BEGIN OF ty,
          matnr TYPE mara-matnr,
          mtart type mtart,
          tcolr TYPE slis_t_specialcol_alv,
          END OF ty.
    DATA: i_mara TYPE TABLE OF ty1,
          i_out TYPE TABLE OF ty,
          wa_mara TYPE ty1,
          wa_out TYPE ty,
         repid TYPE sy-repid,
         it_cat TYPE slis_t_fieldcat_alv,
         wa_cat TYPE slis_fieldcat_alv.
    DATA: wa_color TYPE slis_specialcol_alv,
         wa_layout TYPE slis_layout_alv.
    START-OF-SELECTION.
      repid = sy-repid.
      SELECT matnr mtart FROM mara UP TO 10 ROWS INTO TABLE i_mara.
      IF sy-subrc = 0.
        LOOP AT i_mara INTO wa_mara.
          IF sy-tabix = 5.
            wa_color-fieldname = 'MATNR'.
            wa_color-color-col = '003'.
            APPEND wa_color TO wa_out-tcolr.
            clear wa_color.
          ENDIF.
          wa_out-matnr = wa_mara-matnr.
          wa_out-mtart = wa_mara-mtart.
          APPEND wa_out TO i_out.
          clear wa_out.
        ENDLOOP.
      ENDIF.
      wa_layout-coltab_fieldname = 'TCOLR'.
      wa_cat-fieldname = 'MATNR'.
      APPEND wa_cat TO it_cat.
      wa_cat-fieldname = 'MTART'.
      APPEND wa_cat TO it_cat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = repid
                is_layout               = wa_layout
                i_callback_user_command = 'USER_CMD'
                it_fieldcat             = it_cat
           TABLES
                t_outtab                = i_out.
    FORM user_cmd USING r_ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield.
      IF rs_selfield-value = '8124D92001'
              AND rs_selfield-fieldname = 'MATNR'.
      ENDIF.
    ENDFORM.

  • How to print a specific cell in numbers

    how to print a specific cell in numbers?

    Copy the cell (contents), Paste onto a page of a separate document, or onto a separate sheet of your Numbers document, Print.
    Or insert a single cell table onto your Numbers document, type an = sign in the cell then click on the cell you want to print. Drag the new table to a second sheet, set up your page there, and print.
    See the Numbers '09 User Guide for other useful tools and techniques. Download the guide via the Help menu in Nuimbers.
    Regards,
    Barry

Maybe you are looking for

  • 'iTunes has stopped working' error message on iTunes startup with vista

    Today i downloaded iTunes 7.1, i opened it and all seemed well, i played a few tracks etc. but, when i plugged my ipod in i was told that iTunes has stopped working, i tried to open it again, but the same message pops up. so i restarted the computer,

  • File upload and download in solaris for korian and chinese language

    Hi, We are working on our code to support chinese and korian languages. I am facing problems when i upload or down load any chines or korian files to server. Can some body tell me is there any extra settings required in server as well as our code whi

  • IOkit Kernel Panic?

    Hi guys, if anyone could help me review this panic report I would appreciate it. I know it deals with kernel_task but all of the extensions in the backtrace are apple iokit related (not 3rd party) which makes me stumped. I usually get kernel panics w

  • How to convert String into Clob in Java?

    Hi all, from a form i have a String body = request.getParameter("body_name"); i want to insert the string body to a clob field in oracle. string is from a textarea where the user enter html contents and i want to storeit as a clob in the database. ca

  • Photo Page Bug?

    I have produced a web gallery for real estate. On each page is a property description, photo album. google map etc. When I view this page in the browser and click a photo to view the album anything below the album is pushed downwards on the web page.