Number of rows in Excel sheet

In ABAP reports, is there any logic to find number of rows in Excel sheet.
Regards,
Naseer.

Hi,
Try this code...
REPORT zreport.
PARAMETER p_infile LIKE rlgrap-filename DEFAULT 'C:TEMPZMPR.xls'.
DATA : lin TYPE i.
DATA: itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                = p_infile
      i_begin_col             = '1'
      i_begin_row             = '1'
      i_end_col               = '1'
      i_end_row               = '28000'
    TABLES
      intern                  = itab
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2
      OTHERS                  = 3.
  IF sy-subrc <> 0.
    MESSAGE text-009 TYPE 'S'. "Problem uploading Excel Spreadsheet
    EXIT.
  ENDIF.
  DESCRIBE TABLE itab LINES lin.
  WRITE :/ 'Number of lines: ', lin.

Similar Messages

  • Ignore 2nd row and 4th row in Excel Sheet in SSIS Package

    Hi All,
    I have an SSIS package that imports an Excel sheet in which i have to ignore 2nd row and 4th row.
    Please help me on this issue.

    Hi ShyamReddy,
    Based on my test, if second and fourth rows need to be skipped is based on some conditions, we can directly add where conditions in only one Excel Source with Edit Option. Otherwise, we can try to union three Excel sources to work around this issue. For
    more details, please refer to the following steps:
    Set the FirstRowHasColumnName property to False, so the first row stores the column names in the sheet.
    Drag three Excel Sources to the Data Flow Task.
    In the Excel Source, use the SQL command below to replace the former(supposing there are three columns in the Excel sheet: col1, col2 and col3):
    SELECT F1 AS col1,F2 AS col2, F3 AS col3  FROM
    [sheet$A2:C2]
    In the Excel Source 1, please type the SQL command below:
    SELECT F1 AS col1,F2 AS col2, F3 AS col3  FROM
    [sheet$A4:C4]
    In the Excel Source 2, please type the SQL command below (note that the ‘n’ means the number of rows in the sheet):
    SELECT F1 AS col1,F2 AS col2, F3 AS col3  FROM
    [sheet$A6:Cn]
    Drag a Union All component to the same task, then union those three Excel Sources.
    References:
    SSIS Excel import skip first rows
    sql command for reading a particular sheet, column
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Is there a maximum number of rows in a sheet?

    Can anyone tell me if there is any limit to the number of rows per sheet in Numbers. (Excel now has a one million row limit.) May be there is some way to string sheets together so they act as one large sheet.

    JROA wrote:
    65536??? WHY???
    Because it's 16^4, which is an integer which may be coded with four bytes.
    The step beyond would be 16^6 or 16^8.
    But, given the slowness of Numbers, I am unable to work with tables of 10000 rows.
    From my point of view, it would be foolish to build tables with 65536 rows with the current app.
    Yvan KOENIG (VALLAURIS, France) jeudi 24 décembre 2009 23:55:34

  • Colored rows in Excel sheet

    Hi all,
    Following the tutorial "Exporting context data into Excel using the WD binary cache" I could export the contents of a webdynpro table to an Excel sheet.I would like to know whether there is any provision to change the color of rows in the generated excel sheet, based on some conditions.
    Thanks n regards
    Shyam.

    Hi Shyam,
    Check this Excel data formatting
    Best regards, Maksim Rashchynski.

  • Getting the number of pages in excel sheet or current page using OLE2

    Hi,
    I fill an excel sheet using CLIENT_OLE2 from Oracle 10g form,
    I want to get the number of pages in sheet or the number of current page,
    after searching for solution I found this example on VB:
    Sub GetPageCount()
    Dim iView As Integer
    Dim iHorizontalBreaks As Integer
    Dim iVerticalBreaks As Integer
    Dim iPageCount As Integer
    On Error Resume Next
    'go to the range and set PrintArea to the range name
    Application.Goto Reference:="ABC"
    ActiveSheet.PageSetup.PrintArea = Selection.Address
    'turn monitor flickering/updating off
    Application.ScreenUpdating = False
    'remember current View setting
    iView = Application.ActiveWindow.View
    'refresh the print area
    Application.ActiveWindow.View = xlPageBreakPreview
    'set view back
    Application.ActiveWindow.View = xlNormalView
    'turn monitor flickering/updating back on
    Application.ScreenUpdating = True
    'calculate the # of pages
    iHorizontalBreaks = ActiveSheet.HPageBreaks.Count + 1
    iVerticalBreaks = ActiveSheet.VPageBreaks.Count + 1
    iPageCount = iHorizontalBreaks * iVerticalBreaks
    How can I implement this using CLIENT_OLE2?
    Any assistance would be welcome.
    Thanks

    IF all the panels were exactly the same width (highly doubtful for a roll-fold) and IF ID supported 12 pages per spread (it doesn't) then it might be less work to make 12-page spreads and place the PDF twice, but since I think there's a really good chance you'll need to adjust the positioning for at least 22 pages, that seems doomed.
    I wouldn't even bother, in this case, with facing pages. Presumably they want this for the screen, so there's nothing gained from facing pages or multiple columns. You can either make the file with 24 pages and place the PDF 12 times for each page of the PDF, or place each page of the PDF once in a 2-page file, then copy the pages and reposition the image in the frame for each panel. The big thing here is to put the PDF into frames that are the same size as the new page (so they get cropped down to one-panel on each page). Then it's just a case of sliding the the PDF left or right in the frame to expose the next panel.

  • Program Will Not Read First Row in Excel Sheet

    I am having difficulty getting my program to read the first row of my excel sheet. When I use the next() method the first time it automatically starts at the second row. Here is what I have for my method that reads the data from an excel file.
    package excel;
    import java.sql.*;
    public class Excel
         public void readexel(String filename) throws SQLException
              Connection c = null;
              Statement stmnt = null;
              try
                   Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
                   c = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=" + filename);
                   stmnt = c.createStatement();
                   String query = "Select * from [Sheet1$]" ;
                   ResultSet rs = stmnt.executeQuery( query );
                   while( rs.next() )
                        System.out.print("Row #" + rs.getRow() + ": ");
                        System.out.print( rs.getInt(1) + " " );
                        System.out.print( rs.getInt(2) + " ");
                        System.out.println( rs.getInt(3) );
              catch( Exception e )
                   System.err.println( e );
         }

    Thats because the first row typically contains the column headers, and you don't want them read as data. Either insert a blank row, or put in column labels, and than you can get the column labels/names from the ResultSetMetaData.
    Message was edited by:
    SomeoneElse

  • Not able to download all the rows to excel sheet from alv grid display

    Hi experts,
    I am not able to download all the rows which are displayed in alv grid display for some material numbers.
    for some materials i am able to download, i used two ways to download 1) from icon(local file) on grid 2) menu list->export.
    i checked in debugging till selecting the spread sheet pop up window, i am able to see all the data in internal table.
    Can you suggest me what will be the problem....
    thanks in advance,

    hi sandeep,
    sorry for didnt specify clearly.
    note: EX: "asaasdada  in this sentence i said  " this symbol is special character not the text.
    building final internal table code
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          capid                 = p_capid
          datuv                 = sy-datum
          ehndl                 = '1'
          mktls                 = 'X'
          mehrs                 = 'X'
          mmory                 = '1'
          mtnrv                 = p_matnr
          stlal                 = '1'
          stpst                 = 0
          svwvo                 = 'X'
          werks                 = p_werks
          vrsvo                 = 'X'
        TABLES
          stb                   = i_stb
        EXCEPTIONS
          alt_not_found         = 1
          call_invalid          = 2
          material_not_found    = 3
          missing_authorization = 4
          no_bom_found          = 5
          no_plant_data         = 6
          no_suitable_bom_found = 7
          conversion_error      = 8
          OTHERS                = 9.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      i_stb1[] = i_stb[].
      IF NOT i_stb1[] IS INITIAL.
        SORT i_stb1 BY idnrk.
        DELETE ADJACENT DUPLICATES FROM i_stb1 COMPARING idnrk.
        SELECT bmatn ematn FROM ampl INTO TABLE i_ampl
          FOR ALL ENTRIES IN i_stb1
          WHERE bmatn = i_stb1-idnrk AND
                datuv LE sy-datum AND                          
                datub GE sy-datum.                              
        SELECT
        matnr
        bwkey
        verpr
        stprs
        bwprh
        FROM mbew
        INTO TABLE i_mbew
        FOR ALL ENTRIES IN i_stb1
        WHERE
            matnr EQ i_stb1-idnrk AND
            bwkey EQ i_stb1-werks.
        IF NOT i_stb1[] IS INITIAL.
          SELECT matnr werks beskz
                 dzeit webaz plifz                              
                 ekgrp                                         
          INTO TABLE i_marc
          FROM marc
          FOR ALL ENTRIES IN i_stb1
          WHERE matnr = i_stb1-idnrk
          AND werks = i_stb1-werks.
          SORT i_marc BY matnr werks.
        ENDIF.
        CLEAR i_ekpo.
        CLEAR i_vend.
        IF NOT i_stb1[] IS INITIAL.
          SELECT ebeln ebelp matnr werks loekz aedat
                 netpr peinh                                   
          INTO TABLE i_ekpo
          FROM ekpo
                FOR ALL ENTRIES IN i_stb1
                WHERE matnr = i_stb1-idnrk
                AND werks = i_stb1-werks.
          SORT i_ekpo BY matnr ASCENDING
                         aedat DESCENDING
                         ebeln DESCENDING
                         ebelp DESCENDING.
          IF NOT i_ekpo IS INITIAL.
            SELECT k~ebeln k~lifnr l~name1
            INTO TABLE i_vend
            FROM ekko AS k INNER JOIN lfa1 AS l
            ON k~lifnr EQ l~lifnr
            FOR ALL ENTRIES IN i_ekpo
            WHERE ebeln = i_ekpo-ebeln.
            SORT i_vend BY ebeln.
          ENDIF.
        ENDIF.
      ENDIF.
      i_ampl1[] = i_ampl[].
      IF NOT i_ampl1[] IS INITIAL.
        SORT i_ampl1 BY ematn.
        DELETE ADJACENT DUPLICATES FROM i_ampl1 COMPARING ematn.
        SELECT matnr mfrpn mfrnr FROM mara INTO TABLE i_mara
          FOR ALL ENTRIES IN i_ampl1
           WHERE matnr = i_ampl1-ematn.
      ENDIF.
      SORT i_ampl BY bmatn.
      IF NOT i_stb[] IS INITIAL.
        SELECT stlty stlnr stlkn stpoz idnrk potx1 potx2
        INTO TABLE i_stpo
        FROM stpo
        FOR ALL ENTRIES IN i_stb
        WHERE stlty = i_stb-stlty
          AND stlnr = i_stb-stlnr
          AND stlkn = i_stb-stlkn
          AND stpoz = i_stb-stpoz
          AND idnrk = i_stb-idnrk.
        SORT i_stpo BY stlty stlnr stlkn stpoz idnrk.
      ENDIF.
      LOOP AT i_stb INTO wa_stb.
        READ TABLE i_marc INTO wa_marc
        WITH KEY     matnr = wa_stb-idnrk
                     werks = wa_stb-werks
                     BINARY SEARCH.
        IF sy-subrc = 0.
          wa_outtab-beskz = wa_marc-beskz.
          wa_outtab-dzeit = wa_marc-dzeit.                      
          wa_outtab-webaz = wa_marc-webaz.                     
          wa_outtab-plifz = wa_marc-plifz.                     
          wa_outtab-ekgrp = wa_marc-ekgrp.                     
        ENDIF.
        READ TABLE i_ekpo INTO wa_ekpo
            WITH KEY matnr = wa_stb-idnrk.
        IF sy-subrc = 0.
          wa_outtab-netpr = wa_ekpo-netpr.                     
          wa_outtab-peinh = wa_ekpo-peinh.                     
          READ TABLE i_vend INTO wa_vend
          WITH KEY ebeln = wa_ekpo-ebeln
                   BINARY SEARCH.
          IF sy-subrc = 0.
            wa_outtab-lifnr = wa_vend-lifnr.
            wa_outtab-name_sup = wa_vend-name1.
          ENDIF.
        ENDIF.
        READ TABLE i_stpo INTO wa_stpo
        WITH KEY stlty = wa_stb-stlty
                 stlnr = wa_stb-stlnr
                 stlkn = wa_stb-stlkn
                 stpoz = wa_stb-stpoz
                 idnrk = wa_stb-idnrk
                 BINARY SEARCH.
        IF sy-subrc = 0.
          wa_outtab-potx1 = wa_stpo-potx1.
          wa_outtab-potx2 = wa_stpo-potx2.
        ENDIF.
        READ TABLE i_mbew INTO wa_mbew
        WITH KEY
        matnr = wa_stb-idnrk
        bwkey = wa_stb-werks.
        IF sy-subrc IS INITIAL.
          MOVE:
          wa_mbew-verpr TO wa_outtab-verpr,
          wa_mbew-stprs TO wa_outtab-stprs,
          wa_mbew-bwprh TO wa_outtab-bwprh.
        ENDIF.
        wa_outtab-matnr = p_matnr.
        wa_outtab-posnr = wa_stb-posnr.
        wa_outtab-stufe = wa_stb-stufe.
        wa_outtab-idnrk = wa_stb-idnrk.
        wa_outtab-ojtxb = wa_stb-ojtxp.
        wa_outtab-menge = wa_stb-menge.
        wa_outtab-meins = wa_stb-meins.
        MOVE: wa_stb-zzitem_draw_no TO wa_outtab-zzitem_draw_no.
        IF wa_stb-upskz = 'X'.
          SELECT * FROM stpu INTO TABLE i_stpu
                   WHERE  stlty = wa_stb-stlty AND
                          stlnr = wa_stb-stlnr AND
                          stlkn = wa_stb-stlkn AND
                          stpoz = wa_stb-stpoz.
        ENDIF.
        LOOP AT i_stpu INTO wa_stpu.
          wa_outtab-upmng = wa_stpu-upmng.
          wa_outtab-ebort = wa_stpu-ebort.
          wa_outtab-uposz = wa_stpu-uposz.
          CONCATENATE v_ebort wa_stpu-ebort      INTO v_ebort
          SEPARATED BY space.
        ENDLOOP.
        MOVE strlen( v_ebort ) TO v_len.
        MOVE: 0 TO x,
          128 TO y.
        DATA : lt_tab TYPE TABLE OF swastrtab.
        DATA : ls_tab LIKE LINE OF lt_tab.
        DATA : lv_ebort TYPE string.
        CLEAR lv_ebort. CLEAR lt_tab.
        MOVE v_ebort TO lv_ebort.
        CALL FUNCTION 'SWA_STRING_SPLIT'
          EXPORTING
            input_string                 = lv_ebort
            max_component_length         = 128
          TABLES
            string_components            = lt_tab
          EXCEPTIONS
            max_component_length_invalid = 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.
        IF lt_tab[] IS NOT INITIAL.
          LOOP AT lt_tab INTO ls_tab.
            CLEAR lv_ebort.
            MOVE: ls_tab-str TO lv_ebort.
            CONDENSE lv_ebort.
            MOVE lv_ebort TO wa_outtab-ebort.
            APPEND wa_outtab TO i_outtab.
            CLEAR:
            wa_outtab-matnr,
            wa_outtab-posnr,
            wa_outtab-zzitem_draw_no,
            wa_outtab-ojtxb,
            wa_outtab-menge,
            wa_outtab-meins,
            wa_outtab-uposz,
            wa_outtab-upmng,
            wa_outtab-verpr,
            wa_outtab-stprs,
            wa_outtab-bwprh,
            wa_outtab-lifnr,
            wa_outtab-name_sup,
            wa_outtab-potx1,
            wa_outtab-potx2,
            wa_outtab-netpr,
            wa_outtab-peinh.
    *        wa_outtab-idnrk.
          ENDLOOP.
        ELSE.
          APPEND wa_outtab TO i_outtab.
        ENDIF.
        CLEAR v_ebort.
        CLEAR: wa_stpu.
        REFRESH: i_stpu.
        LOOP AT i_ampl INTO wa_ampl WHERE bmatn = wa_stb-idnrk.
        READ TABLE i_mara INTO wa_mara WITH TABLE KEY matnr = wa_ampl-ematn.
          IF sy-subrc = 0.
            LOOP AT i_outtab INTO wa_outtab
            WHERE
            idnrk = wa_stb-idnrk AND
            flag NE 'X'.
              wa_outtab-mfrpn = wa_mara-mfrpn.
              wa_outtab-mfrnr = wa_mara-mfrnr.
              SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
              MOVE 'X' TO wa_outtab-flag.
              MODIFY i_outtab FROM wa_outtab
              TRANSPORTING mfrpn mfrnr name1 flag.
              EXIT.
            ENDLOOP.
            IF sy-subrc <> 0.
              CLEAR:
              wa_outtab-matnr,
              wa_outtab-posnr,
              wa_outtab-zzitem_draw_no,
              wa_outtab-ojtxb,
              wa_outtab-ebort,
    *          wa_outtab-idnrk,
              wa_outtab-menge,
              wa_outtab-meins,
              wa_outtab-uposz,
              wa_outtab-upmng,
              wa_outtab-verpr,
              wa_outtab-stprs,
              wa_outtab-bwprh,
              wa_outtab-lifnr,                                 
              wa_outtab-name_sup,                              
              wa_outtab-potx1,                                 
              wa_outtab-potx2,                                 
              wa_outtab-netpr,                                 
              wa_outtab-peinh.                                 
              wa_outtab-mfrpn = wa_mara-mfrpn.
              wa_outtab-mfrnr = wa_mara-mfrnr.
              SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
              APPEND wa_outtab TO i_outtab.
            ENDIF.
          ENDIF.
          REFRESH i_stpu.
          CLEAR i_stpu.
        ENDLOOP.    CLEAR: wa_matnr1, wa_mfrnr, wa_outtab.
      ENDLOOP.
    Edited by: srinivasareddy j on Mar 9, 2011 7:16 AM
    Edited by: srinivasareddy j on Mar 9, 2011 7:20 AM

  • How to increase the number of rows for Entry via Excel in SSM ?

    hello
    we are facing a scenario where we need to enter the target data for more than 14000 fields.So when we open the excel ad in and trying to upload, it is accepting data for only 500 fields and the rest are not getting displayed.
    The condition is that we have to enter data via Entry and Approval and not using a procedure and multiple metric sets is not a feasible option since the number of records is large. How can the number of rows in excel be increased ?
    Vijay

    Hi Bob
    I am facing another problem....
    we have designed our model in such a way that we built it using normal procedures but the target values have to be entered using entry and Approval via Excel ad-in..
    the problem we are facing is that if we select both the actual and the target measures to load the data via Excel login then the column TARGET is getting greyed out. When we build the same model using cube builder , the column TARGET is not getting greyed out and we are able to enter data there.
    Is there any setting changes we need to make inorder to make the Entry and Approval process via Excel behave the same way when the model is built using the Cube builder ? Are there any new notes or a newer version of Excel ad in to resolve this ?
    Vijay

  • Downloading table data into Excel sheet - Webdynpro Java

    Hi All,
    We have developed a custom webdynpro application that executes an RFC and displays data in Table UI element. We have provided a button to download the data in excel sheet. When data is huge like, total number of rows filled up in the table are around 11,000 & columns are 32, and when user tries to download whole 11000 rows in excel sheet, the timeout occurs after 20 mins due to huge data. But when I apply filtering on the same table data and then try to download some 700 rows out of 11000 into excel, it took me around 3.36 mins.
    If anyone encountered such scenario in past, please guide in this regard to speed-up the download to excel functionality or suggest any other alternative.
    We are using 7.3 Portal and tableUtilities java class for export to excel functionality.
    Thanks,
    Amol.

    hi monica ,
    sorry im not able to understand properly ,
    The server don't restarts automatically when we uploading a huge data, onlly we open the file instead of save the file.
    If we save the file the problem is that when we try to open this, the process can take hours and sometimes excel is blocked
    you mean that after saving the file to your desktop , having huge data you are not able to open the file i.e the excel file. your file gets blocked or consumes more time to open the file ,
    or else when you are prompted for saving or opening , on click of opening  you are facing the problem ?
    let me be clear with your part , here your application deals with uploading the data from webdynpro table to excel sheet and allowing the end user to save or open the file  right .
    Regards
    Govardan Raj S

  • Regarding ssis - skip first 10 rows in excel source

    Hi,
       I have received an Excel Source file, but the first 10 rows have only company information; actual data starts from Row 11.  How will you skip the first 10 rows and start reading from row 11

    Hi Koteswararao,
    If the first row includes the column names, and the first 10 rows you said don’t include the first row. That means you want to skip the rows from 2 row to 10 row, then we can union two Excel sources to work around this issue. For more details, please refer
    to the following steps:
    Set the FirstRowHasColumnName property of the Excel Connection Manager to False, so the first row stores the column names in the sheet.
    Drag two Excel Sources to the Data Flow Task.
    In the Excel Source, use the SQL command below to replace the former(supposing there are three columns in the Excel sheet: col1, col2 and col3):
    SELECT F1 AS col1,F2 AS col2, F3 AS col3  FROM
    [sheet$A1:C1]
    In the Excel Source 1, please type the SQL command below (note that the ‘n’ means the number of rows in the sheet):
    SELECT F1 AS col1,F2 AS col2, F3 AS col3  FROM
    [sheet$A11:Cn]
    Drag a Union All component to the same task, then union those two Excel Sources.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Output transport to excel sheet

    Dear Friends,
    One problem facing in SD report.
    Report contain 61 column in ALV.
    At runtime it will fetch 30000 to 32000 rows.
    When i convert this report into excel format.
    It will store data in excel sheet with one line blank between
    two record.
    Means, If i have 30000 records then it will store 60000
    rows in excel sheet.
    It will leave one blank line after every record.
    Now problem is, if i have more then 32500  then it will not feet into excel sheet, because capacity of excel is 65000 rows.
    So, please provide me some solution.
    Regards,
    Nilay

    Hi Nilay,
    If it is Zreport then u can make the changes to the code. Delete all the blank rows from internal table that is being downloaded.
    If it is standard report then u can copy to Zreport and make the above change.
    Even in this case also at max u can download 65k+ records.
    If it is more than that then u have to split ur itab into multiple itabs and then By using OLE concepts u can download to multiple sheets of same excel.
    Thanks,
    Vinod.

  • Download into excel sheet

    Hi All,
    In a ALV report, i would like to donwload the final internal table into an excel sheet.
    The requirement is that the data should be filled from 8th row of excel sheet.
    I am using GUI_DOWNLOAD and it makes the data to dump from first line of excel sheet itself.
    How to incorprate the logic for these requirements?
    Your help will be sincerely appreciated.
    Thanks in Advance,
    Pavan
    Edited by: Pavan Sanganal on Dec 16, 2008 10:51 AM

    Hello Pavan,
    I think you have written a separate sub-routine for this. Use another internal table IT_XLS which has a similar structure as the int. table for ALV display (IT_ALV, say).
    Now try this piece of code:
    DO 8 TIMES.
      APPEND WA_XLS TO IT_XLS. "Populate 8 blank rows in the table
    ENDDO.
    LOOP AT IT_ALV INTO WA_ALV.
      WA_XLS = WA_ALV.
      APPEND WA_XLS TO IT_XLS.
      CLEAR WA_XLS.
    ENDLOOP.
    Use GUI_DOWNLOAD to download IT_XLS. Can you please tell what do you want to populate in these 8 blank rows?
    BR,
    Suhas

  • Problem when opening excel sheet in jsp

    Hi friends
    When i try to open excel sheet from my program I am getting two problems
    1. first row of excel sheet is empty
    2. while opening I am getting error message of "the file is not in a recognizable format"
    Please help me..It is an urgent work
    my code
    <%@page language="java" import="java.io.*,java.text.*,java.sql.*,java.util.*"%>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:mysql://256.136.119.86/mydb","zzz","zzz");
    Statement st = conn.createStatement();
    StringBuffer sb = new StringBuffer();
    sb.append("SAP#" + "\t");
    sb.append("x-plant status" + "\t");
    sb.append("Total Amount" +"\t");
    sb.append(">90 days" + "\t");
    sb.append("\n");
    try
    String query="select * from temp_Xplant";
    ResultSet rs = st.executeQuery(query);
    while(rs.next()){
    sb.append(rs.getString("sapNo") + "\t");
    sb.append(rs.getString("status")+ "\t");
    sb.append(rs.getString("amt") + "\t");
    sb.append(rs.getString("days") + "\t");
    sb.append("\n");
    conn.close();
    st.close();
    catch (Exception e)
    out.println("error");
    conn.close();
    st.close();
    response.setContentType("application/vnd.ms-excel");
    // response.setHeader("Content-Disposition", "attachment; filename=\"test.xls\"");
    String testt = "tests.xls";
    response.setHeader("Content-Disposition", "attachment; filename="+testt);
    out.println(sb.toString());
    out.close();
    %>
    thanks in advance

    The problem here is, you have setted the content type as excel sheet and you are writing some String content into the output stream. when excel tries to read the String content it will surely throw some error. Lot of excel APIs are available in the market to generate excel sheets.
    you can find one in the below URL.
    http://www.teamdev.com/downloads/jexcel/docs/JExcel-PGuide.html

  • How to insert 2-D array of elements in excel sheet

    I have a 2-D array of elements. I want to insert this array into an excel sheet and display the data in a graph. I used the example "excel insert table" but the problem with that VI is, it is inserting the elements cell by cell which is taking long time. I am wondering whether there is way to insert a complete column or row into excel sheet at a time.
    Thank you,
    Mudda.

    Hi,
    Try this vi which inserts the table in one operation. You can modify it to suit your purposes.
    Hope this helps.
    Edit: Should note that it works for both string and numeric array inputs.Message Edited by DavidT on 06-29-2005 10:09 AM
    Attachments:
    Excel Insert Table (LV7.1).vi ‏100 KB

  • Pasting data from Excel sheet to Table in web dynpro View

    Hii All,
    Is it possible to copy data ( some rows) from Excel sheet and paste in table in a view?
    I tried doing this, but only first element is getting pasted..
    Does anybody know how to do this?
    Is there any way to perform similar thing?
    Pls help.
    regards,
    Amey

    Hi,
    Copy paste may work if you have that many rows in your table(not sure).
    One thing you can do is upload the excel and then populate the context of the node bound to the table by fetching data from the excel
    For this you can make use of JXL or APACHE POI.
    Regards
    Ayyapparaj

Maybe you are looking for