How to covert csv to Excel 2007

Hello
Can anyone knows that how to convert the CSV file to the EXCEL 2007 format (xlsx ) not to excel 2003(xls) .

Hi,
If you want to create a real Excel file, the easiest way is certainly to use XML. With the Microsoft documentation and some retro engeneering you should be able to produce XLS files matching your needs. Creating XLSX is possible (I made it for DOCX files), this is however much more complicated.
Hope this will help you.
REPORT  test.
DATA: gt_spfli         TYPE STANDARD TABLE OF spfli,
      gr_spfli         TYPE REF TO spfli,
      gv_xls_template  TYPE string,
      go_xls_xml       TYPE REF TO cl_xml_document,
      go_table_element TYPE REF TO if_ixml_element,
      go_row_element   TYPE REF TO if_ixml_element,
      go_cell_element  TYPE REF TO if_ixml_element,
      go_data_element  TYPE REF TO if_ixml_element,
      gv_cell_value    TYPE string,
      gv_nb_rows       TYPE string,
      gv_nb_columns    TYPE string.
"1. Get some test data
SELECT * INTO TABLE gt_spfli FROM spfli.
"2. XML Excel file template creation
CONCATENATE `<?xml version="1.0"?>`
            `<?mso-application progid="Excel.Sheet"?>`
            `<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"`
             `xmlns:o="urn:schemas-microsoft-com:office:office"`
             `xmlns:x="urn:schemas-microsoft-com:office:excel"`
             `xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"`
             `xmlns:html="http://www.w3.org/TR/REC-html40">`
             `<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">`
            ` </DocumentProperties>`
            ` <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">`
            `  <WindowHeight>12525</WindowHeight>`
            `  <WindowWidth>15195</WindowWidth>`
            `  <WindowTopX>480</WindowTopX>`
            `  <WindowTopY>120</WindowTopY>`
            `  <ProtectStructure>False</ProtectStructure>`
            `  <ProtectWindows>False</ProtectWindows>`
            ` </ExcelWorkbook>`
            ` <Styles>`
            `  <Style ss:ID="Default" ss:Name="Normal">`
            `   <Alignment ss:Vertical="Bottom"/>`
            `   <Borders/>`
            `   <Font/>`
            `   <Interior/>`
            `   <NumberFormat/>`
            `   <Protection/>`
            `  </Style>`
            ` </Styles>`
            ` <Worksheet ss:Name="Feuil1">`
            `  <Table x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="60">`
            `  </Table>`
            `  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">`
            `   <PageSetup>`
            `    <Header x:Margin="0.4921259845"/>`
            `    <Footer x:Margin="0.4921259845"/>`
            `    <PageMargins x:Bottom="0.984251969" x:Left="0.78740157499999996"`
            `     x:Right="0.78740157499999996" x:Top="0.984251969"/>`
            `   </PageSetup>`
            `   <Selected/>`
            `   <ProtectObjects>False</ProtectObjects>`
            `   <ProtectScenarios>False</ProtectScenarios>`
            `  </WorksheetOptions>`
            ` </Worksheet>`
            `</Workbook>` INTO gv_xls_template.
"3. Transform the XML String to a real XML document
CREATE OBJECT go_xls_xml.
go_xls_xml->parse_string( stream = gv_xls_template ).
CLEAR gv_xls_template. "No more required
"4. Retrieve the Table node. We will populate this node with the cell's content later on
go_table_element ?= go_xls_xml->find_node( name = '/Workbook/Worksheet/Table' ).
"5. Populating the file with data
LOOP AT gt_spfli REFERENCE INTO gr_spfli.
  "5.1 Creation of a new <Row> tag
  go_row_element ?= go_xls_xml->create_simple_element( name = 'Row' parent = go_table_element ).
  "5.2. Creation of a new <Cell><Data ss:Type="String">my value</Data></Cell>
  "5.2.1. Carrid to String casting
  gv_cell_value = gr_spfli->carrid.
  "5.2.2. <Cell><Data>$gv_cell_value</Data></Cell>
  go_cell_element ?= go_xls_xml->create_simple_element( name = 'Cell' parent = go_row_element ).
  go_data_element ?= go_xls_xml->create_simple_element( name = 'Data' parent = go_cell_element value = gv_cell_value ).
  "5.2.3. Add type description to the <Data> tag
  go_data_element->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ).
