Capturing cursor output in HTML format

Hi,
I want to capture Cursor's output in html format.
following is the current query which is giving me output as mentioned below it
Query:-
declare
v_msgtext  varchar(4000);
cursor c_query IS
select emp_no,emp_name,salary
          from employees
          where dept_id = 100;
begin
for v_query in c_query LOOP
v_msgtext = v_msgtext ||
                    'empno:'|| v_query.emp_no||','||
                    'emp_name:'||v_query.emp_name||'.'||
                    'emp_salary:'||'v_query.salary'||
                    char(13)||char(10);
END LOOP;
utl_mail.send(v_sender, v_recipient, NULL, NULL, v_subject, v_msgText, 'text/html; charset=windows-1250', NULL);
end; 
o/p:-
empno: 123,emp_name:sagar,emp_salary:10,000
empno: 124,emp_name:neeraj,emp_salary:20.000
empno: 125,emp_name:ashish,emp_salary:18.000
empno: 126,emp_name:ramesh,emp_salary:5.000
empno: 127,emp_name:suresh,emp_salary:30.000
I want to generate the output as HTML report in tabular format with the below columns
(empno,emp_name,salary) and send this html file via email to user.
Can anybody please suggest a solution ASAP.
Thanks in advance.

Hi ,
Please follow the below link may it will be useful for you.It shows how to generate a HTML format output through the query.
oracle - Within a PL/SQL procedure, wrap a query or refcursor in HTML table - Stack Overflow

