Download to Excel returning no data in the excel sheet

Hi All,
            I have used UI elements guide to create Download to Excel link in my application. I wrote following code in wdDoInit()
IWDResource resource = WDResourceFactory.createResource(new
byte[<number of bytes>], "<name of the file>",
WDWebResourceType.<type of the file>);
wdContext.currentUiResourceElement().setResource(resource);
But when I click on the link in the application, I am getting the downloaded file without records.  However I am getting a character conversion window showing option to which unicode convertion i need to convert to display data.
Looks like I am missing some things. Please help me .
Thanks
Uday
Edited by: Uday Kumar Kanike on Mar 9, 2012 6:51 AM

Hi Uday,
Refer the below blog:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0cc41cb-9576-2b10-99a6-ab90ef28c73b?QuickLink=index&overridelayout=true&33779917806370
Hope this will be helpful to you.
Regards,
Jithin

Similar Messages

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • Getting error while uploading data  using the EXCEL( GUI_upload)

    Dear Freinds,
    I am uploading data from my excel sheet to my Custom table . I am using the below code
    call function 'GUI_UPLOAD'
    exporting
    filename = l_fn
    filetype = 'BIN' "'ASC'
    has_field_separator = 'X'
    tables
    data_tab = p_i_ins_db
    exceptions
    others = 17.
    i can see in my internal P_i_ins_db ...all the data is coming in encrypted format.
    The flat given to me is the .CSV file .
    Could any one please let me know how i can upload the data which is there in .csv file.
    regards
    syamala

    Hi Syamala,
    Before using the GUI_UPLOAD to upload the data from the excel file to the internal table,you can try usng the Function Module 'SAP_CONVERT_TO_TEX_FORMAT' or 'SAP_CONVERT_TO_CSV_FORMAT' as it helps n formatting the data.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • How do read the data of the excel file line by line to the waveform?

    hello:
          i am a beginner.so i hope that  you can give me a small example。the data of the excel  file i
     have given out.
    looking for your replys!!!
    Solved!
    Go to Solution.
    Attachments:
    数据.xls ‏14 KB

    try this. best of luck
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.
    Attachments:
    Read column.zip ‏26 KB

  • Exporting PDF document to Excel.  When I export a PDF document to Excel containing lists of  people the Excel page shows all the names on  one line several inches deep instead of on separate lines which makes editing impossible.  What am I doing wrong?

    Exporting PDF document to Excel.  When I export a PDF document to Excel containing lists of  people the Excel page shows all the names on  one line several inches deep instead of on separate lines which makes editing impossible.  What am I doing wrong?

    Murray is right. Padding (and margins) is added to the width. However, when using percentages, you should never use figures that add up to exactly 100%.
    Browsers need to convert the percentages to pixels. Because pixels must be whole numbers, some percentages are rounded up, which results in the final element dropping down below its neighbours. With percentages, it's much safer to use values that add up to 98% (99% often works, but 98% is safer).

  • How to modify data in the excel sheet.

    Hi,
    I have a requirement like ,
    i have a excel file which contains only one column (all the data in the single colume )so now i have to modify that excel sheet and have to make some more columns based on my requirement.
    eg:
    column1
    mumbaikolkata
    delhichennai
    mumbaikolkata
    this shud be converted like this
    column1     column2
    mumbai      kolkata
    delhi           chennai
    mumbai      kolkata
    can i directly modify the excel sheet based on my requirement without using internal tables in between.
    like excel ->internal table-> modified internaltable-> excel.
    Edited by: Sravani Bellana on Dec 18, 2008 5:46 AM

    Hi sravani,
    true that we need to specify the rows and columns,
    I have worked on such applications i shall describe the possibilities and then you can find the necessary option,
    1)  Function module:SAP_CONVERT_TO_XLS_FORMAT .
    it needs
    file path p_file type rlgrap-filename and
    i_tab_sap_data  (the internal table name).
    2)  Function module : MS_EXCEL_OLE_STANDARD_DAT
    it needs
    file path p_file like RLGRAP-FILENAME
    data_tab (int_data "internal table with data)
    fieldnames (int_head "internal table with header)
    3) if the download application is a one time then go for the following option:
    write the program to display the data in the internal table on the screen.
    execute the program.
    type %pc on the command bar and try downloading using the options displayed.
    hope any one of these work out.
    get back if you till have any clarificatrion
    thanks
    srikanth

  • Check if num of records returned in report exceed the excel row limit?

    I developed a custom oracle report (6i - rdf). Created a template using BI, loaded the xml output and I can preview the output nicely in pdf/excel format through template.
    I register the report in conc program and do all the setup for this report. create data definition and template in xml pub . run it from con programs and it gives a neat output in pdf. I want to see the output in excel format, so I change the options before running the report and select format as excel and then run the report. somehow I get this error :
    REP-3000: Internal error starting Oracle Toolkit.
    How can I check if the number of rows returned by the report is not exceeding the nmber of rows in excel ?
    Thanks

    can you truncate the data in query result set?
    Note:
    This limitation is there in Office 2003 and below.
    Office 2007 ++ , this is not an issue.

  • Exporting Crystal Report data to the Excel Print Headers

    Hello everyone.  I am trying to do something with Excel headers that is a little more advanced than the usual.  I have multiple reports that are designed to export to Excel.  Normally I only export a report header.  However, I have a customer who wants a label to appear in each page header and footer in Excel. Here is the catch - they want the label to appear in the Excel print header and footer, not just on the main excel page.  The label contains an SBU marking, so there is a requirement that it gets printed on every page.
    If you are not familiar with the print header, it is a separate section of an Excel document that appears when you print the excel document.  For this operation, I don't think I can use the built-in Crystal Export options.  I have tried to Export to Microsoft Excel and I can send the page header and footer to the Excel data sheet, but not to the print header/footer. 
    Thanks for your help!
      - David

    Hi David,
    I haven't worked with Excel's headers and footers but you are correct that Crystal can't export to those sections.  I have though had to make modifications to an Excel file after exporting and I believe you will need to do something similar to what I did.
    After I exported the report to Excel, I had a program I wrote that opened the Excel file and modified it.  In my case I just had to encrypt it, zip it up and email it.  You may need to do something as well outside of Crystal and Excel.  Crystal doesn't export to an Excel template so automating it in Excel wouldn't work.
    Good luck,
    Brian

  • How to create a form which has browse option ? Then how to upload the data from the excel file to table in Oracle DB?

    Hi Everyone,
    I am new to Oracle forms. I have a requirement where user wants a form which can be used to browse a excel file from his/her system. Also after browsing the file the user should be able to load the data from the file to a table in the Oracle DB.
    Any help pointers would be appreciated.
    Thanks,
    Satya
    Message was edited by: user12098633

    Hi Marcus,
    I am using EBS (E- Business Suite) ERP and version is 11.5.10.2
    My database version is as below
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE
    11.2.0.3.0
    Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    I want to move csv file via EBS only. Average size of this will be max 600-700 bytes.
    Program should be in pl/sql package or concurrent program or custom .fmb (d2k forms) or custom .rdf (d2k report) or through alert. I am not using samba.

  • How to export the table data to the excel?

    Hi,
    I'm new to WebDynpro. im having a table 5rows and 6 columns, i need the data in the table to be exported to excel sheet by clicking on a button.
    As i went through some of the blogs and tutorials i couldn't understand the procedure, so could any one help out with detailed procedure.
    Thanks & Regards,
      Suresh

    HI! Suresh,
      This is a littile bit complicated process.Here i am trying to expalin the procedure,
    if you are having any problem then let me know.
    Following are the steps:--
    1.create two controls one of type linkToAction and other of type FileDownload and a location on your portal server say it's "/server0/temp/webdynpro/web/local/testexcel.xls"
    2.create a method in your view or controller and call this method as downLoadToXls()
    3.create a Value attribute of type binary in your context,say it's dataContent.
    4.Bind your linkToAction Control to the method downLoadToXls() and control   FileDownLoad data property to dataContent.
    5.In the init() Hook methos write the following code:--
    IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("dataContent");
    IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)  attInfo.getModifiableSimpleType();
    // In addition the FileDownload UI element needs for defined resource types
    binaryType.setFileName("testexcel.xls");
    binaryType.setMimeType(WDWebResourceType.XLS);
    6.in DownLoadToXls() method add the following code:--
    try {
            out = new FileOutputStream(path);
           workBook = new HSSFWorkbook();
          hsSheet = workBook.createSheet("UserID");
         cs = workBook.createCellStyle();
         cs1 = workBook.createCellStyle();
         cs2 = workBook.createCellStyle();
         dataFormat = workBook.createDataFormat();
         f = workBook.createFont();
         f1 = workBook.createFont();
         f.setFontHeightInPoints((short) 12);
        //make it blue
         f.setColor( (short)HSSFFont.COLOR_NORMAL );
         //make it bold
        //arial is the default font
        f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
        //set font 2 to 10 point type
        f1.setFontHeightInPoints((short) 10);
        //make it red
        f1.setColor( (short)HSSFFont.COLOR_RED);
        //make it bold
        f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
        f1.setStrikeout(false);
       cs.setFont(f);
       cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
       //set a thick border
       cs2.setBorderBottom(cs2.BORDER_THICK);
       //fill w fg fill color
       cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
       cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
       //set the cell format to text see HSSFDataFormat for a full list
       cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
       cs2.setFont(f1);
       cs2.setLocked(true);
        cs2.setWrapText(true);
        hsSheet.createFreezePane(0,1,1,1);
        row = hsSheet.createRow(0);
         cell = row.createCell((short)0 ,0);
          cell.setCellValue("User ID");
          cell.setCellStyle(cs2);
          cell = row.createCell((short)1 ,1);
          cell.setCellValue("Last Changed Password Date");
          cell.setCellStyle(cs2);
        int nodeSize = wdContext.nodeUserIDAndPass().size();
        for(int jCount=0; jCount < nodeSize; jCount++) {
         row = hsSheet.createRow(jCount+1);
           for(int count = 0; count < 2; count++) {
          if(count == 0) {
         cell = row.createCell((short)0,count);               
    cell.setCellValue(wdContext.nodeUserIDAndPass().getUserIDAndPassElementAt(jCount).getCtx_UserID());
          if(count == 1) {
            cell = row.createCell((short)1,count);
      cell.setCellValue(wdContext.nodeUserIDAndPass().getUserIDAndPassElementAt(jCount).getCtx_ChangedPasswd());
          cell.setCellStyle(cs2);                            
                                                               workBook.write(out);
    out.close();
    //Read the file that was created.
            FileInputStream fin = new FileInputStream(path);
            byte b[] = new byte[fin.available()];
           fin.read(b,0,b.length);
           fin.close();
            wdContext.currentContextElement().setDataContent(b);
      }catch(Exception e)     {
      wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);                   }
    7. Add the follwoing constant at the end:--
    private FileOutputStream out = null;
         private HSSFWorkbook workBook = null;
         private HSSFSheet hsSheet = null;
         private HSSFRow row = null;
         private HSSFCell cell = null;
         private HSSFCellStyle cs = null;
         private HSSFCellStyle cs1 = null;
         private HSSFCellStyle cs2 = null;
         private HSSFDataFormat dataFormat = null;
         private HSSFFont f = null;
         private HSSFFont f1 = null;
         private String path = "/server0/temp/webdynpro/web/local/testexcel.xls";
    8.Add the follwowing jars in your classPath.
    1)poi-3.0.1-FINAL-20070705.jar
    2)jxls.jar
    regards,
    Mithileshwar

  • Time Stamp problem while writing data into the excel file

    Hii, All
                  I am taking the data from the DAQ card of the TOPSCCC with the 8 ms of scanrate for each channel and there are total 16 no of Analog channels in the Card, now i am acquiring the data from the card, time stamping it and writing it into the excel file, which is tab delimited, now the problem is, the data which are in the excel file have the same timestamp for 4 to 5 continuous records, instead we want each data with the different and continuous time stamp with same difference of time stamp between two records, mean if it is difference of 8 ms then it should be the 8 ms for all, but here it is taking the differnce of 16 ms for two samples and giving same time stamp for four to five records and that shouldn't happen, here i am attaching my vi, drivers for the cards and Excel file with the data, can you please give me any suggestion how to do it?
           Please help me i require this suggestion as early as possible, i am requiring it urgently.
    Thanks in Advance,
    Nishant
    Attachments:
    2026vi.llb ‏319 KB
    2026_ScanMultAD_Demo_time.vi ‏80 KB
    Data.xls ‏357 KB

    Hello Nishant,
    that's what I meant:
    Message Edited by GerdW on 05-16-2006 10:32 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    timestamp-array.png ‏2 KB

  • How to extract data from the XL sheet for mapping

    Hello all,
    I have a scenario of file to idoc, where in the source file contains the information in XL sheet. Can we access the XL sheet data for mapping ? if so can anyone helpme providing the procedure.

    Hi,
    For reading an XL file u need to write an java code.
    refer the below weblog for more help:
    SAP Network Blog: XI: Generating Excel files without the Java nor the Conversion agent not possible?
    /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
    SAP Network Blog: Read Excel instead of XML through FileAdapter
    /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
    Thnx
    Chirag

  • ALV Excel View - how to save the excel sheet

    Hi,
    i've a colored ALV, when the user is choosing the excel button from the ALV menu bar the alv is shown as an excel. But: the sace button in the upper left corner has now a mouse-over text named "update" and the file tab is missing.- So how can he save this now as an excel sheet? We are using excel 2010. Saving as spreadsheet is not an option cause all colors are lost.

    We have had this same issue since we upgraded to EXCEL-10.
    Here is what I came up with.
    First, open a new EXCEL spreadsheet from the PC (not from within the SAP application)
    Select the “Customize Quick Access Toolbar”, then select “More Commands”
    Under the “Popular Commands” select “Save As” and press the “Add” button.
    Then the “OK” button
    You should now see the “Save As” button in the upper left hand corner of the screen (with the Save, Undo and Redo buttons.)
    When you display the next SAP report as EXCEL, you should have access to this button.

  • Downloading problem::getting only partial data from the net, why ??

    hi
    i am trying to download a file using the code
    InputStream getStream(){
    try {
    URL url = new URL("http://www.etc..");
    URLConncection urlconn= url.openConnection();
    InputStream in =urlconn.getInputStream();
    return in;
    }catch(MalformedURLException ){...}
    catch(IOException ioe){...}
    the problem is it is not getting the complete data.
    i tried to download a file which is 46k but it got only 1.3k
    can any one tell what to add or modify the above code so that i will be getting the complete data
    thanks in advance
    have a nice time
    krishna
    email id:[email protected]

    Try to set the request property and usecaches like
    this:
    con.setUseCaches(false);
    con.setRequestProperty ("Content-Type",
    "application/octet-stream")
    not working, i tried to download 46663 bytes got only 1369 bytes,please suggest me another solution.
    thanks in advance
    krishna

  • 0HR_PT_2 returns no data if the actual time is zero

    If an employee is absent, e.g. because of vacation or training days, the extractor returns a daily balance of -7 or -8 hours, depending on the individual regular working hours.
    If the absence is booked afterwards the extractor does not return the correction for the day that has been already extracted to SAP BW. (full load mode)
    Therefore, the absense of -7 or -8 hours persist in SAP BW.
    Is that behaviour correct?
    If the delta mode is used, is the behaviour the same oder is it different?
    Thanks for your support.

    I would like to discribe the situation again. If an employee is unexpectedly absent. The extractor 0HR_PT_2 delivers -8 hours absence time for the employee. If the reason for absence is illness or vacation, the reason for absence is manually "entered" later. In this situation the -8 hours absence time goes back to zero. But, this change is not be delivered by the 0HR_PT_2 extractor. Neither in full mode nor in delta mode.
    To test this specific case we switched the load mode to delta, but the extractor delivered zero records last two days.

Maybe you are looking for