Viewing html document

Hi all,
I was referring to Brian's excellent blog on handling non-html documents for creating and displaying attachments. But how to open a html attachment? I am creating attachment of type htm document ( mimetype text/html) . But how to display it ? Please help.
Regards
Ananya

oninputprocessing.
fileupload ?= cl_htmlb_manager=>get_data(
                       request = request
                       id      = 'myUpload'
                       name    = 'fileUpload' ).
file_name      = fileupload->file_name.
file_mime_type = fileupload->file_content_type.
file_length    = fileupload->file_length.
file_content   = fileupload->file_content.
CREATE OBJECT cached_response TYPE cl_http_response EXPORTING add_c_msg = 1.
  cached_response->set_data( file_content ).
  cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                     value = file_mime_type ).
  cached_response->set_status( code = 200 reason = 'OK' ).
  cached_response->server_cache_expire_rel( expires_rel = 180 ).
  CALL FUNCTION 'GUID_CREATE'
    IMPORTING
      ev_guid_32 = guid.
  CONCATENATE runtime->application_url '/' guid INTO display_url.
  cl_http_server=>server_cache_upload( url      = display_url
                                       response = cached_response ).
  RETURN.
and in layout
<% if not display_url is initial . %>
<script language="Javascript">
        window.open("<%= display_url%>");
      </script>
<% endif . %>
Is this what you are looking for?
Regards
Raja

