Problem in exporting data to excel in nwds 7.3

Hi All,
I was using the following code for exporting data to excel in NWDS 7.3
private IWDCachedWebResource getCachedWebResource(byte[] file, String name,
WDWebResourceType type) {
IWDCachedWebResource cachedWebResource = null;
if (file != null) {
cachedWebResource = WDWebResource.getWebResource(file, type);
cachedWebResource.setResourceName(name);
return cachedWebResource;
I was getting the error in the following line cachedWebResource = WDWebResource.getWebResource(file, type); when I clicked the quick help it ststed the getWebResource method is depricated.  Kindly provide some assistance on what is the new method in its place.
Thank you
Regards,
Preet Kaur

Hi Ganesh,
Thanks that worked fine, but when we go further we are facing problem ie
byte[] excelXMLFile;
IWDCachedWebResource cachedExcelResource = null;
String fileName = dataNode.getNodeInfo().getName() + ".xls";
try {
// create Excel 2003 XML data as a byte array for the given context node,
// attributes and headers
excelXMLFile = toExcel(dataNode, columnInfos).getBytes("UTF-8");
// create a cached Web Dynpro XLS resource for the given byte array
// and filename
cachedExcelResource = getCachedWebResource(
excelXMLFile, fileName, WDWebResourceType.XLS);
// Store URL and file name of cached Excel resource in context.
if (cachedExcelResource != null) {
wdContext.currentContextElement().setExcelFileURL(
cachedExcelResource.getURL());
wdContext.currentContextElement().setExcelFileName(
cachedExcelResource.getResourceName());
// Open popup window with a link to the cached Excel file Web resource.
openExcelLinkPopup();
} else {
wdComponentAPI.getMessageManager().reportException(
"Failed to create Excel file from table!", true);
} catch (UnsupportedEncodingException e) {
wdComponentAPI.getMessageManager().reportException(
e.getLocalizedMessage(), true);
} catch (WDURLException e) {
wdComponentAPI.getMessageManager().reportException(
e.getLocalizedMessage(), true);
The above bold lines also would need to be converted to inputstream, but not sure how to correct that
We are following the below pdf for the implementation.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353?QuickLink=index&overridelayout=true
Thank you
Regards,
Jaspreet Kaur

Similar Messages

  • Problem while exporting data to Excel sheet.......

    Hi
    I have written the following code to export data to excel sheet...
    data:
           conv_out TYPE REF TO cl_abap_conv_out_ce,
           content TYPE xstring.
    data : itab_slsrl type table of znslsrlitm.
    data: xml_out TYPE string.
    Data:
    Node_slsrl type ref to If_Wd_Context_Node,
    Elem_slsrl type ref to If_Wd_Context_Element,
    Stru_slsrl type ref to if_wd_context_element .
    call transformation ('ID') source tab = itab_slsrl[] result xml xml_out.
    CALL FUNCTION 'CRM_IC_XML_STRING2XSTRING'
    EXPORTING
    INSTRING = xml_out
    IMPORTING
    OUTXSTRING = content.
    conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
    DATA: lv_filename TYPE string.
    conv_out->convert( exporting data = xml_out IMPORTING buffer = content ).
    cl_wd_runtime_services=>attach_file_to_response(
    i_filename = 'Sales_order_release.xls'
    i_content = content
    i_mime_type = 'application/msexcel'
    i_in_new_window = i_in_new_window
    i_inplace = i_inplace ).
    But when i am trying to export data to excel sheet i am getting
    following error...
    "Switch from current encode to specified encoding is not supported"
    "<?xml version="1.0" encoding='utf-16"?>"
    if i change encoding utf-8 to utf-16 in my code its giving dump..
    "The conversion of certain code pages is not supported"
    Did i miss any step...?
    How to resolve this problem please help me....
    Thanks & Regards
    Sowmya.....

    Hi Sowmya,
    I do had a similar issue, but I avoided that problem temporarily by commenting the following code.
        l_conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8'  ).
    attach the first file
    l_conv_out->convert( exporting data = l_xml_out IMPORTING buffer = l_content  ).
    Once this is done, you can export the data to Excel and open it and see too...But this is a temporary solution only. Implement this solution to get to understand more flaws of this.
    Regards
    Raja Sekhar
    Edited by: Raja Sekhar on Dec 26, 2007 7:51 PM

  • Problem with Exporting Data to Excel

    Hi Everyone,
    I have problem with exporting the data to a excel file. I am using a XP
    system in German which uses comma "," as the decimal point , and I also set
    "Use localized decimal point*" under the FronPanel Options to be true. But
    the exported excel file can not recognize (or just ignore) the comma for a
    whole column (flow rate), for examle "1,234" (1.234 in non-german system)
    would be 1234. But if I open its text file where the data came
    from by calling Excel directly, there will be no problem. Is this a bug of
    LabVIEW, or I forget some settings?
    Thanks a lot!
    Le
    P.S: The LabVIEW version is 8.2.1 and the Office version is Office2007.

    Hi Le,
    Sound familiar; here in The Netherlands we have the same problem.   That is why we use the English versions for XP and Office.
    I don’t quite understand how you interface to Excel. Directly with ActiveX or through a CSV file.
    Can you explain a bit more ?

  • Problems in exporting data to Excel from WebDynpro

    Hi,
    I'm trying to transport data to Excel using the WebDynpro Binary Cache. The table data I have has certain special characters like & , < and > . I get an XML Parse error while trying to retrieve the XML List from the Binary Cache. The detailed error is Whitespace is not allowed. If table data is without these special characters Excel Export happens fine.
    Any help is highly appreciated.
    Thanks,
    Bala

    I got the same error message and find the solution (knowing that this is an old thread, but maybe in future it can helps someone)
    I've changed my TableUtilities class (getting from this excellent blog: /people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities), adding the CDATA Element
    Method: DownloadToExcel
    for (int j = 0;j<columnInfos.size();j++)
                             String attributeName = (String)columnInfos.get(j);
                             xml_file.append("<")
                                       .append(attributeName)
                                       .append(">")
                                       .append("<![CDATA[")
                                       .append(elem.getAttributeValue(attributeName))
                                       .append("]]>")
                                       .append("</")
                                       .append(attributeName)
                                       .append(">\n");
                        xml_file.append("</")
                                  .append(_nodename)
                                  .append("Element>\n");

  • 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

  • ClassNotFoundException: while exporting data into excel sheet

    Hi Experts,
    While exporting data into excel sheet below error was getting even i am created jar file DC and publicpart AND j2ee
    I have to deployed the JAR files on the server:
    1. Created "External Library DC"
    2. added my JAR files into "Libraries" folder.
    3. Exposed them as Public Part.
    4. Created "J2EE Library DC"
    5. Refered "External Library DC" into J2EE Library DC.
    6. Deployed "J2EE Library DC"
    7. and lastly refered this on my Web Dynpro DC by giving Library Reference.
    but still this is the errro was getting, plz any one can help regarding this what could be the problem
    java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook -
    Loader Info -
    ClassLoader name: [ng.com/Reuse_Export_to_Excel] Parent loader name: [Frame ClassLoader] References: common:service:http;service:servlet_jsp service:ejb common:service:iiop;service:naming;service:p4;service:ts service:jmsconnector library:jsse library:servlet common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl library:ejb20 library:j2eeca library:jms library:opensql common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore interface:resourcecontext_api interface:webservices interface:cross interface:ejbserialization sap.com/tcwddispwda sap.com/tcwdcorecomp service:webdynpro service:sld library:tcddicddicservices library:com.sap.aii.proxy.framework library:tcgraphicsigs library:com.sap.mw.jco library:com.sap.lcr.api.cimclient library:sapxmltoolkit library:com.sap.aii.util.rb library:com.sap.util.monitor.jarm library:tcddicddicruntime library:com.sap.aii.util.xml library:com.sap.aii.util.misc library:tccmi Resources: /usr/sap//JC21/j2ee/cluster/server0/apps/ng.com/Reuse_Export_to_Excel/src.zip /usr/sap//JC21/j2ee/cluster/server0/apps/ng.com/Reuse_Export_to_Excel/webdynpro/public/lib/ng.comReuse_Export_to_Excel.jar Loading model: {parent,references,local} -
    Regards,
    Varma

    closed

  • Export data into Excel from PL/SQL Block

    Hi,
    Please tell me how to export data into excel comming out from PL/SQL code in APEX.
    We can simply export data into excel if we have Report region, but my query is dynamic for which i had to use PL/SQL block. Now i want to export that data into excel.
    Thanks & Regards,
    Smith

    Hi,
    Take a look here http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    Regards
    Paul

  • Export data to Excel

    Hello All,
                I am trying to export data to Excel from a report output. Its a simple report. I have tried the below FM
    CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
    EXPORTING
      DATA_FILENAME             =
      DATA_PATH_FLAG            = 'W'
      DATA_ENVIRONMENT          =
      DATA_TABLE                =
      MACRO_FILENAME            =
      MACRO_PATH_FLAG           = 'E'
      MACRO_ENVIRONMENT         =
      WAIT                      = 'X'
      DELETE_FILE               = 'X'
    EXCEPTIONS
      NO_BATCH                  = 1
      EXCEL_NOT_INSTALLED       = 2
      INTERNAL_ERROR            = 3
      CANCELLED                 = 4
      DOWNLOAD_ERROR            = 5
      NO_AUTHORITY              = 6
      FILE_NOT_DELETED          = 7
      OTHERS                    = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    This FM when executed without passing any data is able to open an empty excel sheet but when I try to pass an internal table to DATA_TABLE  its giving a dump. The run time error is CALL_FUNCTION_CONFLICT_TYPE.
    Error:
    **"The function module interface allows you to specify only fields      
    of a particular type under "TABNAME". The field "ITAB1" specified here
    has a different field type."**
    Please let me know if Im missing something.
    Thanks in advance.

    Hi SAP,
    Simply List -> Save -> File -> spreadsheet -> file.xls
    Or check this weblog..
    <a href="/people/dennis.vandenbroek/blog/2007/02/14/simple-function-module-to-export-any-internal-table-to-ms-excel:///people/dennis.vandenbroek/blog/2007/02/14/simple-function-module-to-export-any-internal-table-to-ms-excel
    or
    try this code..
    DATA : file_name TYPE ibipparms-path,
    lc_filename TYPE string.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = ' '
    IMPORTING
    file_name = file_name .
    lc_filename = file_name.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = lc_filename
    filetype = 'DAT'
    TABLES
    data_tab = gt_itab.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Revert back for more help
    Reward points if helpful
    Regards
    Naresh

  • Export data to excel and table column headers

    I noticed that with LV 2012 when I call the method "Export Data to Excel" for a table, the table headers (= column names) are not exported to excel.
    Am I right? I think that the column names should be exported too...
    As a matter of fact when you call the method "Export to simplified image" the column names are included
    How can I export the table column names to excel?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

    In this document there is a full description of how to export data from LabVIEW to Excel.
    Using a table, the method "Export data to excel" should export the "currently selected data", and data can be programmatically selected using ActiveCell property (as described here).
    With ActiveCell I can select the column headers too (using negative numbers for row and/or column), and I do this.
    And so I expect that when I select "Export data to Excel", the column headers should be exported too (because I selected them!).
    I think that the actual behavior is a bug, rather that an expected behavior.
    Don't you agree?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

  • Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Hi Heather 349
    I believe you can do it with both FormsCentral Basic and FormsCentral PLUS
    Also Refer : Tutorial: Exporting Responses to Excel, CSV or PDF

  • How export data in Excel From Visual Composer

    Hay everybody,
    I would like to export my data result from Visual Composer to Excel. I've tried with an export data buton, but the exported file has a very bad format in Excel. I've tried an hyperlink buton which contain the Reptname data of the query too, but I can't keep my filters. This second solution can be nice for the format. If anyone knows how I can keep my filters, I would be fine.
    Thanks

    I did not get solution by using BW 3.5 , can we export data to Excel ? I am refering
    [HOW TO EXPORT DATA FROM VISUAL COMPOSER|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123?overridelayout=true] following link??

  • Export data to excel using DOI(desktop Office integration) technique

    Hi Experts,
    I have the requirement to export data to excel file, I have some idea using OLE but no idea of exporting to excel using DOI, Please help me by providing sample code for it.
    My requirement also include merging of cells and coloring of cells.
    Thanks
    Rohit

    For merging of cells you can refer following code!
    [Merging of cells.|https://www.sdn.sap.com/irj/scn/wiki?path=/display/community/oleconceptfordownloadingthereportoutputintoexcel]
    Regards,
    Lalit Mohan Gupta.

  • Export data to excel in alv

    hi everybody ,
    could you give me an example about export data to excel with no ole objects?

    You can use FM - ALV_XXL_CALL , it exports the data with formatting and column heading.
    REPORT  ZSKC_ALV_XXL.
    TYPE-POOLS : KKBLO.
    DATA : ITAB LIKE T100 OCCURS 0,
           T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
           T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
    START-OF-SELECTION.
    * Get data.
      SELECT * UP TO 20 ROWS
      FROM   T100
      INTO   TABLE ITAB
      WHERE  SPRSL = SY-LANGU.
      CHECK SY-SUBRC EQ 0.
    * Create the field catalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
          I_STRUCTURE_NAME             = 'T100'
        CHANGING
          CT_FIELDCAT                  = T_FCAT_LVC[]
        EXCEPTIONS
          INCONSISTENT_INTERFACE       = 1
          PROGRAM_ERROR                = 2
          OTHERS                       = 3.
      CHECK SY-SUBRC EQ 0.
    * make sure you pass the correct internal table name in the field catalog.
      t_fcat_lvC-tabname = 'ITAB'.
      MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
    * Transfer to KKBLO format.
      CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
        EXPORTING
          IT_FIELDCAT_LVC                 = T_FCAT_LVC[]
        IMPORTING
          ET_FIELDCAT_KKBLO               = T_FCAT_KKB
       EXCEPTIONS
         IT_DATA_MISSING                 = 1
         IT_FIELDCAT_LVC_MISSING         = 2
         OTHERS                          = 3.
      CHECK SY-SUBRC EQ 0.
    * Call XXL.
      CALL FUNCTION 'ALV_XXL_CALL'
        EXPORTING
          I_TABNAME                    = 'ITAB'
          IT_FIELDCAT                  = T_FCAT_KKB
        TABLES
          IT_OUTTAB                    = ITAB[]
        EXCEPTIONS
          FATAL_ERROR                  = 1
          NO_DISPLAY_POSSIBLE          = 2
          OTHERS                       = 3.
      IF SY-SUBRC <> 0.
      ENDIF.

  • Export data to excel from jsf

    How can I export data to excel sheet using jsf ..Any components available..
    Thanks in advance.

    There is no JSF component which does all the task, but there are enough ways to achieve this. You can use a reporting framework, such as JasperReports or BIRT. You can use a Java Excel API, such as Apache POI HSSF or Andy Khan's JExcelAPI. You can write a plain vanilla CSV or HTML TABLE file which can also be read by Excel.

  • Export data to excel scientific notation

    Hello,
    How can I export data to excel such as 9900007600000018463000, 9900007600000018473000, etc. without transforming them into scientific numbers like 9,90000760000001E+21 ?
    Thank you for your help

    Sorry that my suggestion did not work. I have experimented with excel and could not get it to retain the precision on very large numbers for any numeric formatted fields. The idea I have for you is to create a table with your big number column defined as varchar2. Copy the data from the original table into the new table "insert into bignumber_varchar_table varchar_column select bignumber_table from bignumber;". Then do the export from the new table. This will keep the data as text and then excel retains the precision. Because it is text it will be displayed left justified. Right click and choose format cell, click on alignment, and set horizontal to right if you want it to look like a number in the spread sheet. Unfortunately, if you try to do calculations with it, the calculation appears to loose the precision.

Maybe you are looking for

  • I purchased Aperture from the App Store several years ago. Now I want to install it on 10.7. How do I do that? Thanks.

    I purchased Aperture from the App Store several years ago. Now I want to install it on 10.7, but the current version requires 10.10. How can I install an older version of Aperture that will run on 10.7? Thanks

  • F110  - can specify RFFO program for bespoke SAPscript to print out

    Hi SAPer, I am working to figure out how to print out bespoke SAP script while using a Standard RFFO program.  The output is a print out form on paper. I have tried RFFOUS__C and RFFOD__T, so far, but somehow, F110 does not produce any print out at a

  • Can't connect audio or video

    Hi, I have two MacBook Pros (10.5.7) that can't connect an audio or video session. Text chatting works just fine. Both clients (iChat 4.0.8) are using AIM accounts with default settings. The log file is below. thanks - jc Date/Time: 2009-06-29 09:58:

  • Bonjour saves the day

    Please consider this an experience worth relating. First the hardware: Dell Inspiron  N5110, 6 Gig memory HP laserjet 1300 printer circa 2003 First generation Airport extreme Intel core i5 Next the software: Microsoft Windows 7, -64 bit Airport 5.7 H

  • Two dependent transactions in BDC

    Hi experts, how to process dependent transactions in BDC such as creating a request for quotation  & based on the request for quotation document processing ME21 plz send me some idea & same code.. Thank you.