Similar Messages

  • Capture cursor output in HTML format in PL/SQL

    Hi,
    I want to capture Cursor's output in html format.
    following is the current query which is giving me output as mentioned below it
    Query:-
    declare
    v_msgtext  varchar(4000);
    cursor c_query IS
    select emp_no,emp_name,salary
              from employees
              where dept_id = 100;
    begin
    for v_query in c_query LOOP
    v_msgtext = v_msgtext ||
                        'empno:'|| v_query.emp_no||','||
                        'emp_name:'||v_query.emp_name||'.'||
                        'emp_salary:'||'v_query.salary'||
                        char(13)||char(10);
    END LOOP;
    utl_mail.send(v_sender, v_recipient, NULL, NULL, v_subject, v_msgText, 'text/html; charset=windows-1250', NULL);
    end;  
    o/p:-
    empno: 123,emp_name:sagar,emp_salary:10,000
    empno: 124,emp_name:neeraj,emp_salary:20.000
    empno: 125,emp_name:ashish,emp_salary:18.000
    empno: 126,emp_name:ramesh,emp_salary:5.000
    empno: 127,emp_name:suresh,emp_salary:30.000
    I want to generate the output as HTML report in tabular format with the below columns
    (empno,emp_name,salary) and send this html file via email to user.
    Can anybody please suggest a solution ASAP.
    Thanks in advance.

    Hi,
    You can do in this way ...
    CALL FUNCTION 'WWW_ITAB_TO_HTML'
         TABLES
              HTML   = F_HTML
              FIELDS = FLDS
              ITABLE = ITAB.
    IF SY-SUBRC NE 0.
      WRITE: / 'Error in generating the html format'.
      EXIT.
    ENDIF.
    CALL FUNCTION 'WS_DOWNLOAD'
         EXPORTING
              FILENAME         = 'c:test.html'
              MODE             = 'BIN'
         TABLES
              DATA_TAB         = F_HTML
         EXCEPTIONS
              FILE_OPEN_ERROR  = 1
              FILE_WRITE_ERROR = 2
              OTHERS           = 9.
    call these 2 Fucntion modules for every page. so each page it wil downlaod a HTML page
    Regards
    Sudheer

  • How to retrieve complete report output in HTML format

    Hi,
    I'm looking for how to retrieve complete report output in HTML format.
    I have tried the following and it only give me first page of the report output where in the actual report output should be 5 pages. Is there something I'm missing.
    CallbackOption[] boCallOpt = new CallbackOption[1];
    ImageManagement boImgMan = new ImageManagement();
    boImgMan.setCallbackScript("getImage.jsp");
    boImgMan.setImageManagementHolder("imageName");
    boImgMan.setDocumentReferenceHolder("docRef");
    boCallOpt[0] = boImgMan;
    RetrieveData oRetrieveData = new RetrieveData();
    RetrieveView oRetrieveView = new RetrieveView();
    oRetrieveView.setCallbackOption(boCallOpt);
    oRetrieveData.setRetrieveView(oRetrieveView);
    Action[] oActions;
    oActions = new Action[1];
    oActions[0] = fillPrompts;
    oReportEngine.getDocumentInformation(boDocInfo.getDocumentReference(), null, oActions, null,oRetrieveData);
    Testing this on BOE XI 3.0
    Thanks,

    For Web Intelligence, HTML is an interactive viewing format and not an export format such as PDF.
    Note that the HTML will be embedded with postback URLs to the application for images and drill downs.
    Closest you'd get is to be able to specify HTML output of an entire REPORT rather than REPORT_PAGE in the ViewSupport.setViewMode method.  But this brings back just one report in the document, and will have postback URLs mentioned above.
    Sincerely,
    Ted Ueda

  • Smartforms output in HTML format

    Hi Experts,
    I want to save my smartforms in HTML format.Is there any Standard programe is available for it.
    Like as RSTXPDFT4 for converting output in PDF format.

    Hi,
    Check this link.In that,I am converting the output of smartform to PDF and then attaching it through mail.
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/smartforms/smartform in abap.pdf

  • Report Output In HTML Format

    Hi,
    i have my report output of 4 paes. when i tried to save them in HTML format , it saves all pages all together in 1 html. i want to save each page in different html.
    like i have 4 pages in report output .. i want 4 html for each different page .
    Can anybody help me ..its urgent

    Hi,
    You can do in this way ...
    CALL FUNCTION 'WWW_ITAB_TO_HTML'
         TABLES
              HTML   = F_HTML
              FIELDS = FLDS
              ITABLE = ITAB.
    IF SY-SUBRC NE 0.
      WRITE: / 'Error in generating the html format'.
      EXIT.
    ENDIF.
    CALL FUNCTION 'WS_DOWNLOAD'
         EXPORTING
              FILENAME         = 'c:test.html'
              MODE             = 'BIN'
         TABLES
              DATA_TAB         = F_HTML
         EXCEPTIONS
              FILE_OPEN_ERROR  = 1
              FILE_WRITE_ERROR = 2
              OTHERS           = 9.
    call these 2 Fucntion modules for every page. so each page it wil downlaod a HTML page
    Regards
    Sudheer

  • Can i get the report output in HTML format?

    Hello everybody,
    I have developed a report whose output needs to be printed in HTML format.
    Can anybody suugest how this can be accomplished by coding in program itself using any function modules if necesary?
    Helpful answers will surely be rewarded.
    Thanx in advance,
    Sanghamitra.

    refer the below code
    Generate an HTML file from a Report in ABAP
    data: begin of itab occurs 0,
          matnr type mara-matnr,
          mtart type mara-mtart,
          matkl type mara-matkl,
          groes type mara-groes,
          end of itab.
    data: ifields type table of w3fields with header line.
    data: ihtml   type table of w3html   with header line.
    select * into corresponding fields of table itab
              from mara up to 100 rows.
    call function 'WWW_ITAB_TO_HTML'
    EXPORTING
      TABLE_ATTRIBUTES       = 'BORDER=1'
      TABLE_HEADER           =
        ALL_FIELDS             = 'X'
      tables
        html                   = ihtml
        fields                 = ifields
      ROW_HEADER             =
        itable                 = itab
    check sy-subrc = 0.
    call function 'GUI_DOWNLOAD'
         exporting          filename = 'c:\test.html'
         tables          data_tab = ihtml
    or for conerting internal table data into html
    See below simple report to convert the internal table data to a HTML format data and stores in a internal table and then pass that internal table as an attachment to the external email using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    You need for create a spool also.
    REPORT Z_HTML .
    include <icon>.
    types: begin of msg,
    type like icon-id,
    text(140) type c,
    end of msg.
    constants: gc_marked type c value 'X',
    gc_ok like icon-id value '@5B@'.
    data:
    gt_msg type standard table of msg,
    gs_msg like line of gt_msg,
    gv_msg(138) type c,
    *-- html
    html_container type ref to cl_gui_custom_container,
    html_control type ref to cl_gui_html_viewer,
    my_row_header like w3head occurs 10 with header line,
    my_fields like w3fields occurs 10 with header line,
    my_header like w3head,
    my_html type standard table of w3html ,
    ok_code like sy-ucomm.
    Start of Selection *
    start-of-selection.
    clear gv_msg.
    gv_msg = 'MESSAGES for HTML'.
    do 3 times.
    perform message using gc_ok gv_msg .
    enddo.
    End of Selection *
    end-of-selection.
    set screen 0100.
    *& Form message
    form message using p_type
    p_text.
    clear gs_msg.
    gs_msg-type = p_type.
    gs_msg-text = p_text.
    append gs_msg to gt_msg.
    endform. " MESSAGE
    *& Module STATUS_0100 OUTPUT
    module status_0100 output.
    perform convert_itab_html.
    set titlebar '100' .
    set pf-status 'MAIN100'.
    create object html_container
    exporting
    container_name = 'CONTAINER'.
    create object html_control
    exporting
    parent = html_container
    saphtmlp = gc_marked .
    data: assigned_url type url.
    call method html_control->load_data
    EXPORTING
    URL = url
    TYPE = 'text'
    SUBTYPE = 'html'
    SIZE = 0
    ENCODING =
    CHARSET =
    importing
    assigned_url = assigned_url
    changing
    data_table = my_html
    EXCEPTIONS
    DP_INVALID_PARAMETER = 1
    DP_ERROR_GENERAL = 2
    CNTL_ERROR = 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.
    call method html_control->show_url
    exporting
    url = assigned_url
    FRAME =
    IN_PLACE = ' X'
    EXCEPTIONS
    CNTL_ERROR = 1
    CNHT_ERROR_NOT_ALLOWED = 2
    CNHT_ERROR_PARAMETER = 3
    DP_ERROR_GENERAL = 4
    others = 5
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endmodule. " STATUS_0100 OUTPUT
    *& Module exit INPUT
    module exit input.
    leave program.
    endmodule. " exit INPUT
    *& Module user_command_0100 INPUT
    text
    module user_command_0100 input.
    case ok_code.
    when 'EXIT' or 'BACK'.
    leave program.
    when others.
    call method cl_gui_cfw=>dispatch.
    endcase.
    endmodule. " user_command_0100 INPUT
    *& Form convert_itab_html
    form convert_itab_html.
    data: lv_tabix like sy-tabix.
    *-- table header
    call function 'WWW_ITAB_TO_HTML_HEADERS'
    exporting
    field_nr = 1
    text = 'Type'
    fgcolor = 'navy'
    bgcolor = 'red'
    font = 'Arial'
    tables
    header = my_row_header.
    call function 'WWW_ITAB_TO_HTML_HEADERS'
    exporting
    field_nr = 2
    text = 'Message'
    fgcolor = 'navy'
    bgcolor = 'red'
    font = 'Arial'
    tables
    header = my_row_header.
    *-- table rows
    clear lv_tabix.
    loop at gt_msg into gs_msg.
    lv_tabix = sy-tabix.
    call function 'WWW_ITAB_TO_HTML_LAYOUT'
    exporting
    field_nr = 1
    line_nr = lv_tabix
    icon = gc_marked
    tables
    fields = my_fields.
    call function 'WWW_ITAB_TO_HTML_LAYOUT'
    exporting
    field_nr = 2
    line_nr = lv_tabix
    fgcolor = 'red'
    bgcolor = 'black'
    font = 'Arial'
    size = '2'
    tables
    fields = my_fields.
    endloop.
    *-- header
    move 'Messages during program run' to my_header-text.
    move 'Arial' to my_header-font.
    move '2' to my_header-size.
    move 'Centered' to my_header-just.
    move 'red' to my_header-bg_color.
    move 'blue' to my_header-fg_color.
    refresh my_html.
    call function 'WWW_ITAB_TO_HTML'
    exporting
    table_header = my_header
    all_fields = ' '
    tables
    html = my_html
    fields = my_fields
    row_header = my_row_header
    itable = gt_msg.
    endform. "convert_itab_html
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Oracle Applications Alert: Want message output in HTML format

    Hi,
    My question is regarding Oracle Application Alerts. Currently, we get output of message in plain text.
    How can i provide/setup Oracle Alert in such a way that message send through Alert are HTML formatted text?
    I have referred Oracle Alerts 11i User Manual and ran google search on this topic but have not found any answer so far.
    Hope this forum will help me find the solution.
    Thanks in advance,
    Saurabh

    Hi Saurabh
    How can i provide/setup Oracle Alert in such a way that message send through Alert are HTML formatted text? I belive you cant use html for alert. You can use workflow or plsql to send html mails.
    I have referred Oracle Alerts 11i User Manual and ran google search on this topic but have not found any answer so far. For more information Please also check below and see its helpful:
    Subject: HOW TO CONFIGURE ORACLE*MAIL FOR USE WITH ORACLE ALERT Doc ID: 1005013.6
    Subject: Using Oracle Alert with Workflow Mailer Doc ID: 395128.1
    Subject: How to determine what email system is being utilized for Oracle Alert processing? Doc ID: 428193.1
    Subject: Which electronic mail facilities does Alert use/support? Doc ID: 211840.1
    Subject: Configuring the Oracle Workflow 2.6 Java-based Notification Mailer with Oracle Applications 11i Doc ID: 231286.1
    Subject: FAQ: Using Oracle Alert to Send MAPI Mail on Windows NT Doc ID: 75011.1
    Subject: How to setup Email Notification from Microsoft Exchange with Oracle Alerts Doc ID: 163249.1
    Regard
    Helios

  • Scrollbar for reports output in html format

    We are creating reports with fairly large amounts of data being directed to the screen in HTML format. We were expecting to see a scrollbar along the right hand edge of the report window that allows us to see all of our data. Is this possible?
    Alternatively, how would we split this data up into multiple pages? There isn't really anything to break on. We do want our totals on this last page.
    Thanks.

    hello,
    unfortunatly the varying destination types are only valid for bitmap reports.
    regards,
    the oracle reports team

  • Generating WebHelp output in .html format (vs in .htm format)

    We're using RoboHelp X5. The Developers want us to generate
    the Help output with .html file extension (vs. .htm file
    extension). Could you please let me know how do we go about
    this?

    I would strongly resist that because you are making a rod for
    your own back for no useful purpose whatever.
    You have to manually change each topic file name within
    Project Manager and make sure you specify the extension for the
    start page when you generate. I think that will ensure all files
    are HTML but check it out. Also check out that everything works as
    whilst that will give the right file extension, I haven't tested
    search, index, glossary etc.
    Also bear in mind there is no way to make RH create new files
    with that extension. You have to remember to do it manually
    yourself.
    Unless the developers can come up with a very persuasive why,
    which does not include "because we are the developers", a
    suggestion that they do a foxtrot with Oscar might be appropriate.

  • This is Regarding wants table values output into HTML formate

    Hello Experts,
    can you please help me regarding this,i want table valuees in to HTML formate,so can you please tell solution ,is there any FM or any other solution for geeting Table values in HTML formate.please suggest me
    Thanks and regards,
    durga.k

    dketcham wrote:
    cotton.m wrote:
    >
    2) I'm looking at how you called stuff, and you're trying to call the jsp file as an image? That jsp isn't the source of the image, just a page linking to an image. I think if you really want to do things that way you're going to need to just include that jsp within the jsp you're calling it from (or you can do it the easy way, and if you have the information to get the path of the image you want, you could simply call the image from the first jsp you posted)This is incorrect.
    There are two JSPs. The second when called will (if it worked) return the source of an image as stored in the database.even when called with <img src=xx.jsp>??
    Yes.
    If any of what I say next seems obvious or otherwise negative I apologize, just trying to explain and I don't know what you know vs what you don't.
    The link in the src is just a URL not a filetype. So just because it ends with JSP does not mean it has to return HTML. The content type is determined by the browser using the Content-Type header returned by the server in the HTTP response. In this case the header is set to be a jpeg so that's what the browser will attempt to interpret the content part of the response as.
    So in fact one is not limited to just HTML or images but whatever content type you would like to return (that the browser can understand anyway). This could be HTML or it could be an image of some type or it could be a PDF or it could be an Excel spreadsheet. All you have to do in the JSP is set the header appropriately and then send content that is actually in that format.
    This does not just apply to JSP by the way but all other web programming languages. You can do similar things to produce the same results in PHP, Perl, ASP etc.
    The only JSP/Servlet complication is whether or not doing this in a JSP is a "good" idea but I am not an expert enough at that to make a definitive statement. Mostly though JDBC in a JSP is a no-no.

  • Reports output in Html format.

    Hi,
    My reports are in character mode.
    I am running those reports in command line with all parameters like desname ,desformat,destype...
    If mode is character we can't set desformat as Html.If I change that mode into default,then trancation will occur.How can I avoid this.Is there any possiblity to reduce
    fontsize?
    I don't want to modify each report.
    Thanks,
    viji.

    hello,
    unfortunatly the varying destination types are only valid for bitmap reports.
    regards,
    the oracle reports team

  • Smartform output in html

    Dear all ,
    I want to take smartform output in html format . the logos are not coming as well as the header template the records are coming in next line not side by side .my code is :
        gs_output_options-xsfcmode  = 'X'.
        gs_output_options-xsf = 'X'.
        gs_output_options-xsfoutmode = 'A'.
        gs_output_options-xsfformat = 'X'.
        xsfparam_line-name  = 'GRAPHICS'.
        xsfparam_line-value = 'EXTRACT'.
        APPEND xsfparam_line TO gs_output_options-xsfpars.
        xsfparam_line-name  = 'GRAPHICS-DIRECTORY'.            
        xsfparam_line-value = c_gr_dir.
        APPEND xsfparam_line TO gs_output_options-xsfpars.
        xsfparam_line-name  = 'CONTENT-ID'.                  
        xsfparam_line-value = 'ENABLE'.                        
        APPEND xsfparam_line TO gs_output_options-xsfpars.
      CALL FUNCTION fm_name
       EXPORTING
         control_parameters = gs_ssfctrlop
         output_options     = gs_output_options
      p_graphics[] = gs_job_output_info-xmloutput-xsfgr[].
      p_html = gs_job_output_info-xmloutput-trfresult
        CONCATENATE 'C:\TEST\TC1_' p_vbeln '.html' INTO p_file.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            BIN_FILESIZE            = html_len
            filename                = p_file
            filetype                = 'BIN'"'ASC'
           trunc_trailing_blanks   = 'X'
          TABLES
            data_tab                = p_html-content
          CALL METHOD cl_gui_frontend_services=>execute
            EXPORTING
              document               = p_file

    This question (logos and html smartform output) has been discussed several times related to email sending.  Try searching the forum.  You may find some relevant info in other posts.  Have you tried reaching the url that's generated for the logo?

  • Calling SAP script program in BAPI and want to display in html format

    Dear All,
    I am writing bapi and calling sap script program in it.
    I want output in html format pl suggest me
    same coding is working for report giving error in sapscript only.
    types: begin of tt_html,
                 html type w3html,
           end of tt_html.
    data: list_tab type standard table of abaplist.
    SELTAB-SELNAME = 'S_INVNO'.
    SELTAB-KIND = 'S'.
    SELTAB-SIGN = 'I'.
    SELTAB-OPTION = 'EQ'.
    SELTAB-LOW =  INVOICE_NUM1.
    SELTAB-HIGH = INVOICE_NUM2.
    APPEND SELTAB.
    submit ZSDRDINVPNBRPT with selection-table seltab
    exporting list to memory and return.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = MTAB_REPORT_LIST
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
        CALL FUNCTION 'WRITE_LIST'
         EXPORTING
           WRITE_ONLY       = 'X'
          TABLES
            listobject       = MTAB_REPORT_LIST
         EXCEPTIONS
           EMPTY_LIST       = 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.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
           TABLES
                HTML   = MTAB_REPORT_HTML
           EXCEPTIONS
                OTHERS = 1.
    LOOP AT MTAB_REPORT_HTML.
    ENDLOOP.

    For displaying output in html format,
    u can either use BSP ( Business Server Pages)
    or Webdynpro.
    Reward if helpful.

  • How to remove Pagebreak while printing a Report in Html format

    Hi there,
    I am printing the Report Output as HTML format and I need to avoid pagebreaks ... Is there any way to avoid.
    I did tried PAGESTREAM ... but it prints the next page in a separate file ...
    Can anyone give a solution for this !!!
    TIA
    Vaithy. S

    hello,
    when you use the output-format HTML or HTMLCSS, oracle reports creates a representation of the layout as it would be created on paper in these formats; therefore there are pagebreaks.
    there is no way to switch them off.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • EMail report in HTML format in Background

    Hi all,
    We have a report which sends the output in HTML format to the internet email address. We use the function module SO_NEW_DOCUMENT_ATT_SEND_API1 for doing this.
    When we are executing this in foreground the entire output is available in the HTML file, but when we execute this in background only the last page of the spool request is sent in the HTML file. Please help us in what way we can avoid this.
    There are 5 pages in the report. Please advise us what exactly has to be done.
    Thanks in advance.
    Regards,
    Vivek ...
    Message was edited by:
            Vivek Krishnan Kandasamy

    Hi Vivek,
    have a look at this thread ...
    Issue facing background email attachment.
    Regards
    Sudheer

