Writing data from a table into a spreadsheet file

I've managed to figure out putting a table on the screen for user in put (I think  I made it more difficult for myself than it actually was) and I can have LabVIEW convert the data into a spreadsheet string and display that for me.  Now I'd like to send the data entered into the table out as a tab-delimited text file.  What's holding me up at the moment is that not all the data in the table is numeric.  I've got four columns, the first of which will hold an 8- or 9-digit serial number, presently starting with 0.  Columns 2-4 will be numeric (integer) information.  What's the proper way to get my table data into this tab-delimited text file?
Thank you for your help.
-Dan

Hi,
The attached example shows how table content is convert to spreadsheet string for storing, as well as converting read spreadsheet string to table data for displaying.
Hope this is useful
Regards,
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com
Attachments:
IFK_TABLE_Saving & Retrieving Table Content.vi ‏69 KB

Similar Messages

  • How to bind the data from user table into user report

    Hi All,
      Please assist me to bind the data from user table into user report. I did create an user table with data and create a user report template (using Query Print Layout). How can I display my data into report format which I created before? Any sample program or document I can refer?
    Platform: SAPB1 2005A
    Add On Language: VB.Net 2003
    Thanks.
    rgds
    ERIC

    Hi Ibai,
      Thanks for your feed back. I give you an example.
    Let say now i wanna print employee list, so i will go
    1. Main Menu -> Reports -> HR -> Employee List
    2. Choose the Selection Criteria -> OK
    3. Matrix will display (Employee List)
    4. I can print the report click on print button
    5. Printing report
    My target
    1. Main Menu -> Eric_SubMenu -> Employee List
    2. Matrix will display (Employee List)
    3. Print button
    4. Print report
    My problem
    Now I would like to use my own report format. My own report format means I wanna add on my logo or do some customization within the employee report. So how I am going to do? I only able to display the employee list in matrix. How do I create a new report format and display it.
    Thanks.
    rgds
    ERIC

  • Store data from a table into excel sheet and email

    Hi all,
    I am just wondering, i m not sure where to start. I want to insert data from a table into an excel spread sheet.
    I'm working on a stored procedure with 3 input parameters:
    1. the actual query
    2. userid
    3. the column headers (comma separated) - these will be in the same order as the outer select statement in the query itself. I will use the column headers for the respective columns in Excel worksheet.
    When the proc is executed, the excel is populated. If the record count is > 65536, then I need to create multiple worksheets in the same excel file.
    How can i do that? Can any body please help with this..?

    We are doing like this ( Not sure whether it is the best method available)
    --Get the output of the query (Since the number of columns is not fixed you would have to use dbms_sql package)
    --loop through the output and write into a file, for example test.csv, using UTL_FILE package
    --load the file into a blob variable(we are doing it by loading it into a table)
    --For mailing You can use the below package
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
    Mailing code we are using is given below:
    CREATE OR REPLACE procedure xls_mail(
        p_sender     varchar2, -- sender, example: 'Me <[email protected]>'
        p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
        p_subject    varchar2, -- subject
         p_text           varchar2, -- text
         p_filename      varchar2, -- name of xls file
         p_blob           blob         -- xls file
    ) is
      conn      utl_smtp.connection;
      i number;
      len number;
    BEGIN
      conn := demo_mail.begin_mail(
        sender     => p_sender,
        recipients => p_recipients,
        subject    => p_subject,
        mime_type  => demo_mail.MULTIPART_MIME_TYPE);
      demo_mail.begin_attachment(
        conn         => conn,
        mime_type    => 'application/xls',
        inline       => TRUE,
        filename     => p_filename,
        transfer_enc => 'base64');
        -- split the Base64 encoded attachment into multiple lines
       i   := 1;
       len := DBMS_LOB.getLength(p_blob);
       WHILE (i < len) LOOP
          IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
          ELSE
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, (len - i)+1,  i)));
          END IF;
          UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
          i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
       END LOOP;
      demo_mail.end_attachment(conn => conn);
      demo_mail.attach_text(
        conn      => conn,
        data      => p_text,
        mime_type => 'text/html');
      demo_mail.end_mail( conn => conn );
    END;

  • Inserting data from  a table  to an XML file

    I want to insert the values from this xml file emp.xml into a table Employees :
    <EMPLOYEES>
    <EMP>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <HIREDATE>17-DEC-80</HIREDATE>
    <SAL>800</SAL>
    </EMP>
    <EMP>
    <EMPNO>7499</EMPNO>
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <HIREDATE>20-FEB-81</HIREDATE>
    <SAL>1600</SAL>
    <COMM>300</COMM>
    </EMP>
    <EMP>
    </EMPLOYEES>
    and here is my Employee table in Oracle 9i database
    SQL> DESC EMPLOYEE;
    Name Null? Type
    EMPNO NUMBER
    EMPNAME VARCHAR2(10)
    JOB VARCHAR2(10)
    HIREDATE DATE
    SAL NUMBER
    After getting help from the members i was able to do the insert of data from the xml file to the table..how to do the insert of data from the table to the xml file.
    Regards,
    Renu

    Hello michaels , thank you for the solution, still i am having some problems
    Here is what i have done :
    1.
    SQL> CREATE DIRECTORY my_table_dir AS 'E:\table_files'
    2 ;
    Directory created.
    2.
    SQL> select * from myemp;
    ENAME
    SMITH
    ALLEN
    3.
    This is the content of the existing xml file saved in the directory E:\table_files as emp.xml
    <EMPLOYEES>
    <EMP>JIM</EMP>
    <EMP>RICK</EMP>
    </EMPLOYEES>
    4.
    Now i executed this code :
    declare
    emp_xml xmltype;
    begin
    select sys_xmlagg (column_value, sys.xmlformat ('EMPLOYEES')) emp_xml
    into emp_xml
    from table (xmlsequence (cursor (select *
    from myemp
    where ename in ('SMITH', 'ALLEN')),
    sys.xmlformat ('EMP')
    dbms_xslprocessor.clob2file (emp_xml.getclobval (), 'E:\table_files', 'emp.xml');
    end;
    And the Error i got is :
    declare
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 424
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 46
    ORA-06512: at line 12

  • Dump data from a table into wwv_flow_files

    HI,
    Could you help me, to take data from a table, and insert it into blob_content in wwv_flow_files; and data should be stored in a .txt file
    regards,
    Rajesh

    Alex Nuijten wrote:
    But in case of APEX, that might be a really bad idea to insert metadata in the apex repository:
    http://joelkallman.blogspot.com/2010/01/perils-of-modifying-application-express.html
    This is not really an APEX metadata table, Alex. As far as I recall, it is a standard mod_plsql documents table that handles file uploads. One can also insert a document into the table dkirectly using an INSERT as it pretty straight forward.
    Not exactly sure why though as the doc download procedure needs a LOB or CLOB.. and it does not care from what table you create it from - or whether you do it on the fly.
    But still, you make an important point of using application/system objects for the purpose they have been designed for. And in this case, creating your own documents table may be a lot better.

  • Retrive data from two tables into one internal table.

    Hi SDN,
    I am downloading the Assets data from two tables ANLA,ANLZ.
    there is a common field ANL1in both tables and i have to retrive the data by using anl1 into the internal table.
    can you please send me the SELECT Syntax for this probl.....
    Thank you & Regards,
    Manoj

    Hi manoj,
    Please see the following sample code. But kindly don't use join as it may hamper ur performance. No trouble in using two select query.
    data: begin of itab occurs 0,
            BUKRS like anla-BUKRS,
            ANLN1 like anla-ANLN1,
           BDATU like anlz-BDATU,
            end of itab.
    select anlabukrs anlaANLN1 anlzBDATU  into corresponding fields of table itab from anla inner join anlz on anlaanl1 eq anlz~anl1 where (logexp).
    Please come back for any clarification.
    Thanks and Regards,
    saurabh

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

  • Import data from Oracle table into flat file

    How to import the data in the oracle table into flat file using UTL File of PL/SQL....
    I am new in PL/SQL..
    can someone help me in writing query?

    Note : Not Tested.
    DECLARE
    V1 VARCHAR2(32767);
    F1 UTL_FILE.FILE_TYPE;
    cursor c1 is select ename,empno from emp;
    r_c1 c1%rowtype;
    BEGIN
    -- In this example MAX_LINESIZE is less than GET_LINE's length request
    -- so the number of bytes returned will be 256 or less if a line terminator is seen.
    open c1;
    F1 := UTL_FILE.FOPEN('MYDIR','MYFILE','W',256);
    loop
    fetch c1 into r_c1;
    v1:= r_c1.ename||''||To_char(r_c1.empno);
    UTL_FILE.PUT_LINE (F1, v1,TRUE);
    v1:= null;
    Exit when c1%not found;
    end loop;
    UTL_FILE.FCLOSE(F1);
    END;
    http://download.oracle.com/docs/cd/B19306_01/appdev.102
    ------------------------------------------------------------------

  • Insert data from a table into 5 different tables

    My application has a data block than display information from another table. From this data block, the user has the option to select the records for upload. The information in the data block is used to insert data into 5 different tables. So if any exception occurs while inserting, the whole process should be rollback, but before this happen a record is inserting in a failed table indicated the reason of the failed.
    For this process I use the following commands:
    1.     sp_name := Get_Application_Property(SAVEPOINT_NAME);
    2.     INSERT DDL
    3.     INSERT DDL
    4.     INSERT DDL
    5.     INSERT DDL
    6.     INSERT DDL
    7.     If Other Exception then ISSUE_ROLLBACK(sp_name) Otherwise FORMS_DDL ('commit')
    The problem the previous insert(s) rollback
    Thanks,

    Hi,
    If you are using FORMS_DDL built-in to insert the data, then after each FORMS_DDL statement, you have to check the values of FORM_SUCCESS or FORM_FAILURE built-ins.
    FORMS_DDL('<insert_statement_1>');
    IF FORM_FAILURE THEN
    <the statement fails. so have to be rollbacked>
    END IF;
    FORMS_DDL('<insert_statement_2>');
    IF FORM_FAILURE THEN
    <the statement fails. so have to be rollbacked>
    END IF;Hope this helps.
    Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • Error while downloading data from internal table into XML file

    hi all,
    i developed a program to download data from into internal table to xml file like this.
    tables: mara.
    parameters: p_matnr like mara-matnr.
    data: begin of itab_mara occurs 0,
                matnr like mara-matnr,
                ernam like mara-ernam,
                aenam like mara-aenam,
                vpsta like mara-vpsta,
          end of itab_mara.
    data: lv_field_seperator type c,     " value 'X',
          lv_xml_doc_name(30) type c,    " string value ‘my xml file’,
          lv_result type i.
          lv_field_seperator = 'x'.
          lv_xml_doc_name = 'my xml file'.
    types: begin of truxs_xml_line,
              data(256) type x,
          end of truxs_xml_line.
    types:truxs_xml_table type table of truxs_xml_line.
    data:lv_tab_converted_data type truxs_xml_line,
         lt_tab_converted_data type truxs_xml_table.
    data: lv_xml_file type rlgrap-filename value 'c:\simp.xml'.
    select matnr ernam aenam vpsta from mara into table itab_mara up to 5
           rows where matnr = p_matnr.
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = lv_field_seperator
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
       I_XML_DOC_NAME             = lv_xml_doc_name
    IMPORTING
       PE_BIN_FILESIZE            = lv_result
      TABLES
        I_TAB_SAP_DATA             = itab_mara
    CHANGING
       I_TAB_CONVERTED_DATA       = lt_tab_converted_data
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    open dataset lv_xml_file for output in binary mode.
    loop at lt_tab_converted_data into lv_tab_converted_data.
    transfer lv_tab_converted_data to lv_xml_file.
    endloop.
    close dataset lv_xml_file.
    this program is syntactically correct and getting executed, but when i open the target xml file it is showing the following error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'file:///C:/simp.xml'.
    will anyone show me the possible solution to rectify this error
    thanks and regards,
    anil.

    Hi,
    Here is a small sample program to convert data in an internal table into XML format and display it.
    DATA: itab  TYPE TABLE OF spfli,
          l_xml TYPE REF TO cl_xml_document.
    * Read data into a ITAB
    SELECT * FROM spfli INTO TABLE itab.
    * Create the XML Object
    CREATE OBJECT l_xml.
    * Convert data in ITAB to XML
    CALL METHOD l_xml->create_with_data( name = 'Test1'
                                         dataobject = t_goal[] ).
    * Display XML Document
    CALL METHOD l_xml->display.
    Here are some other sample SAP programs to handle XML in ABAP:
    BCCIIXMLT1, BCCIIXMLT2, and BCCIIXMLT3.
    Hope this helps,
    Sumant.

  • Writing Data from a Table to Excel

    Hi Experts
    I have a requirement to load data from an Oracle Table to an excel File. I was able to use OdiSqlUnload to achieve this, but the problem is I am not getting Header Information in my Excel. Please advise if there is any other method through which I can achieve this.
    Thanks

    Hi,
    Create a datastore in the file tecnology and make it delimited by ";".
    After that create an interface from table to it.
    In the IKM, you can chose to generate the header
    OR
    Use 2 OdiSqlUnload where the first just create the file and the header (a select column name from dual where column names are constants ) and the 2 append the real data
    Make any sense?

  • Writing data from a table to Excel file

    Hello friends,
    I am using Forms 5.0 on Windows NT. I need to write data from table A to Excel sheet from trigger 'when-botton-pressed'. Could you help me Any help will be appriciated.
    Thanks
    Charg
    null

    HERE IS THE CODE.
    YOU CAN RUN IT USING THE DEPT TABLE.
    PROCEDURE export_transaction_to_excel IS
    application ole2.obj_type;
    workbooks ole2.obj_type;
    workbook ole2.obj_type;
    worksheets ole2.obj_type;
    worksheet ole2.obj_type;
    cell ole2.obj_type;
    fdes varchar2(250);
    rowcounter number:=1;
    local_cursor_record number:=:system.cursor_record;
    old_cursor_style varchar2(100);
    errors_occured boolean:=false;
    ole_error exception;
    pragma exception_init(ole_error, -305500);
    my_alert_id alert;
    alert_respnse number;
    procedure place_value_in_cell(rownum_in in number,colnum_in in number,value_in in varchar2) is
    args ole2.list_type;
    begin
    args:=ole2.create_arglist;
    ole2.add_arg(args,rownum_in);
    ole2.add_arg(args,colnum_in);
    --cell:=ole2.invoke_obj(worksheet,'Cells',args);
    cell:=ole2.get_obj_property(worksheet,'Cells',args);
    ole2.destroy_arglist(args);
    ole2.set_property(cell,'Value',value_in);
    ole2.release_obj(cell);
    end place_value_in_cell;
    procedure savespreadsheet is
    args ole2.list_type;
    vDatestamp varchar2(20);
    begin
    fdes:='C:\TESTFORM.XLS';
    vDatestamp:=to_char(sysdate,'mmddyyyyy')&#0124; &#0124;'-'&#0124; &#0124;to_char(sysdate,'hh24miss');
    args:=ole2.create_arglist;
    ole2.add_arg(args,fdes);
    ole2.invoke(worksheet,'SaveAs',args);
    ole2.destroy_arglist(args);
    ole2.invoke(application,'Quit');
    end savespreadsheet;
    procedure open_excel_workbook is
    begin
    application:=ole2.create_obj('Excel.Application');
    workbooks:=ole2.get_obj_property(application,'Workbooks');
    workbook:=ole2.invoke_obj(workbooks,'Add');
    worksheets:=ole2.get_obj_property(application,'Worksheets');
    worksheet:=ole2.invoke_obj(worksheets,'Add');
    end open_excel_workbook;
    procedure write_column_header is
    begin
    place_value_in_cell(rowcounter,1,'Depart No');
    place_value_in_cell(rowcounter,2,'Depart Name');
    place_value_in_cell(rowcounter,3,'Loc');
    rowcounter:=rowcounter+1;
    end write_column_header;
    procedure export_the_data is
    original_receipt number;
    original_date date;
    original_transmital_number number;
    begin
    go_block('dept');
    first_record;
    loop
    place_value_in_cell(rowcounter,1,to_char(:deptno));
    place_value_in_cell(rowcounter,2,:dname);
    place_value_in_cell(rowcounter,3,:loc);
    exit when :system.last_record='TRUE';
    next_record;
    rowcounter:=rowcounter+1;
    end loop;
    end export_the_data;
    BEGIN
    begin
    old_cursor_style:=get_application_property(cursor_style);
    set_application_property(cursor_style,'BUSY');
    open_excel_workbook;
    write_column_header;
    export_the_data;
    exception
    when form_trigger_failure then
    raise;
    when ole_error then
    message('error sending data to excel');
    message(' ');
    errors_occured:=true;
    end;
    savespreadsheet;
    ole2.release_obj(worksheet);
    ole2.release_obj(worksheets);
    ole2.release_obj(workbook);
    ole2.release_obj(workbooks);
    ole2.release_obj(application);
    if not errors_occured then
    go_record(local_cursor_record);
    end if;
    set_application_property(cursor_style,old_cursor_style);
    END export_transaction_to_excel;

  • Loading Data from multiple tables into essbase using ODI

    Hi,
    We have a scenario where data comes from multiple tables. I would like to know how will ODI load this data for the right combination of the members

    Hi,
    I take it each data table has a field which maps to the other table. You can just drag the datastores on to the source interface and create a join between the tables.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Exporting data from database tables to a XML file

    Hi,
    We want to export data from Oracle database tables to an XML
    file. What tool can we use for this purpose, and how do we go
    about it ?
    Can we extract data only from an Oracle8 database, or can we
    extract data from Oracle7.3 databases too ?
    Any help in this regard would be appreciated.
    Thanks
    Dipanjan
    null

    Dipanjan (guest) wrote:
    : Hi,
    : We want to export data from Oracle database tables to an XML
    : file. What tool can we use for this purpose, and how do we go
    : about it ?
    : Can we extract data only from an Oracle8 database, or can we
    : extract data from Oracle7.3 databases too ?
    : Any help in this regard would be appreciated.
    : Thanks
    : Dipanjan
    Start by downloading the XML SQL Utility and make sure you have
    the approriate JDBC 1.1 drivers installed for your database.
    There are samples which will get you going included in the
    archive.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Error loading data from bw table into BW system

    Dear all,
    I have created and fill z tables in bw system, and try to load data into same bw system.
    What i am facing is error message saying "Error in module RSQL of the database".
    and when i check st22 for dump analysis, it says:
    Runtime Errors         DBIF_RSQL_INVALID_RSQL
    Exception              CX_SY_OPEN_SQL_DB
    how come?
    Thanks

    Can you try again by activating the generic datasource in RSO2. It should work.
    And also make sure the tables are active.
    Ravi

Maybe you are looking for

  • Can no longer find or use Auto Trace in Illustrator CS11

    My system was recently "upgraded" to Windows 7. Now I can no longer find the Auto Trace option in Illustrator CS 11. I see it in the preferences but cannot access it through a menu. I see "expand" but it's gray and not available. Any suggestions?

  • Unable to update payment cards data through ORDERS05 in va02

    Hi all, I noticed one thing that in IDOC_INPUT_ORDERS (ie creation of sales order)  we have a bdcdata populated for payment cards (for header in VA01) .But when we are changing sales order by IDOC_INPUT_ORDCHG (change sales order VA02) we have no bdc

  • Deleting music on hard drive after transfer to Ipod

    Hello- I'm wanting to delete my music files in my Music Library (on my computer) after I've transferred them to my Ipod. I see no reason to waste hard drive space. But I'm scared that if I do that, I-tunes software will wipe my Ipod clean the next ti

  • Page not displayed on server but works fine locally in Jdeveloper

    Hi, The page works fine locally when run from Jdeveloper. But when the page is imported to server and when the page is called....it trys to load the page for long time and times out and displays the IE error 'The Page cannot be displayed'. Do I have

  • Create "Dynamic" beans to handle dynamic form

    Hi All, Hope it is not too stupid question. JSP is all about dynamic content, a part of which can be a form that displays different fields and attributes. If I use Javabeans to handle the form, I will need different beans to go with each "configurati