Problem in Exporting table to Excel2003

hi,
I have used the sample ExporttoExcel2003 component avaliable for download on the SAP site, for my project.
It downloads the tables into Excel2003 perfectly fine.
<b>however, when the string in the table contains these three characters: & , < , >
then the table doesnt get downloaded into exel2003. I get a XML error.
Maybe its because <> are XML tags and & is considered as a reference.
Is there any way i can bypass this error??? </b>

No Hanoz,
please use this:
private FileInputStream createExcelWorkbook(IWDNode dataNode, Map columnInfos, String fileName) {
   FileInputStream excelCSVFile  = null;
   String attributeName, headerName;
   try {
        File f = new File(fileName);
        WritableWorkbook workbook = Workbook.createWorkbook(f);
        WritableSheet sheet = workbook.createSheet("Report", 0);
        Label labelTitleJXL = null;
        Label labelJXL = null;
        DateTime dateTimeJXL = null;
        Boolean booleanJXL = null;
        StringBuffer strBuff = null;
        IWDNodeElement dataNodeElement = null;
        Object obj = null;
        WritableFont bold = new WritableFont(WritableFont.ARIAL, WritableFont.DEFAULT_POINT_SIZE, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.AUTOMATIC);
        WritableCellFormat boldFormat = new WritableCellFormat(bold);
        int j = 0;
        Iterator iter = columnInfos.keySet().iterator();
     IWDMessageManager msg = wdThis.wdGetAPI().getComponent().getMessageManager();
        for (; iter.hasNext(); j++) {
             attributeName = (String) iter.next(); 
             headerName = (String) columnInfos.get(attributeName);
             labelTitleJXL = new Label(j, 0, headerName, boldFormat);
             sheet.addCell(labelTitleJXL);
             for (int i = 0; i < dataNode.size(); ++i) {
                  dataNodeElement = dataNode.getElementAt(i);
                  obj = dataNodeElement.getAttributeValue(attributeName);
                  if (obj instanceof String) {
                       labelJXL = new Label(j, i+1, (String)obj);
                       sheet.addCell(labelJXL);
                  } else if (obj instanceof Date) {
                       strBuff = new StringBuffer();
                       strBuff.append( dataNodeElement.getAttributeValue(attributeName) );
                        String dataString = strBuff.toString();
                         String[] words = dataString.split ("-");
                         String year = words[0];
                         String mounth = words[1];
                         String day = words[2];
                         String formattedString = day + "/" + mounth + "/" + year;
                       labelJXL = new Label(j, i+1, formattedString);
                       sheet.addCell(labelJXL);
//                       Date aDate = (Date)obj;
//                       dateTimeJXL = new DateTime(j, i+1, (Date)obj);
//                       sheet.addCell(dateTimeJXL);
                  } else if (obj instanceof java.lang.Boolean ) {
                       booleanJXL = new Boolean(j, i+1, ((java.lang.Boolean)obj).booleanValue());
                       sheet.addCell(booleanJXL);
        workbook.write();
        excelCSVFile = new FileInputStream(f);
        workbook.close();
   } catch (IOException ex) {
        // Do nothing.
        // This method will return null and an exception will be reported in the method exportToExcel2003 (Failed to create an Excel!)
   } catch (WriteException ex) {
        // Do nothing.
        // This method will return null and an exception will be reported in the method exportToExcel2003 (Failed to create an Excel!)
   return excelCSVFile;
Bye,
Vito

Similar Messages

  • Problem while Exporting Table Data to Excel Sheet

    Hi All,
    Im getting problem while downloading the table data to Excel.
    Steps i was fallowed:
    1)created Context node with four attributs.
    2)created one attribut(resource) type:  com.sap.ide.webdynpro.uielementdefinitions.Resource
    3)Taken one Filedownload UI and Property resource bounded to (resource)
    4)Added required jar file in the library and copied the same jar file in the navigator lib file
    written the necessary coding but showing the below  problem in the Browser
    You must Flush before accessing the resource content
    Please give me any suggestion  on this
    Regards
    Polaka

    Hi
    Check this might help with Brian Fernandes comments.
    Flush?
    Regards
    Arun Jaiswal

  • Problem with Exporter for MS Access 3.2 in SQL Developer

    Hi,
    I have problem with exporting tables and data from MS Access to XML with Exporter for MS Access 2000.
    This error ocurr: 'Error #5 - XML Exporter'
    When I use Exporter for MS Access 2002 this error ocurr: 'Error #3478 - XML Exporter'
    Any leads how to solve this problem ?

    Thread moved to Forum Home » Database » SQL Developer
    SQL Developer
    Please, stay tune there.
    Nicolas.

  • Problem in exporting dates table to excel

    hey experts,
    i have a problem with exporting data to excel sheet .
    1) when i export date it converts into string  format and stores in the excel sheet ex: "02.02.2008"
    but the problem here is that when i revert back the excel data to abap internal table , it is not working since the date is now in string format ..
    please help urgently.
    Point will b rewarded suitably.
    thx and regards,
    Anoop Gupta

    hey thankx for the immediate reply , but still the problem is that , when i am am receiving the excel sheet data , i have no idea about which filed is having the date value . so first i need to find out the field in which date is stored and then only i can apply that RFC .
    so can u please suggest some other work around or a method to know which filed is having date .
    Any help will be appreciated and will be rewarded.
    Thx & Regards.
    Anoop

  • Export table problem

    hi all,
    When I try to export the EMP_DOC table in oracle 9i database which contains blob datatype I get the following error.
    . . exporting table EMP_DOC
    EXP-00003: no storage definition found for segment(15, 266773)
    What should I do to export the table which contains the BLOB data type.
    Thanks,
    Silambu

    There is a search bar on every page of metalink (as there is a search bar on every page of this forum), consisting of two elements: a combo-box and a text box.
    The former will show 'Knowledge base', the latter is accepting free text.
    To the right there is a link labeled 'Advanced'. This will allow you to search for bug numbers and doc ids.
    Metalink frequently organises webseminars for new users.
    These are announced in the headlines.
    Sybrand Bakker
    Senior Oracle DBA

  • Problem with Export using single table with query

    I have a need to export rows from a specified table using the query parameter to filter the rows I need. The example I have is this:
    EXP user/pwd@id tables=(tableA) query=\"where tableA.id = tableB.id and table B.id2 = tableC.id2 and tableC.id3 = 10\"
    When export runs, I get this: ". . exporting table tableA
    EXP-00056: ORACLE error 904 encountered
    ORA-00904: "TABLEC"."ID3": invalid identifier
    Export terminated successfully with warnings."
    When I viewed the contents of the resulting dmp file through IMP, it only has table column information and no rows exported.
    Could somebody tell me what is wrong?
    I have a feeling it is with the QUERY parameter. The doco on the QUERY parameter only shows a very simple example that filters data by only the columns in the specified table (assumed). Are joins to other tables allowed inside the QUERY?? The doco doesn't say that its not allowed.

    <<
    EXP user/pwd@id tables=(tableA) query=\"where tableA.id = tableB.id and table B.id2 = tableC.id2 and tableC.id3 = 10\"
    >>
    table B.id2 = tableC.id2   -- isn't there one blank too much ?                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem in Exporting a Report Group having a Report Painter Report.

    I am having a problem in exporting a Report group having a Report Painter report.When I am trying to export the Report Group using transaction GR57 with all dependent objects,it is displaying:
           group 0102CPDNUEA-CCROSI not transported.
           Transport groups separately if necessary.
    There are 6 such groups which are not transported.Can anybody help me in this regards.Can anybody help me in exporting these Groups.Specifically in Report painter reports what do these Groups signify and how can we see them.Please help me....

    hi,
    I am able to export my report groups with dependent objects successfully.
    I dont know why you are getting error message. Just keep break point at ***** and execute it for single group and find out why it is giving error.
      IF SY-BATCH = 'X' OR NO_LIST = 'X'.  "direct or batch
        SET PF-STATUS 'LIST'.
    *****PERFORM TRANSPORT_OBJS USING 'X'.  "transport all jobs
        IF FILE_EXP <> 'X'.
          READ TABLE WT_E071 INDEX 1.
          IF SY-SUBRC = 0.
            LEAVE.
          ENDIF.
        ENDIF.
      ELSE.                                "online
        SET PF-STATUS 'MENU'.
       PERFORM WRITE_TRANSP_OBJS.
      ENDIF.
    regards,
    ram

  • Problem using Export in Oracle 8.1.6.

    Hi,
    I have a problem using export utility in oracle 8i.
    I got a message:
    EXP-00056: ORACLE error 942 encountered
    ORA-00942: table or view does not exist
    EXP-00000: Export terminated unsuccessfully
    I tried running CATPROC.sql and CATEXP.sql but it did not correct the problem.
    Please help me.
    Thanks

    You may want to try using the error lookup tool available here, http://otn.oracle.com/pls/tahiti/tahiti.homepage?remark=tahiti You may be able to find the answer even though the error lookup tools is for 8.1.7 version. Otherwise, you can search the db discussion forums to see if this issue has been discussed already.

  • Problem with Export User's data from database oracle 11g

    i want export all user data and Its tables from oracle 11g database, I am using the comand exp, pero export only the tables with data, i Have Some tables and Not Without export data These tables,
    can someone help me!

    problem with zero extent table
    exp is de-supported in 11g. Use expdp instead to export tables without any rows.
    Srini

  • Scheduler for Export Table utility using PL/SQL developer Tool

    Hi,
    Is there any way by which i can schedule manually export tables from a user using PL/SQL developer tool 'Export Tables' utility.
    As i have lot many schema a for each i have to manually exporting all tables using this utility.
    Please suggest.
    Thanks,

    Hello,
    do you mean PL/SQL developer from Allroundautomation? Then this is the wrong forum.
    Do you mean the export feature from SQL Developer, that you can invoke on right click in a result pane? You cannot automate it.
    But if you tell us more about your requirements we might be able to find a good solution for you. Yet this is a question for the {forum:id=75} forum. There is a FAQ {message:id=9360007}. This combined with dbms_scheduler or a scheduled job on your computer might solve the problem.
    Regards
    Marcus

  • Export Table along with Link Files

    Moved from 1.6 to 2.0.
    Exported my application from 1.6 and imported it into 2.0 - used "Application Export" feature - works fine.
    Exported most of my tables from 1.6 to 2.0 - used "Table Export" feature - works fine.
    Problem, I have certain Tables that reference/link to "uploaded files". These are PDFs, SLS and other files - now referenced/linked by these Tables. How do I move over these tables and their linked/uploaded files?

    Maybe this should have been posted with a title of Backup Process.
    We had a server running 10.1 and HTMLDB 1.6. We installed another server and put 10.2 on it with HTMLD 1.6. We couldn't move over everything because we were going from 10.1 to 10.2 -- so we moved over the tables -- this was recommended by Oracle.
    Our tables came over ok but those tables that had attachments/links/uploads in them came over without the attachments/links/uploads. In their place came cryptic references(pointers?) but not the attachemnts.
    Our end game here is to have 2 servers so that if one fails then we can use the other server. We are now upgrading both servers to 10.2. When both servers have 10.2 we will stop upgrading (for a long time) the database. The database had to be upgraded because of a bug in the Enterprise Manager Backup Process.
    We will want new versions Applcation Express/HTMLDB. We would upgrade both machines to keep them compatable.
    Maybe there is utility (that we can comprehend) that allows us to Export tables with attachments from one server and Import them with their attachments into the other server. Or, maybe going forward we should not try to move tables with attachments using Application Express export utilities but move over workspaces or schemas or something.

  • Summary: Problem with export (maybe...terminated sucEE to XE issues exp/imp

    Summary: Problem with export (maybe...terminated successfully with warnings) and import (IMP-00022: failed to process parameters)
    I used PL/SQL developer to make a parameter file (initially I used it to export, then I just stole the file to try again). It contains 100 tables from a single schema.
    Export from prod DB using exp parfile=test.par: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    server uses ZHS16GBK character set (possible charset conversion)
    About to export specified tables via Conventional Path ...
    . . exporting table     CONTRACT_INFO         12 rows exported
    EXP-00091: Exporting questionable statistics.
    'Export terminated successfully with warnings.' !!!I want to import into the cs2_user schema (same privileges as on the production DB) trying:impdp 'sys as sysdba'@danieldb schemas=cs2_user dumpfile=test01tables3.dmpThat gets the error: UDI-00014: invalid value for parameter, 'attach'
    I then thought maybe you have to use imp/exp or impdp/expdp instead of a combination (exp + impdp) so I tried: imp 'sys/admin as sysdba'@danieldb touser=cs2_party_owner file=test01tables4.dmpbut then I just get: IMP-00022: failed to process parameters
    Anyone see why its all failing? :s
    Mike

    you must input SID name into single-quotes like:
    C:\Tools\Oracle\product\10.2.0\db\NETWORK\ADMIN>expdp 'sys/manager@stb as sysdba'
    Export: Release 11.2.0.1.0 - Production on Thu Feb 9 13:46:16 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    UDE-06550: operation generated ORACLE error 6550
    ORA-06550: line 1, column 11:
    PLS-00201: identifier 'SYS.DBMS_UTILITY' must be declared
    ORA-06550: line 1, column 11:
    PL/SQL: Statement ignored

  • EXP 11.2.0.1 export tables with at leat 1 row

    I have oracle db 11.2.0.1 and user the export utility to export
    tables, and row dati from the database to a file dmp.
    I have notice that mow it extract the table with at leat 1 row
    and do not export table empty
    and so when i execute an import i lost a lot of tables...
    Very dangerous ....
    There is and explanations ???

    You may get this effect in release 11.2.0.1 if the table has no segment. You probably have deferred_segment_creation=true. This query may help identify the tables without segments:
    select table_name from user_tables
    minus
    select segment_name from user_segments where segment_type='TABLE';
    (you will of course have to modify the query to handle more complex table structures).
    Data Pump does not have this problem.
    John Watson
    Oracle Certified Master DBA

  • Export tables to excel

    I had the free trial of Acrobat 9 pro and I was able to export tables to Excel without any issues. Bought Acrobat 9 and now I am not able to get the tables exported. Does anybody have any suggestions? Is pro that much better for exporting  tables?

    The trial and full version are identical except for the licensing aspect. General export to Excel was not available until AA XI, so I am not quite sure how you were exporting. In XI, it is simply going to File>Save As>SpreadSheet. In AA 9, the typical process was to select the columns desired with the select tool (use the alt key to allow the selection) and copy the columns to Excel. Adobe has not sold AA 9 for over 4 years as I recall. I did finally get AA 9 to come up on a machine and they did have a save as/export to XML (spreadsheet). However, the use of the alt key with the select also worked. As I recall, there was a way to copy in multiple columns too, but I am too rusty with 9 to remember.
    The problem may be the format of what you are trying to export. You did not indicate what the problem of the export was and so it is hard to judge. What specifically is happening when you try to export a table. A screen shot might help.

  • Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)

    Hi experts,
    I am trying to implement the functionality of downloading the contents of a webdynpro screen to excel sheet. In order to implement the functionality of excel download i used the following blog.
    [/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache ]
    In this blog they have used javaexcel api to implement the excel functionality. I face some problems
    while implementing it.
    i) The use of "Label label = new Label(0, 2, "A label record");
    sheet.addCell(label); " is not supported. It says that a constructor for label with
    (int, int, str) parameter is not available.
    ii) Then i implemented it with "Label label = new Label("A label record"); " Then i deployed it. I got a runtime exception saying that " java.lang.ClassNotFoundException: jxl.format.CellFormat ".
    This cellFormat is an interface available in the jar. I am using jexcelapi_2_6_9_1.4 version. Do i have to
    download some other versions.
    Please help. Thanks in advance.
    Regards
    Ramanan

    Hi,
    Please check the following steps while creating External Library DC:
    1) creating an Extneral library DC
    2) import the JARs to the libraries folder of the External Library DC project
    3) Right-click on each of the JARs imported to the project and add them to the public part.
    This DC is now ready to be used as a build-time reference that will allow CBS to build the "main" Web Dynpro application that will use the external libraries. Next, we have to create a new Web Dynpro DC to hold the class files here are the steps:
    1) Create a new Web Dynpro DC
    2) Create a new public part, selecting the "Can be packaged into other build results" option
    3) Rename the JARs as Zip files and extrct the full content (folders and class files) to your root folder
    4) Import the folders and files to the src/packages folder
    5) Expand the public part node that was created and select the "Entities" node, right-click it and choose Edit
    6) In the Entity Type list select the "Folder" option then in the selected entities tree pick each of the folders that you imported in step 5 (above)
    7) Now do a DC build and a DC deploy of the project
    Then check-in, activate, and release any activities you have associated with creating these two projects. In the DC perspective, refresh the Active DCs and Inactive DCs to ensure that both new DCs appear in the Active list. Now we have to setup the references to these DCs in our main Web Dynpro application. To do this, follow these steps:
    1) Open the Web Dynpro perspective and right click the Used DCs node then choose "Add Used DC.."
    2) Pick the public part of the External Library DC that we created (first) and set it to have a Build Time dependency
    3) Again, right click the Used DCs node and choose "Add Used DC.." then choose the public part of the Web Dynpro DC that we created and give it a Run Time dependecy (weak) and click finish.
    4) Now, due to what I think is a bug. You must right click on the Web Dynpro "used DC" that you just added in the previous step, and set the run time dependency again (it seems to revert to the default values for some reason)
    5) Now do a DC build and a DC deploy on the "main" web dynpro application.
    6) Check-in, activate, and release any activities associated with adding these references and then others on your team may use the classes in the external libraries within the Web Dynpro project.
    Regards.
    Rajat

Maybe you are looking for

  • Charging iPad 2 in the USA

    I have an iPad 2 I live in Australia soon I'm traveling to the USA for a holiday my question is: how can I charge my ipad 2 in the USA knowing the power voltage is different then what it is Australia please help?

  • How to send the Escalation mail

    Hi , We have 7 levels of approval for Shopping cart , however, any one of the manager not approved with in 2 days the escalation mail should send to xyz@company com (central purchaser mail id) How to configure this one ?? Thanks in advance Harish

  • Wood For Trees ... a simple question [JS, CS3]

    I've done all the hard work, got the information I'm looking for and now I wish to place it as an overlay on top of an image. The text frame is there, it has the text in it, but when I attempt to make the frame fill a transparent black, the text also

  • Help needed getting old settings into Logic X

    I've been using Logic for a very long time, so I have thousands of plugin settings that I've saved or downloaded over the years. Logic 9 used to automatically include everything from the Plugin Settings folder within the Logic 6 Series folder - all s

  • Error messages in include

    Hello gurus,   How can I give an error message in the INCLUDE program. I want to capture an error when run in the background. Thank you, Reeta