Create Excel sheet using OLE

Hi All,
       Can any one help me to create an multiple excel sheet in an work book using OLE. I want to create more than 3 sheets in excel, which is default sheets in excel when we one excel.

Hi,
Check the below sample code.
Here I'm downloading the same table twice into 2 different sheets for example purpose.
TYPE-POOLS ole2.
DATA: wf_cell_from  TYPE ole2_object,
      wf_cell_from1 TYPE ole2_object,
      wf_cell_to    TYPE ole2_object,
      wf_cell_to1   TYPE ole2_object,
      wf_excel      TYPE ole2_object,   " Excel object
      wf_mapl       TYPE ole2_object,   " list of workbooks
      wf_map        TYPE ole2_object,   " workbook
      wf_worksheet  TYPE ole2_object,   " Worksheet
      wf_cell       TYPE ole2_object,   " Cell Range
      wf_cell1      TYPE ole2_object,
      wf_range      TYPE ole2_object,   " Range of cells to be formatted
      wf_range2     TYPE ole2_object,
      wf_column1    TYPE ole2_object.   " Column to be Autofit
DATA: BEGIN OF t_hex,
      l_tab TYPE x,
      END OF t_hex.
DATA: wf_deli(1) TYPE c,            "delimiter
      wf_action TYPE i,
      wf_file TYPE string,
      wf_path TYPE string,
      wf_fullpath TYPE string.
TYPES: t_data1(1500) TYPE c,
       int_ty TYPE TABLE OF t_data1. "line type internal table
*All the data was prepared as line type internal tables for faster
*download
DATA: int_matl  TYPE int_ty ,
      int_matl1 TYPE int_ty ,
      wa_matl   TYPE t_data1.
TYPES: BEGIN OF ty_mara,
       matnr TYPE matnr,
       mtart TYPE mtart,
       matkl TYPE matkl,
       meins TYPE meins,
       END OF ty_mara.
DATA: int_mara TYPE STANDARD TABLE OF ty_mara,
      wa_mara TYPE ty_mara.
FIELD-SYMBOLS: <fs> .
DATA: wc_sheets LIKE sy-index.  "no.of sheets
DATA: it_tabemp TYPE filetable,
      gd_subrcemp TYPE i.
CONSTANTS wl_c09(2) TYPE n VALUE 09.
CLEAR wc_sheets.
DEFINE ole_check_error.
  if &1 ne 0.
    message e001(zz) with &1.
    exit.
  endif.
END-OF-DEFINITION.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_file   LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK block1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  REFRESH: it_tabemp.
  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title         = 'Select File'
*      default_extension    = 'xls'
      default_file_name    = 'Material Details'
*      with_encoding        =
      file_filter          = '*.xls'
      initial_directory    = 'C:\'
      prompt_on_overwrite  = ' '
    CHANGING
      filename             = wf_file
      path                 = wf_path
      fullpath             = wf_fullpath
      user_action          = wf_action
*      file_encoding        =
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4
  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 wf_action EQ 9.
    MESSAGE 'No File have been Selected' TYPE 'S'.
  ELSE.
    p_file = wf_fullpath.
    PERFORM create_excel.
  ENDIF.
*&      Form  create_excel
*       text
FORM create_excel.
  LOOP AT it_tabemp INTO p_file.
  ENDLOOP.
* START THE EXCEL APPLICATION
  CREATE OBJECT wf_excel 'EXCEL.APPLICATION'.
  PERFORM err_hdl.
* PUT EXCEL IN FRONT
  SET PROPERTY OF wf_excel  'VISIBLE' = 1.
  PERFORM err_hdl.
* CREATE AN EXCEL WORKBOOK OBJECT
  CALL METHOD OF wf_excel 'WORKBOOKS' = wf_mapl.
  PERFORM err_hdl.
  SET PROPERTY OF wf_excel 'SheetsInNewWorkbook' = 3. "no of sheets
  PERFORM err_hdl.
  CALL METHOD OF wf_mapl 'ADD' = wf_map.
  PERFORM err_hdl.
*Assign the Delimiter to field  symbol.
  ASSIGN wf_deli TO <fs> TYPE 'X'.
  t_hex-l_tab = wl_c09.
  <fs> = t_hex-l_tab.
  CLEAR int_matl.
  REFRESH int_matl.
  SELECT matnr
       mtart
       matkl
       meins
      FROM mara
      INTO CORRESPONDING FIELDS OF TABLE int_mara.