ENDLOOP.
"6. Add the number of rows and columns to the <Table> tag
gv_nb_rows = LINES( gt_spfli ). "Number of rows to be displayed
gv_nb_columns = 1. "Number of columns to displayed
CONDENSE: gv_nb_columns NO-GAPS, gv_nb_rows NO-GAPS.
go_table_element->set_attribute_ns( name = 'ExpandedColumnCount' prefix = 'ss' value = gv_nb_columns ).
go_table_element->set_attribute_ns( name = 'ExpandedRowCount' prefix = 'ss' value = gv_nb_rows ).
"7. Display or download the file
"go_xls_xml->display( ).
go_xls_xml->export_to_file( 'C:/temp/spfli.xls' ).

Similar Messages

  • How to covert pdf to excell

    How to convert pdf to excell

    Hi Victor 1234,
    Please check out Getting Started with ExportPDF for instructions on converting a PDF file to Excel format.
    Let us know it goes!
    Regards,
    Sara

  • Oracle SQL Query from EXCEL 2007 with prompt

    Hello,
    I have many excel reports where I am pulling information from our Oracle 9 db through Excel using the following method:
    http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-query-oracle-from-excel-2007/
    http://blog.mclaughlinsoftware.com/2009/11/30/sql-query-in-excel-2007/
    However, I am having trouble when I try the following query due to the prompt:
    SELECT
    IM.ITEM_GROUP,
    IM.ITEM,
    IM.DESCRIPTION
    FROM
    LAWSON.ITEMMAST IM
    WHERE
    IM.ITEM = '&ITEM';
    Does any one know how I can connect a prompt to an excel cell and then pass the query on to Oracle, or have a PL SQL prompt work from Excel?
    Thanks,
    Ben

    The 'prompt' as you call it is a sqlplus feature, so does not belong to the SQL language
    You would need to write a stored procedure returning a resultset.
    create or replace procedure foo(rc in out sys_refcursor, p_item) as
    begin
    open rc for
    'SELECT
    IM.ITEM_GROUP,
    IM.ITEM,
    IM.DESCRIPTION
    FROM
    LAWSON.ITEMMAST IM
    WHERE
    IM.ITEM = '||p_item;
    end;
    and call that using ODBC or asp.net
    Obviously this is profusely documented.
    Sybrand Bakker
    Senior Oracle DBA

  • Error running XL Reporter: 'a required COM add-in program..' for Excel 2007

    I have 2 users running Excel 2007 that can't run XL reporter.  They get the message 'a required COM add-in program for XL Reporter has not been loaded'.  I have instructions for Excel 2003, but not for 2007.  Does anyone know how to resolve this for Excel 2007?

    Gordon,
    I have instructions to get the IXXLReporter.dll file in the installation area, but 2007 has completely different layout. I can't find where to go???  Can you please give me the procedure?
    Edited by: Pat Frohlich on Apr 1, 2009 10:12 AM

  • Microsoft Office Excel 2007 Document Password Lost

    Hi All,
    Anyone know how to recovery Microsoft Office Excel 2007 Document Password? Please advise.
    Thanks & regards,

    Try the password remover at http://www.straxx.com/excel/password.html. I know it works for Excel 2003 files. It may work for your 2007 file as well.

  • How to read a .csv file(excel format) using Java.

    Hi Everybody,
    I need to read a .csv file(excel) and store all the columns and rows in 2d arrays. Then I can do the rest of the coding myself. I would like it if somebody could post their code to read .csv files over here. The .csv file can have different number of columns and different number of rows every time it is ran. The .csv file is in excel format, so I don't know if that affects the code or not. I would also appreciate it if the classes imported are posted too. I would also like to know if there is a way I can recognize how many rows and columns the .csv file has. I need this urgently so I would be very grateful to anybody who has the solution. Thanks.
    Sincerely Taufiq.

    I used this
    BufferedReader in = new BufferedReader (new FileReader ("test.csv"));
    // and                
    StringTokenizer parser = new StringTokenizer (str, ", ");
                    while (parser.hasMoreTokens () == true)
                    { //crap }works like a charm!

  • How to get variable value in BI 7.0 Workbook (Excel 2007)

    Dear experts,
      We are creating workbooks with BI 7.0 BEx Analyzer Addon 7.10 (Excel 2007).
    And we'd like to get the variable value (that are passed to the backend using the variable screen) so that we can reuse it as an input value for planning function execution later.
      Any idea on how we can achieve this is high appreciated.
    Thanks in advance,
    Shady

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • How to correct bad PDF display of Excel 2007 graph-Adobe Pro X?

    Just installed Adobe Acrobat Pro X; previously had Adobe Pro 8, which worked fine.  Have Excel 2007 files with an Excel graph and a JPG image on the spreadsheet tab.  Both the graph and the JPG are too big, are displaced, and hide spreadsheet data, when the Excel file is Saved As a PDF using Adobe Pro dialog or Excel dialog, or the Excel Plug-In to Create PDF.  For some strange reason, printing to PDF works, although that is limiting.  All of the settings are the same for the Adobe Printer as Adobe Pro settings.  Changing them or going to default did not help.  Just did the latest update; that did not help.
    The graph and JPG are too large for the PDF page.  Paper printing from Excel still works fine. Producing a PDF on another machine with Pro 8 still works fine.  Could not find this problem discussed anywhere.  Using XP, fully patched.  This should not be a complicated process, nor a complex spreadsheet. What is going on?
    Thanks

    Regardless of the method and Adobe product used to create the PDF, including the Excel tool button, the single common factor whether the PDF correctly displays a JPG or graph in the Excel file that is being done at anything other than 100% size is whether the Adobe Printer or a Physical Printer is selected as the default printer in the Windows Printers and Faxes-Settings.  This is true even though the printer is not being used. I have created the same PDF using every method/product and the results are always the same, and only properly display when either the setting is 100% size or the system printer is selected as Adobe Printer.  This is true only after installing Adobe X (8 was previously installed, and worked as expected).
    Jeffry Calhoun
    Workforce Analytics Manager
    Ohio Department of Job & Family Services
    P.O. Box 1618, Columbus, OH 43216-1618
    InterAgency: F376, 4020 E. 5th Avenue
    614-644-0564
    Fax 614-728-5938
    [email protected]
    OhioMeansJobs.com -
    The next best thing to having an HR department.
    OhioMeansJobs.com -
    Ohio's premier website for connecting businesses and job seekers - quickly, easily, and for free!
    >>> "Bill@VT" <[email protected]> 4/7/2012 7:21 AM >>>
    Re: How to correct bad PDF display of Excel 2007 graph-Adobe Pro X? created by Bill@VT ( http://forums.adobe.com/people/Bill%40VT ) in Creating, Editing & Exporting PDFs - View the full discussion ( http://forums.adobe.com/message/4319297#4319297 )
    You say the settings for the printer work fine, but do not for PDF Maker (I am assuming this is what you meant). PDF Maker no longer uses the printer and the settings are independent. Check the settings for PDF Maker under the create PDF menu.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4319297#4319297
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4319297#4319297. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Creating, Editing & Exporting PDFs by email ( mailto:discussions-community-acrobat-creating__editing_%[email protected] ) or at Adobe Forums ( http://forums.adobe.com/choose-container!input.jspa?contentType=1&containerType=14&contain er=4697 )
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.
    Ohio Means Jobs
    You're looking for something unique. Use more than an ordinary site.
    http://www.ohiomeansjobs.com
    This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain private, confidential, and/or privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, employee, or agent responsible for delivering this message, please contact the sender by reply e-mail and destroy all copies of the original e-mail message.

  • Excel 2007 csv file formatting issue

    Our users create .csv files for upload to SAP. Their habit is to include a number of blank lines in excel to make it more readable.
    In Excel 2003, blank lines were handled as, literally, blank lines, and opening in a text editor shows exactly that, a blank line (with a CR-LF character to terminate the row).
    In Excel 2007 however, the blank line consists of a number of commas equal to the no. of columns, followed by the CR-LF termination. Hope that makes sense.
    While the 2003-generated .CSVs are fine, the 2007 versions cause SAP to throw an exception  ("Session never created from RFBIBL00") and the upload fails. The question therefore is, has anyone ever come across anything similar, or is anyone aware of any remediation that might be possible? Haven't been able to find any documentation on this Excel 2003-2007 change sonot able to address the issue through Excel config.
    Thanks!
    Duncan

    Hello
    Please refer to the consulting note 76016 which will provide information on the performance of the standard program
    RFBIBL00.
    Regards.

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • How to connect to BO from Excel 2007

    Hi everyone,
    as I am new to BO I need help how to establish connection to a BO Universe from Excel 2007 - what components I need to install to be able to make the connection, and steps for creating the connection
    Thanks in advance,
    Maria

    Hello Mario,
    It looks like what you are looking for is the "live office" plugin/toolbar that is added to excel that allows you to import WEBI reports based on universes into excel.
    Check this link for more info:
    [http://www.sap.com/usa/solutions/sapbusinessobjects/large/business-intelligence/information-infrastructure/enterprise/live-office/index.epx]
    Regards,
    Duncan

  • How to make restoration of corrupted excel 2007 file?

    Hi there, 
    When I open an excel file the following error message is displayed: “The file may be corrupted, located on a server that is not responding, or read only”.
    Since this happened whenever I open any excel file, the above error message is again displayed, I must also mention that I am sure my files are not read-only and the files are stored on my hard disk and I use VM ware and my OS is windows server! 
    How can I solve this problem?

    You may copy the file to another computer with Excel installed, and open it. If the error still exist, then your file is corrupt. Otherwise, there may be some problems with your Excel in the original computer and you need to uninstall/reinstall Excel.
    If the file is corrupt, then you can try several methods to recover it:
    1. First of all, you can try to repair the file manually in Excel, as follows:
    (1) On the File menu, click Open.
     (2) In the Open dialog box, select the file you want to open, and click the arrow next to the Open button.
     (3) Click Open and Repair, and then choose which method you want to use to recover your workbook.
    You may find more information about this at:
    http://office.microsoft.com/en-us/ex...001034656.aspx (for Excel 2003)
     http://office.microsoft.com/en-us/ex...017.aspx?CTT=1 (for Excel 2007)
     http://office.microsoft.com/en-us/ex...840.aspx?CTT=1 (for Excel 2010)
     http://office.microsoft.com/en-us/ex...554.aspx?CTT=1 (for Excel 2013)
    2. If method 1 fails, there are still several methods to recover your Excel file manually with Excel, including writing a small VBA macro, as below
    http://office.microsoft.com/en-us/ex...#_Toc337637262
    3. Third, there are also free tools from third-parties that can open and read Microsoft Excel files, for example,
    3.1 OpenOffice at http://www.openoffice.org. This is a very famous open source project that is designed to support Office file formats, including Excel files. The software can run under Windows.
    3.2 KingSoft Spreadsheets at
    http://www.kingsoftstore.com/office/free-excel. This is a free Windows tool that can open Excel files.
    3.3 Google Drive at https://drive.google.com/ also support to load Excel files.
    Sometimes when Excel fails to open your file, these tools may be able to open it successfully. If that is the case, then after the Excel file is opened, you can just save it as a new file which will be error-free.
    4. For xlsx files, they are actually a group of files compressed in Zip file format. Therefore, sometimes, if the corruption is only caused by the Zip file, then you can use Zip repair tools such as WinRAR at
    http://www.rarlab.com to repair the file, as follows:
    4.1 Assuming the corrupt Excel file is a.xlsx, then you need to rename it to a.zip
    4.2 Start WinRAR, go to "Tools > Repair Archive" to repair a.zip and generated a fixed file a_fixed.zip.
    4.3 Rename a_fixed.zip back to a_fixed.xlsx
    4.4 Using Excel to open a_fixed.xlsx.
    There may still be some warnings when opening the fixed file in Excel, just let ignore it and Excel will try to open and repair the fixed file. If the file can be opened successfully, then you can just save the contents into another error-free file.
    5. If all above methods do not work, then you may try third-party tools such as DataNumen Excel Repair at
    http://www.datanumen.com/excel-repair/
    I have used it to recover some Excel files successfully. It provides a free demo version so that you can try to see if the data you want can be recovered or not.
    Good luck!

  • Does anyone know how to hide the export option for excel 2007

    Does anyone know how to hide the export option for excel 2007?
    We are having an issue with negative numbers downloading as text field in excel 2007, works fine in excel 2003.
    We are on version 11.1.1.7.0 of OBIEE.
    Thanks for any response.

    Go to iTunes>Preferences>Devices and highlight the backup you want to delete and click on Delete Backup

  • How do i select nonadjacent range in Microsoft Excel 2007 on Macbook?

    Hello
    I have 1st generation black Macbook and I am running Microsoft Excel 2007 via VMware Fusion. I am currently taking a class of excel 2007 and I would love to use my Macbook to do assignments, but I have problem selecting nonadjacent range cell, such as A1:A5;F1:G5.
    In my class, I would use Dell base pc Windows XP: I would select the adjacent range A1:A5, then while holding down the "Ctrl" key, I would select the adjacent range F1:G5, yet when I were to do that with my Macbook, it will work as if I'm clicking the secondary right click. I can not select nonadjacent range.
    I thought there must be a way to deactivate the secondary click function by pressing "Ctrl" key, but I'm not sure how I can do that.
    Is there anyway I can select nonadjacent range?
    thank you for your time.
    Masashi

    Well then, I believe Yosi should try different combinatins of keys to get it to do what he wants it to do. I just poked around with a few keys and got it to work. If Yosi is new to macs, then I think that is what I would suggest doing. Poke around and you will find what works.
    I was not trying to say that because it worked in Numbers that it would be exactly like that for Excel.
    If that is how it sounded, I apologize.
    Yosi, keep trying different combinations, you will find something that works.
    Good Luck.
    Adam

  • Excel 2007. OLAP pivot. How do you resize dropdown width and height?

    Excel 2007. OLAP pivot. How do you resize dropdown width and height?

    hi,
    I'm afraid we can't modify that property in Excel. Someone had suggested to use a custom combo box to replace the built-in drop-down. However it will lose the features which are only available
    for built-in drop-down.
    Hope this
    thread will give you some ideas. Thank you.

Maybe you are looking for

  • I can't install Intel graphics driver for HP Pavilion G6 2240SH under Windows 8.1

    HI! I installed Windows 8.1 Update 1 x64 to my HP Pavilion G6 2240SH laptop. I started install the drivers and I got an error message in the Intel High-Definition setup: "This computer does not meet the minimum requirements for installing the softwar

  • PO is fully received but its still displayed in CJI5 with commit = 0

    I have a Material PO with 2 line items fully received (Good Receipt). The PO Line Items Total Amounts and Quantities are correctly shown in CJI3 (Actual Cost). However, the PO Line Items are still shown in CJI5 with Outstanding Commitment Amount = 0.

  • Table for BOM changes

    Is there a report that I can run to find all BOM changes for a specific date? Is there a table that I can query that would hold this information? I would also like to perform the same search for recipies and material master changes.

  • Why my apple care for iphone doesn't transfer to my new phone after I claim a new one from apple store ?

    2 days ago my iphone fall into a sink full of water. Yesterday I went to apple store and ask for apple care for iphone and they have it. So, I bought it and registered it right away since my iphone still be in a garentee and still not surpass one yea

  • Can a menu button loop a timeline?

    I need to make a timeline loop on a DVD. Normally I'd make the end action of the timeline point to the start of the timeline and it would loop. But client wants to give the option from a menu -- play the timeline through once, or loop it continuously