Maybe you are looking for

  • How to create a Faded background

    I'm using Fireworks CS3. I have created a new canvas and saved it as a .png. I now want to create a faded background. So I select the gradient tool and define the details of the color, etc BUT when I mouseover the canvas I get a circle with a slash t

  • Can't Create Planning App. when CSS Properties is defined

    <p>I'm using Hyperion Planning 4.0.1 and Essbase 7.1.3. All my appsare configured for Hyperion HUB. But if I setup the CSS propertiesfor Hyperion HUB, local file or whatever else I receive an errorand the application is not created.</p><p> </p><p>The

  • ORA- 00937 & ORA-02063 error

    I run he folliwng SQL: (SELECT my_date, MAX(DECODE(last_retry,1,count(*),0)) AS "1", MAX(DECODE(last_retry,2,count(*),0)) AS "2" FROM retry_state@full GROUP BY my_date) and I get this Error: ORA_00937 not a single group group function ORA-02063 prece

  • Multithread in dotnet devkit ?

    Using the dotNet dev kit, I am developing an application which loads ContentDb. I have an upload class that has self contained access to a ContentDb. This class works perfectly when run by itself. Each upload class has its own session manager, etc. i

  • Query Frame Query

    Hello all, I have a Query frame where I take input values and based on that I show the result. i.e. I have 2 variable and (:P1, :P2) based on the user entered values I query the report as select * from view where( p1 like nvl(:p1,'%') and p2 like nvl