*first the headings will be displayed  in the excel sheet
  CONCATENATE 'Material Number'
  'Material type'
  'Material Group'
  'Base Unit of Measure'
  INTO wa_matl
  SEPARATED BY wf_deli.
  APPEND wa_matl TO int_matl.
  LOOP AT int_mara INTO wa_mara.
    CONCATENATE wa_mara-matnr
                wa_mara-mtart
                wa_mara-matkl
                wa_mara-meins
                INTO wa_matl
                SEPARATED BY wf_deli.
    APPEND wa_matl TO int_matl.
    CLEAR wa_matl.
  ENDLOOP.
*Copyng thae same contents to another table to display in
*new sheet
  MOVE int_matl TO int_matl1.
  PERFORM f_material_details
  TABLES int_matl
  USING  1.
  PERFORM f_material_details
  TABLES int_matl
  USING  2.
  GET PROPERTY OF wf_excel 'ActiveSheet' = wf_map.
  GET PROPERTY OF wf_excel 'ActiveWorkbook' = wf_mapl.
  CALL FUNCTION 'FLUSH'
    EXCEPTIONS
      cntl_system_error = 1
      cntl_error        = 2
      OTHERS            = 3.
  IF sy-subrc = 0.
    CALL METHOD OF wf_map 'SAVEAS'
      EXPORTING #1 = p_file.
  ENDIF.
  CALL METHOD OF wf_mapl 'CLOSE'.
  CALL METHOD OF wf_excel 'QUIT'.
  FREE OBJECT wf_mapl.
  FREE OBJECT wf_map.
  FREE OBJECT wf_excel.
ENDFORM.                    "create_excel
*&      Form  ERR_HDL
*       text
FORM err_hdl.
  IF sy-subrc <> 0.
    WRITE: / 'OLE ERROR: RETURN CODE ='(i10), sy-subrc.
    STOP.
  ENDIF.
ENDFORM.                    "ERR_HDL
*-- End of Program
*&      Form  f_material_details
*       text
*  -->  p1        text
*  <--  p2        text
FORM f_material_details
   TABLES lint_matl
  USING l_sheet_no TYPE i.
  DATA: lv_lines TYPE i,
        lv_sheet_name(50) TYPE c.
  wc_sheets = l_sheet_no.
  CASE l_sheet_no.
    WHEN 1.
      lv_sheet_name = 'Material_sheet1'.
    WHEN 2.
      lv_sheet_name = 'Material_sheet2'.
  ENDCASE.
*-- activating the worksheet and giving a  name to it
  CALL METHOD OF wf_excel 'WORKSHEETS' = wf_worksheet
    EXPORTING
    #1 = wc_sheets.
  CALL METHOD OF wf_worksheet 'ACTIVATE'.
  SET PROPERTY OF wf_worksheet 'NAME' = lv_sheet_name.
*--formatting the cells
  CALL METHOD OF wf_excel 'Cells' = wf_cell_from
    EXPORTING
    #1 = 1
    #2 = 1.
  DESCRIBE TABLE lint_matl LINES lv_lines.
  CALL METHOD OF wf_excel 'Cells' = wf_cell_to
    EXPORTING
    #1 = lv_lines
    #2 = 4.
*--range of cells to be formatted (in this case 1 to 4)
  CALL METHOD OF wf_excel 'Range' = wf_cell
    EXPORTING
    #1 = wf_cell_from
    #2 = wf_cell_to.
*--formatting the cells
  CALL METHOD OF wf_excel 'Cells' = wf_cell_from1
    EXPORTING
    #1 = 1
    #2 = 1.
  DESCRIBE TABLE lint_matl LINES lv_lines.
  CALL METHOD OF wf_excel 'Cells' = wf_cell_to1
    EXPORTING
    #1 = lv_lines
    #2 = 1.
  CALL METHOD OF wf_excel 'Range' = wf_cell1  " Cell range for first
                                              " column(Material)
    EXPORTING
    #1 = wf_cell_from1
    #2 = wf_cell_to1.
  SET PROPERTY OF wf_cell1 'NumberFormat' = '@' . "To disply zeros
  "in Material number
  DATA l_rc TYPE i.