Similar Messages

  • How to view HTML document through ABAP in CRM

    Hi,
    I have an internal table with one field type string containing html code.
    How can i see the output of that html document in SAP CRM using ABAP code.
    Is there any standard function module to display the document by passing the internal table?
    Please help.
    Regards
    Kiran

    you can use cl_gui_htmlviewer control to do this.
    check the demo program
    SAPHTML_DEMO1
    RSDEMO_HTML_VIEWER
    or you can use dynamicdocuments for the same check out samples programs in package
    SDYNAMICDOCUMENTS
    Regards
    Raja

  • Viewing HTML documents

    If I am downloading an HTML document from the WWW, i.e. a web page, how can I handle it so that what is actually shown on my GUI component (which is of type TextArea) is the final "page" (as shown by any standard Web browser) rather than just html code?

    Check out JEditorPane

  • How to view html documents

    I feel like something went wrong with my Macbook MacBook Pro (13-inch, Mid 2010) Processor 2,4 GHz Intel Core 2 Duo Memory 4 GB 1067 MHz DDR3.
    I'm using Yosemite OS X 10.10.2
    I am a student and I started 2 months ago to open and download PDFs and HTML documents with no problem. Then about a week ago, all of these docs I downloaded from the web showed up in code.  I tried opening them with Safari, but no dice. What can I do?

    I feel like something went wrong with my Macbook MacBook Pro (13-inch, Mid 2010) Processor 2,4 GHz Intel Core 2 Duo Memory 4 GB 1067 MHz DDR3.
    I'm using Yosemite OS X 10.10.2
    I am a student and I started 2 months ago to open and download PDFs and HTML documents with no problem. Then about a week ago, all of these docs I downloaded from the web showed up in code.  I tried opening them with Safari, but no dice. What can I do?

  • Viewing a HTML document in my Java program

    Hi,
    My Java program has a JTextPane that can display plain text or HTML documents. This program can mark up certain parts of the document to draw the user's attention.
    However, I am having problems when it comes to marking up some of the HTML documents. When they are first loaded onto the JTextPane, they appear fine. When I then run the method to apply the mark up styles, I notice that the text turns the same color as the background after a certain point - making it impossible to see the document or markup.
    The HTML (or text) document on display is made into a StyledDocument. And this is how the View for the HTML documents is created:
    HTMLEditorKit htmledkit = new HTMLEditorKit();
    ViewFactory myHTMLViewFactory = htmledkit.getViewFactory();
    return myHTMLViewFactory.create(elem);
    Note that elem is an Element -.-
    - I tried modifying the color tags in the HTML document, but even when I made the text black and the background white, the text still goes white. If it's a black background, the text goes black, etc. The markup style is actually trying to turn parts of the text red - and it works almost all of the time, apart from these certain documents.
    - I then tried applying my own style whenever a HTML document is loaded in, in the hope that I could force the background white and text black, regardless of the tags:
    MutableAttributeSet att = new SimpleAttributeSet();
    StyleConstants.setForeground(att,Color.black);
    StyleConstants.setBackground(att, Color.white);
    doc.setCharacterAttributes(0, doc.getLength(), att, false);
    The resulting document display kept the original HTML background color, but wherever there was text it looked like someone had run a highlighter over it to change the background white and text black. Kinda ugly! And it still didn't work - come markup time this style was ignored after a certain point.
    - This is one of the HTML documents that causes the problem:
    <html>
    <head>
         <link rel="STYLESHEET" type="text/css" href="mystyle.css">
         <title>My Document</title>
    </head>
    In the body tag:
    <table>
    table here... this displays fine
    </table>
    And here is the problem point:
    <table width=100% cellspacing=0 cellpadding=0>
    <tr>
    <td>
    <table width=100% cellspacing=0 cellpadding=0 style="padding: 3px; padding-top: 6px; padding-bottom: 6px;">
    <tr>
    <td width=100% style=" padding-left: 6px; padding-right: 6px;">
    <table class=pane cellpadding=0 cellspacing=0>
    <tr>
    <td width=100% class=panetitlebox align=Center >
    This is the last text that gets displayed! After this sentence, text goes same color as background.
    </td>
    </tr>
    <tr height=100% valign=top>
    <td class=panebox colspan=2 align=Left style="padding: 0px; border: solid 1px; border-top: none;">
    <table width=100% cellspacing=0 cellpadding=0>
    <tr>
    <td class=content align=Left style="padding: 4px; background: transparent;">
    <b>Bold text that doesn't show</b> More text that doesn't show
    And so on....
    In the header tag of another HTML document that has the same problem, it says it is HTML version 4.0. I have looked up the Java API and found that the javax.swing.text.html package is still 'migrating' towards HTML 4.0 and only supports HTML version 3.2. (Even in the API for Java 1.5 beta, although I use Java 1.4.2)
    So I assume that Java just can't handle my documents! I also think that most of these HTML documents were generated by a program (I think I saw Frontpage in one of the document's meta tags), because when I make my own HTML it doesn't have the problem.
    But it would be nice if my Java program can support these documents, so does anyone have any suggestions as to how I could get these documents to display properly once I apply mark up styles?
    If I haven't explained something properly, I will clarify as it is a complicated program, and I've been driving myself crazy with this problem for several days!

    I was looking through the HTML document removing pieces of code to see where the problem was. I removed all code relating to styles, alignment, width, padding etc, with no luck. The document has several tables, many of them nested, so I added some comments to see where each started and ended. After I added the comments, I checked the document in my Java program again, ran the mark up styles, and it suddenly worked! So I removed each comment one by one, checking each time, until I found the one that made it work. I then tried typing in the same spot, adding an extra space, moving the <tr> tag onto the same line, but only the HTML comment made it work. Here is the part of the document where I added the comment (it's in bold)
    This is the last text that gets displayed! After this
    sentence, text goes same color as background.
    </td>
    </tr>
    <tr height=100% valign=top>
    <td class=panebox colspan=2 align=Left style="padding:
    0px; border: solid 1px; border-top: none;">
    <table width=100% cellspacing=0 cellpadding=0> <!-- This comment makes the document display fine after markup -->
    <tr>
    <td class=content align=Left style="padding: 4px;
    background: transparent;">
    <b>Bold text that doesn't show</b> More text that
    doesn't showDoes anyone know WHY this is happening? It's so weird. I thought if it was something more obvious, like styles, I could just get my program to remove them when reading in the document. But added HTML comments????
    Thank you ^_^

  • I need to syncronize my yahoo email to an app where i can view html esign and read documents

    I need to syncronize my yahoo email to an app that I view html and esign and read documents

    Sounds a good aim, but I don't think Adobe have anything for you.

  • Error while uploading/View the document in sharepooint server

    Dear All,
    I have integrated P68.1 with sharepoint server for document repository and I am facing error while viewing/checkout document from sharepoint server. Here below is the error captured from p6webaccess.html, please sort out this issue .
    com.primavera.common.documents.DocumentNotFoundException: 46B23223-192B-4B18-928E-B0958FF67E9D
    at com.primavera.pvweb.pm.projectcrdocuments.ProjectCRDocumentsAction.b(Unknown Source)
    at com.primavera.pvweb.pm.projectcrdocuments.ProjectCRDocumentsAction.executeGet(Unknown Source)
    at com.primavera.pvweb.BaseAction.execute(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at com.primavera.pvweb.FrontRequestProcessor.processActionPerform(Unknown Source)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    Thanks!.

    I have seen this error before. Usually the cause is the in "Host Name" and "Domain". Verify that the entry is correct for it. Try to use change host name with IP address or vice-versa. Domain should be like "XXXXX" and not "XXX.com"
    Every time you make change you will have to restart the server.
    Also in the Dashboard area under Personal Workspace add "My Document" portlet and try from there and see if you get any different result?
    Sachin Gupta

  • I cannot view HTML attachmants in Firfox that are visible in IE. However, the attachments are visible when I forwarded on the email.

    When I check the the properties of the attachments that Firefox cannot open (but IE can) they show them as Firefox HTML documents. However, the attachment can be viewed when I forward on the email.

    Thank you very much for taking the time to respond to my baffling dilemma. Unfortunately I have no idea what to do with your advice? Is ContentID cid something that I have control over? I suspect that the answer to my problem is elemental and is something very seldom considered by rocket scientist or other like minded intellectuals. It is a reoccurring problem which suggests that it is a fundamental settings error which should be easily solved. I simply need to know which button to press. It is not my intention to appear flippant but simplicity in any response would be appreciated. ,

  • Printer issues for HTML document.

    Hello,
    We are facing a critical problem.In our project we are using sql server 2005,from one of the SP we are generating an HTML document.Ideally this document should be printed in 2 pages.When we print that with Laser JET 2430 printer it gets printed in two pages but when we print that with other version printer it gets printed in four pages.Our client has different version printer due to which they get that document printed in four pages which they want to be in two pages only.
    Workflow of this Document generation is as foloows:
    1)When this SP is executed it generates a HTML document and places at some shared folder.
    2)Then we open the document and apply follwing settings to document in order to view and print it properly as:
    View>>Text Size>>Medium.
    Also check if the size is A4 and margins are set to default values by doing the following.
    Go to
    File>>Page Setup
    Size: A4
    Left: 0.166 Right: 0.166
    Top: 0.166 Bottom: 0.266
    And then click on Print Preview.
    When the document is previwed it should be on two pages only.
    Basically here problem is that document gets printed perfectly when its Top margin is set to 0.166 but each printer has its own minimum Top margin settings due to which in different printers it takes different Top margin values for e.g when we print the document with HP Laser Jet P3005x its minimum Top margin are 0.196 then that document expands to 3 pages.Even we try to set this to 0.166 it gets overwritten with 0.196.
    Can you please tell us what changes should be done to SP which is generating the HTML so that its setting doesnt change printer wise and document gets printed in two pages only.Or else can you please suggest the links of forums where we can discuss this issue.

    Hi
    Quest_RG,
    This is actually very simple question, but it is an CSS question and not sql :-) once you open the HTML document the part of the SQL is over.
    You can use CSS to configure the printing way. using page-break-before and
    page-break-after you can insert CSS breaks where ever you want. for example:
    content here
    <DIV style="page-break-after:always"></DIV>
    content here
    I Hope this will help you,
    [Personal Site] [Blog] [Facebook]

  • HTML document feedback to java

    hi,
    I am trying to load a HTML document into JEditorPane (for viewing only). The HTML document contains a TextField and a Button, is there a way to notify my application whenever the Button is pressed?
    Thank You!

    Wow, it must take quite some time to figure this out:
    http://forum.java.sun.com/thread.jsp?thread=414212&forum=57&message=1885273

  • Cant view html newsletters in mail

    I can seem to be able to view html newsletters in Mail. It strips all the images and formatting only shows links and text. I usually have to click the link found in the text where you can view it online to see the proper formatted document.
    Funny thing is that i used to be able to view them and it seems that all of a sudden i cant view them any more. I havent changed any settings (i dont remember if mail has updated recently but i usually do the updates as soon as i am prompted). The only thing i can see in Mail Preferences that may relate to this is under Viewing where is says "Display remote images in HTML messages" which is already checked.
    I am on Leopard with Mail 3.2
    Any clues anyone?

    I experience the same problem. Mail.app indicates that it can not display html and refers to a url. Strange enough, this also happens with messages sent by Apple.
    I am using Leopard with Mail 3.3

  • Insert pdf into html document

    Hi there,
    I would like to import or insert a pdf file (acrobat) into an
    html document
    and be able to write above and below the document. I have
    copied the document
    into MS paint and saved it as a gif file and inserted it that
    way...Is there any more
    direct way to do this? I have not been able to copy and paste
    directly into DW from
    adobe acrobat....Please advise!!
    Thanks abunch!
    RC

    crash wrote:
    > Adobe Acrobat is a plugin, and as such it requires the
    plug-in to view. You
    > cannot "mix" a pdf and HTML AFAIK. The PDF must be view
    in the PDF
    > application.
    >
    > You can, of course, convert your PDF to any image format
    and place it within
    > your content as you've done.
    >
    > You might try using frames, but I don't know how
    successful that would be
    > (sounds a bit nightmarish to me).
    >
    > HTH,
    >
    > Jon
    >
    > "rcshell" <[email protected]> wrote in
    message
    > news:e48u6r$nmi$[email protected]..
    >> Hi there,
    >> I would like to import or insert a pdf file
    (acrobat) into an html
    >> document
    >> and be able to write above and below the document. I
    have copied the
    >> document
    >> into MS paint and saved it as a gif file and
    inserted it that way...Is
    >> there
    >> any more
    >> direct way to do this? I have not been able to copy
    and paste directly
    >> into
    >> DW from
    >> adobe acrobat....Please advise!!
    >> Thanks abunch!
    >> RC
    >>
    >
    >
    Or you could convert the pdf to FlashPaper, then insert as
    you would an
    image. You choose the size.

  • How to handle the Non HTML Documents in BSP

    Hi All,
    I want to upload the file which contains the  non HTML data.
    I am using the browse button and from the destop i should downloap a file which is non HTML document.
    It would be appriciatable if you send me the code.
    Iam using the html:fileupload tag
    Thanks,
    Mahalakshmi.K

    Hi Rajdeep,
    You can use the below tag which is used to change both the font and color of the text.
    <font face="Book Antiqua,Garamond" size="3" color="red"> YOUR TEXT HERE </font>
    This will work for the normal text which is given between the <font> </font> tags. but not directly with the Text View tag.
    You can choose this as an alternative.
    Thanks,
    Ansar
    Edited by: Ansar Hussain on Dec 3, 2008 9:25 PM

  • Unable to view all documents that have no checked in version due to exceeding the library threshold limit

     due to exceeding the library threshold limit , unable to view all documents that have no checked in version

    Hi niles, Here is a page that details how to retrieve all the files and take ownership of them via powershell to check them in:
    http://www.demantprasad.com/2013/05/manage-files-which-have-no-checked-in.html
    Mathieu Desmarais http://www.matdesmarais.com/

  • After last update, many of my attachments have changed to "Firefox" HTML Document

    I Keep a "master file" on the desktop of genealogy data, and numerous graphics used in e-mails. It appears that about the
    time of the last update to Firefox, many of my graphics, and other information have changed from their original designations (e.g. jpeg,, etc.) to FIREFOX. I can open the files by changing to "open with windows viewer", however if I copy it, after opening, it will not paste into my e-mails. They will not even paste into Paint. What in the world could have occurred?? If it is opened without changing it from Firefox, it only shows gibberish. I attempted to add an image, however even when it has been copied to the desktop it will not show up so I can add it to this message. These items in the file show up as Firefox HTML Document.
    HAVE NEVER HAD AN EXPERIENCE SUCH AS THIS PREVIOUSLY IN THE MANY, MANY YEARS I'VE USED FIREFOX. The icon showing
    up is the FF icon on all of these, and not what was there originally. I have been struggling for quite some time attempting to determine what the problem is.
    ANY AND ALL RECOMMENDATIONS WILL BE MOST APPRECIATED.

    cor-el: The extensions were originally jpg, gif, etc.
    I have been having problems with KEEPING Firefox as my default
    browser, and this is because I noted that it had changed and was
    suddenly NOT my default browser. This has been occurring on a continuous basis after one of the last FF updates. Just long enough, apparently to mess up my graphics, and other information which I have
    kept in my Master Folder. Very disheartening. This occurred every few days, so I continued to keep checking it each time I opened FF, changing it
    back to my default browser.
    Therefore I changed nothing, only noted that many times FF was showing as "not being my default" browser, although it appeared that was, and I do not use the IE although I do have it (for emergencies).
    This, apparently is an insurmountable problem, not of my making, and I do not know how to solve it. I will attempt to go to the link you have provided however I may not have time today.
    Thank you so very, very much for your recommendation, I will see what I can do.

Maybe you are looking for

  • How to delete extra tab space in the flat file??

    Hi all,     I have a flat file on presentation server which has 20000 records. In this file there are 16 fields and distance between each field is different and what I want is each field should have one tab space between another. Thanks & Regards Jer

  • Parsing an xml file using xerces DOM  parser

    Hi I want to parse a simple xml file using DOM parser. The file is <Item>      <SubItem>           <title>SubItem0</title>           <attr1>0</attr1>           <attr2>0</attr2>           <attr3>0</attr3>      </SubItem>      <SubItem>           <titl

  • Data Import/Export

    I am new in SAP. Q: Is it possible to use the importer tool (importing from excel) but change or add fields except from the default ones in order to import more data? Is it any way to link a desire column to this imported tool. If we are not able is

  • Please Fix: copy paste footnotes

    When Apple updated Pages to 5.0 it broke a feature that I and many others use. In using Logos 5.0, software that I use for school and work research, when I copied a section and pasted into the previous version of Pages (including the current version

  • Attaching images to a path

    I know this sounds rather silly, but I am trying to attach a group of images to a path and cannot figure out how to do it. I have a bunch of rectangluar images set up in a straight line, some are at diagonal angles and what not. I have tried using th