*DATA download into excel first sheet
  CALL METHOD cl_gui_frontend_services=>clipboard_export
    IMPORTING
      data         = lint_matl[]
    CHANGING
      rc           = l_rc
    EXCEPTIONS
      cntl_error   = 1
      error_no_gui = 2
      OTHERS       = 4.
  CALL METHOD OF wf_worksheet 'Paste'.
  CALL METHOD OF wf_excel 'Columns' = wf_column1.
  CALL METHOD OF wf_column1 'Autofit'.
  FREE OBJECT wf_column1.
ENDFORM.                    " f_material_details
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Mar 5, 2009 11:25 AM

Similar Messages

  • Is it possible to create Excel Sheet using OLE automation in App server

    Hi,
       Is it possible to create Excel Sheet using OLE automation in Application server(Open Dataset)
    Thanks in advance...

    Unless your application server is on Windows OS, or it is connected to a Windows server by RFC. What is the requirement exactly, I don't understand?

  • To Display Logo on all the pages of Excel Sheet using OLE

    Dear friends,
                         I have developed one report using OLE which display output in Excel. I have display logo using OLE.
    I am able to display logo on first page of excel sheet. but I am not able to display it on all the pages.
                        Need your help. Please, suggest any good solution.
    Thanks & Regards,
    Sandip Sonar

    Excel repeats only HEADER and FOOTER information on every page. The data on cell is relevant only for that page.
    If you want to print something on every page in Excel, you will have to include it on HEADER/FOOTER section of the excel file.
    To check this, go to excel, on meny go to File->PageSetup. Then select Header/Footer Tab... select Custom Header or custom footer. 
    Whatever you inset here (including image) will be printed on every page of Excel. Don't know OLE property to set this but I feel something should be available to set custom header footer for your file.

  • Downlaod to Excel sheet using ole

    hi,
           I am using ole2 method for downloading data into Excel.In the excel all the character fields are left aligned and all the numeric fields are right aligned .
           I want all my data to be left aligned ,pls let me know how it can be done thru the program.
    Thnx
    Bhanu.

    Hello Bhanu,
    There are a couple of little tricks to get everything to appear left aligned
    1. There is an object 'HorizontalAlignment' which needs to be set to 'xlLeft' to force excel to display numbers left aligned - though i have never used it, so i cannot guide you more on this
    2. If you simply append an apostrophe to your field before passing it to excel, the data will appear left aligned and the apostrophe will not show in the excel sheet (it will only show in the formula bar)
    to append the apostrophe, first ensure that your field is one character longer than it was earlier (to fit in the apostrophe)
    then use this code
    concatenate '''' fieldname into fieldname.
    the '''' is the escape sequence for apostrophe

  • Problem  in  excel  download using  OLE concept

    Hi ,
        i am trying to  create two sheets using OLE concept.
    i am able to create the excel successfully but i can't save it .
    i have one problem .
    GET PROPERTY OF excel 'ActiveSheet' = sheet.
    CALL METHOD OF sheet 'FILESAVEAS' EXPORTING #1 = w_filename1.
    IF sy-subrc eq 0.
    the sy-subrc value comes as  2.
    i am passing 'C:\SKD.XLS'  to  w_filename.
    is anything wrong.
    how can check  this method  and it's exceptions.

    i am getting the file name from user input using the  method
    *"Calling method for getting file name as saved by the user.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = w_title
        CHANGING
          filename             = w_filnam
          path                 = w_path
          fullpath             = w_filename1
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
    w_filename1 is of sting type .
    i am passing the  full  path to  it .
    please  let  me  i am doing anything wrong .

  • Create Excel sheet

    I tried to use the Bi Beans to create Excel sheet using CSV for the current used crosstab, no hope...here is the code i used...
    public void writeExcelFile(DataAccess dataAccess, DataDirector dataDirector){                         
    try{
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("foo.txt")));
    TextExport exportExcelFile = new TextExport(dataAccess, dataDirector, out);
    exportExcelFile.setExportFormat(exportExcelFile.EXPORT_FORMAT_CSV);
    exportExcelFile.setExportRange
    (exportExcelFile.EXPORT_PAGEDIM_CURRENT);
    exportExcelFile.setLayerMetadataLabelType(
    LayerMetadataMap.LAYER_METADATA_MEDIUMLABEL);
    int []array;
    Object []ob = null;
    array = dataAccess.getLastHPos(DataDirector.COLUMN_EDGE);
    Vector x = new Vector();
    for (int i=0; i<array.length; i++)
    ob[i] = Integer.toString(array);
    exportExcelFile.setExportHPos(new Vector(Arrays.asList(ob)));
    exportExcelFile.export();
    }catch(Exception e){
    when i do open the file created is EMPTY, is there something stupid i did

    Your answer can be found here:
    Re: Webutil.host and space in filename ....

  • Data download to multiple sheets in Excel without using OLE

    Hi,
    Please let me know if it is possible to download data to multiple sheets in excel without using OLE method
    I am in SRM system and the OLE methods are not working
    Please share some sample code or reference links if any
    Thanks
    SekharJ
    Edited by: SekharJ on Sep 8, 2009 8:43 AM

    Here is my code
      LOOP AT it_final INTO wa_final.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_flights  = l_document->create_simple_element(
                      name = 'PO_Details'
                      parent = l_document ).
        ENDAT.
        l_element_airline  = l_document->create_simple_element(
                    name = 'PO'
                    parent = l_element_flights  ).
        l_value = wa_final-object_id.
        l_rc = l_element_airline->set_attribute( name = 'Objectid' value =
                                                             l_value ).
        l_value = wa_final-description.
        l_rc = l_element_airline->set_attribute( name = 'Description' value =
                                                             l_value ).
        l_value = wa_final-number_int.
        l_rc = l_element_airline->set_attribute( name = 'Item' value =
                                                             l_value ).
        l_value = wa_final-description1.
        l_rc = l_element_airline->set_attribute( name = 'Description1' value =
                                                             l_value ).
        l_value = wa_final-quantity.
        l_rc = l_element_airline->set_attribute( name = 'Quantity' value =
                                                             l_value ).
        l_value = wa_final-capex.
        l_rc = l_element_airline->set_attribute( name = 'Capex' value =
                                                             l_value ).
        l_value = wa_final-ser_num.
        l_rc = l_element_airline->set_attribute( name = 'SerialNo' value =
                                                             l_value ).
        l_value = wa_final-plant.
        l_rc = l_element_airline->set_attribute( name = 'Plant' value =
                                                             l_value ).
        l_value = wa_final-loc.
        l_rc = l_element_airline->set_attribute( name = 'Location' value =
                                                             l_value ).
        l_value = wa_final-bundle.
        l_rc = l_element_airline->set_attribute( name = 'Bundle' value =
                                                             l_value ).
      ENDLOOP.
      l_streamfactory = l_ixml->create_stream_factory( ).
      l_ostream = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
      l_xml_size = l_ostream->get_num_written_raw( ).
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            bin_filesize = l_xml_size
            filename     = 'c:\temp\flights.xlsx'
            filetype     = 'BIN'
          CHANGING
            data_tab     = l_xml_table
          EXCEPTIONS
            OTHERS       = 24.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Edited by: SekharJ on Sep 8, 2009 12:04 PM
    Edited by: SekharJ on Sep 8, 2009 12:15 PM

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • Can we create Multi Tabbed excel Sheet using Crystal Reports 2008

    Hi,
      We want to create a Crystal Report which will export the output as multiple Tab's ( we can use sub reports).  Can we create a Multi Tabbed excel Sheet using Crystal Reports 2008 ( not  Crystal reports Basic 2008). Please share any information/links on how to do that.
    Also if it is not supported please let us know which version supports it.
    Thanks,
    Vasu

    At least one of the 3rd-party Crystal Reports Desktop Scheduling tools listed at: http://www.kenhamady.com/bookmarks.html provides that functionality.  It allows you to burst a single report so that each Group at level 1 becomes a separate tab.  You can control the tab names (and tab colors) via fields/formulas inside the report.
    You can also automate the process of exporting to (and also replacing or appending to) specified tabs inside existing workbooks.

  • Problem while creating Excel sheet from TSQL

    Hi,
    I am trying to create an excel sheet using tsql in production server, script is running without any error however when i am trying to open the excel file it is giving an error that may be the file is corrut or in used by some other process or is read
    only.
    Same script is running fine on test server and i am able to open it. i am having SYSADMIN rights on both the servers.
    i think there are some OLE DB driver issue.
    using TSQL (SP_OA.... procedures) to create the excel file.
    System information:
    OS: 64 bit; SQL Server 2005: 32 Bit; Office 2010: 32 Bit.
    Can any one help me?
    Thanks

    Might be a stretch but your situation looks like one I encountered earlier.  Are you running this in a SSIS?  Your office is 32 bits but your OS is 64 bits, when running a SSIS from the agent under a 64 bit system and accessing and access
    a 32 bit driver, you must check the option to "Use 32 bit runtime" under execution option.
    If this is not the case, I would look for an option to execute in 32 bit mode or see if there are available 64 bits drivers.

  • Regading Excel Creation using OLE

    hi friends,
    i got a new requirement where i have to create the Excel document using OLE. one more thing is some cells has to be filled with some colour and in some cells the text has to come in Vertical manner, this text is used for Header purpose.
    please help me urgently...
    Suitable Answers will get more points..........

    Hello,
    Also take a look at this code
    *& Report  ZKRIS_OLE3_PALETTE
    *& Displays the full OLE color range in excel
    REPORT  ZKRIS_OLE3_PALETTE.
    TYPE-POOLS ole2 .
    DATA:  count TYPE i,
           count_real TYPE i,
           application TYPE ole2_object,
           workbook TYPE ole2_object,
           excel     TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256. " change to 16384 for excel 2007
    DATA index TYPE i.
    DATA:
          h_cell        TYPE ole2_object,        " cell
          h_f           TYPE ole2_object,        " font
          h_int         TYPE ole2_object,
          h_width       TYPE ole2_object,
          h_columns     TYPE ole2_object,
          h_rows        TYPE ole2_object,
          h_font        TYPE ole2_object,
          h_entirecol   TYPE ole2_object.
    DATA: h_range       TYPE ole2_object.
    DATA: h_merge       TYPE ole2_object.
    CREATE OBJECT excel 'EXCEL.APPLICATION'.
    IF sy-subrc NE 0.
      WRITE: / 'No EXCEL creation possible'.
      STOP.
    ENDIF.
    SET PROPERTY OF excel 'DisplayAlerts' = 0.
    CALL METHOD OF excel 'WORKBOOKS' = workbook .
    SET PROPERTY OF excel 'VISIBLE' = 1.
    * creating workbook
    SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
    CALL METHOD OF workbook 'ADD'.
    CALL METHOD OF excel 'WORKSHEETS' = sheet
      EXPORTING
        #1 = 1.
    SET PROPERTY OF sheet 'NAME' = 'Color Palette'.
    CALL METHOD OF sheet 'ACTIVATE'.
    DATA: col TYPE i VALUE 1,
    row TYPE i VALUE 2,
    col1 TYPE i VALUE 2,
    col_real TYPE i VALUE 1.
    row = 1.
    col = 3.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '2:2'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    col = 9.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    SET PROPERTY OF h_cell 'Bold' = 1.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '1:1'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    GET PROPERTY OF h_rows 'Font' = h_font.
    SET PROPERTY OF h_font 'Bold' = 1.
    count = 1.
    count_real = count.
    row = 2.
    col = 3.
    DO 56 TIMES.
      PERFORM write_num_and_color.
    ENDDO.
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'C:L'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_entirecol 'Autofit' = 1.
    * write palette on lhs
    *range
    CALL METHOD OF excel 'Range' = h_range
      EXPORTING
        #1 = 'A2'
        #2 = 'A20'.
    CALL METHOD OF h_range 'Merge' = h_merge .
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = 2
        #2 = 1.
    SET PROPERTY OF h_cell 'Value' = 'Palette'.
    SET PROPERTY OF h_cell 'Orientation' = 90.         "angled.
    SET PROPERTY OF h_cell 'HorizontalAlignment' = 3.  "center align
    GET PROPERTY OF h_cell 'Font'    = h_f.
    SET PROPERTY OF h_f 'Bold' = 1.                    "bold
    SET PROPERTY OF h_f 'Name' = 'Comic Sans MS'.
    SET PROPERTY OF h_f 'Size' = '14'.
    SET PROPERTY OF h_cell 'VerticalAlignment' = 2.  "center align
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'A:A'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_columns 'ColumnWidth' = 4.
    *&      Form  write_num_and_color
    *       text
    FORM write_num_and_color.
      index = row_max * ( row - 1 ) + col.
      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
          #1 = index.
      SET PROPERTY OF cells 'Value' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = 1.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      row = row + 1.
      col = col - 3.
      count = count + 1.
      IF count = 29.
        count = 1.
        row = 2.
        col = col + 6.
      ENDIF.
      count_real = count_real + 1.
    ENDFORM.                    "write_num_and_color

  • Upload Excel sheet using Data Integrator 6.1?

    hi all ,
    Upload Excel sheet using Data Integrator? and how to create ODBC for the PC and jobserver i am using version 6.1? i am using excel as my one of the data source and tell me how to use different types of data sources in DI . after uploading the xl file if i apply any transform on the excel data i will give error like
    Posted: 25 Sep 2008 04:30
    Post subject: Re: Upload Excel sheet using Data Integrator? 
    I am getting the error like
    3128 292 CON-120302 09-25-08 09:59:40 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
    3128 292 CON-120302 09-25-08 09:59:40 default driver specified>. Notify Customer Support.
    1512 2992 CON-120302 09-25-08 09:59:41 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
    1512 2992 CON-120302 09-25-08 09:59:41 default driver specified>. Notify Customer Support.
    Please help me out
    Thank u

    Hi Shonti,
    The DI 11.7 installer can be used to upgrade a DI 6.1 local repository (e.g. the upgrade is supported).  This will migrate all jobs and flows.  They will remain intact, however, this is always a major migration effort and should not be taken lightly.  If you do upgrade, please make sure this is a planned effort with rigorous testing and validation.  You should also ensure that you consult the release notes and [supported platforms documentation|https://websmp110.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000712240&_SCENARIO=01100035870000000202] for the 11.7 package you intend to install.  The DI 11.7 documentation also contains info about how to install and configure the Excel Adapter, and what functionality it provides.
    Thanks,
    ~Scott

  • Generating Excell Sheet using Reports 9i

    Hello,
    I wanna know how can I do to generate one excell sheet using reports, without
    use the option that4s generate text file using tab. I wanna know if someone have
    example codes, or library4s.
    Thanks,
    Paulo Sergio

    Here are some notes we created from the demo below. This works great for generating true formated excel output in 9i Reports using 9ias Rel2.
    Notes from
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
    Output to Excel with Oracle9i Report
    1.     Create an Excel template for the report. It should contain generic information such as title, logo and column headers
    2.     Cretae a sample line of data in the spreadsheet
    3.     Save the Excel spreadsheet as a Web page. File | Save As Web Page
    4.     Open the Web page you just created in Reports Builder
    5.     Double-click on Web Source node to display the HTML code for the Excel spreadsheet
    6.     Note how Excel generated HTML and XML code for the spreadsheet you created. Reports Builder also adds its own JSP tags
    7.     Add the Data Source An SQL Query
    8.     Modify the Web Source. Now that youve written the query, you can modify the Web source to tell Reports Builder to display your report in Excel.
    9.     Click on the Web Source icon in the toolbar.
    10.     To force the browser to open MS Excel it is necessary to change the HTTP Content Type to a specific MIME Type:
    application/vnd.ms-excel
         Insert the following line immediately before the <rw:report id=report> tag
              <%@ page contentType=application/vnd.ms-excel %>
         (This is a standard JSP directive to set a MIME Type (Content Type) )
    11.     To respect Excel format, you should delete the blank lines above the <html> tag.
    12.     Now, use Oracle 9i Reports JSP tags to add the data retrieved by your SQL Query to the report.
    13.     Search for the sample line of data you added to your Excel spreadsheet
    14.     Each line is saved as an HTML Table Row tag ( <tr> ).
    15.     Each column is mapped as an HTML Table Data tag ( <td> ).
    16.     Using Reports JSP Tags, add a Reports repeating frame tag to loop around the Data Model group.
    17.     To help, show the Object navigator next to the Web Source Window. All group information is now visible in the Object Navigator
    18.     Enclose the sample line of code in the Web source with the Reports9i JSP repeating tag.
    Use from menu Insert | Repeating Frame at beginning of sample
    Move the closing repeating tag after the </tr> tag.
    Start of the repeating tag would be
    <rw:foreach id=foreach src=>
    Ending of the repeating frame would be
    </rw:foreach>
    19.     In the opening of the repeating tag (<for each>), add the name of the group the tags enclose. JSP custom tags require a unique identifier.
    For example: <rw:foreach id=gEmpNoId src=G_EMPNO>
    20.     Now, map the cells of the Excel spreadsheet to the corresponding field from your data model.
    Select on the data value. From menu select Insert | Field. The source of the tag is the name of the field in the query.
    21.     Repeat the operation for each field of the report. Note: do not forget to specify a unique identifier for each field.
    22.     The code now contains a repeating frame. You have also mapped each cell in the Excel spreadsheet to the corresponding field in the data model
    23.     Save the report as a Reports JSP. You can test the report using the Run Web Layout icon in the toolbar
    24.     The execution of a Web Layout report from Reports Builder creates a temporary HTML file and launches the browser. The browser does not launch Excel because the document is saved as an HTML file. To launch Excel from the browser you need to test it from Reports Server.
    25.     In order to have the report appear inside Excel, you need to execute it with the Reports Server under OC4J. To do this you need to:
    First, start an OC4J instance from Oracle 9iDS see How to Execute Reports Services from Oracle 9iDS on OTN. Then, copy the JSP to a directory. For example: $IDS_HOME/reports/j2ee/reports_ids/web/test
    26.     Enter the URL to execute the jsp. The JSP is executed from an OC4J instance.
    http://reports9iTestServer:8888/reports/test/ListOfEmployees.jsp?userid=scott/tiger@ora901
    27. The browser launches Microsoft Excel and displays the data from your report.

  • Conneting the microsoft excel sheet using jdbc

    HI all
    my requirement is to connect to the excel sheet using the jdbc odbc dsn and read the worksheets and get the data.
    i have created the dsn using vb scripting
    so when i click on a button. a dsn is created dynamically and the same dsn is passed as parameter to the system which will call a java program
    the java program will us the dsn to connect to the excel sheet to read the data.
    This is working fine
    the problem is sometimes the following exception is raised.
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.zt.ebiz.install.client.ExcelDriver.getConnection(ExcelDriver.java:290)
    at com.zt.ebiz.install.client.ExcelDriver.getHostInfo(ExcelDriver.java:337)
    at com.zt.ebiz.install.client.InstallClient.executeActions(InstallClient.java:188)
    at com.zt.ebiz.install.client.InstallClient.main(InstallClient.java:123)
    For this we are just restarting the system.
    Again it works fine.
    i would like to know the cause of this problem.
    please help me in this
    thanks
    Vijay Sunder

    It may be occured because of connection closing, make it sure to close connections after your transactions completed.

  • Unable to display double values in Excel sheet using JExcel API

    Hi
    I am writing code to generate report in the form of Excel Sheet using JExcel API.
    Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
    Any kind of reply might help me lot.
    Thank U.

    If you enable the submit zero option, it still happens? This is a new feature on the display tabl
    #NumericZero Enhancements
    To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
    · Excel formatting for the cell is retained.
    · All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
    · This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
    You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
    Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
    1. (Highest) Metadata errors
    2. #No access
    3. #Invalid/Meaningless
    4. #No data\Missing

Maybe you are looking for

  • Can't Launch ConsoleOne due to a font error

    Hi Group, When I try to start ConsoleOne, I recive the following error. Warning: Cannot convert string "-b&h-lucida-medium-r-normal-sans-*-140-*-*-p-*-iso8859-1" to type FontStruct I followed some directions from another forum, but that didn't help.

  • How do you sort by album name?

    I have iTunes for Windows Vista, and I can sort music in my library by Name, Time, Artist, Genre, Rating, Play Count, and last played. However, there is no option to sort by album name. Shouldn't there be? Otherwise, how can I possibly find all the t

  • Workflow Tables for Report

    Hi I need to develop a report with following information. The report should have current status. For example if 5 approvers have to approve the document then the report should show at the end all 5 approvers and the status. Approver name , Approval s

  • How to use "Discussion"

    I haven't touched this subject for months, particularly "Enhanced Dictation," but I thought I'd try again. There seemed to have been a problem with "Enhanced Dictation," but I'm hoping that Apple has fixed it by now. Anyway, from what I've read, all

  • Which of the following cpu coolers will fit on my mobo(p965 neo f)?

    hi guys im looking to replace the stock hsf and the following is wht ive narrowed it down to: 1.thermalright ultra 90a ultra 120 ultima 90i 2.cooler master hyper tx2 3.scythe ninja plus rev b ive got a 9600gt and 2 1gb ram sticks in dual channel conf