Open a Browser using OO ABAP

Hello,
Is there any way to open and close browser using OO ABAP?
Points will be rewarded for suitable answers.
Regards,
Pagal

Hi this will help u.
OOPs ABAP uses Classes and Interfaces which uses Methods and events.
If you have Java skills it is advantage for you.
There are Local classes as well as Global Classes.
Local classes we can work in SE38 straight away.
But mostly it is better to use the Global classes.
Global Classes or Interfaces are to be created in SE24.
SAP already given some predefined classes and Interfaces.
This OOPS concepts very useful for writing BADI's also.
So first create a class in SE 24.
Define attributes, Methods for that class.
Define parameters for that Method.
You can define event handlers also to handle the messages.
After creation in each method write the code.
Methods are similar to ABAP PERFORM -FORM statements.
After the creation of CLass and methods come to SE38 and create the program.
In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
Example:
REPORT sapmz_hf_alv_grid .
Type pool for icons - used in the toolbar
TYPE-POOLS: icon.
TABLES: zsflight.
To allow the declaration of o_event_receiver before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_receiver DEFINITION DEFERRED.
G L O B A L I N T E R N A L T A B L E S
*DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
To include a traffic light and/or color a line the structure of the
table must include fields for the traffic light and/or the color
TYPES: BEGIN OF st_sflight.
INCLUDE STRUCTURE zsflight.
Field for traffic light
TYPES: traffic_light TYPE c.
Field for line color
types: line_color(4) type c.
TYPES: END OF st_sflight.
TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
DATA: gi_sflight TYPE tt_sflight.
G L O B A L D A T A
DATA: ok_code LIKE sy-ucomm,
Work area for internal table
g_wa_sflight TYPE st_sflight,
ALV control: Layout structure
gs_layout TYPE lvc_s_layo.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container,
o_event_receiver TYPE REF TO lcl_event_receiver.
DATA:
Work area for screen 200
g_screen200 LIKE zsflight.
Data for storing information about selected rows in the grid
DATA:
Internal table
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
C L A S S E S
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Event handler method for event toolbar.
CONSTANTS:
Constants for button type
c_button_normal TYPE i VALUE 0,
c_menu_and_default_button TYPE i VALUE 1,
c_menu TYPE i VALUE 2,
c_separator TYPE i VALUE 3,
c_radio_button TYPE i VALUE 4,
c_checkbox TYPE i VALUE 5,
c_menu_entry TYPE i VALUE 6.
DATA:
ls_toolbar TYPE stb_button.
Append seperator to the normal toolbar
CLEAR ls_toolbar.
MOVE c_separator TO ls_toolbar-butn_type..
APPEND ls_toolbar TO e_object->mt_toolbar.
Append a new button that to the toolbar. Use E_OBJECT of
event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
This class has one attribute MT_TOOLBAR which is of table type
TTB_BUTTON. The structure is STB_BUTTON
CLEAR ls_toolbar.
MOVE 'CHANGE' TO ls_toolbar-function.
MOVE icon_change TO ls_toolbar-icon.
MOVE 'Change flight' TO ls_toolbar-quickinfo.
MOVE 'Change' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'CHANGE'.
PERFORM change_flight.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
ENDCLASS.
S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
SET SCREEN '100'.
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
DATA:
For parameter IS_VARIANT that is sued to set up options for storing
the grid layout as a variant in method set_table_for_first_display
l_layout TYPE disvariant,
Utillity field
l_lines TYPE i.
After returning from screen 200 the line that was selected before
going to screen 200, should be selected again. The table gi_index_rows
was the output table from the GET_SELECTED_ROWS method in form
CHANGE_FLIGHT
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gi_index_rows.
CALL METHOD cl_gui_cfw=>flush.
REFRESH gi_index_rows.
ENDIF.
Read data and create objects
IF go_custom_container IS INITIAL.
Read data from datbase table
PERFORM get_data.
Create objects for container and ALV grid
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
Create object for event_receiver class
and set handlers
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
Layout (Variant) for ALV grid
l_layout-report = sy-repid. "Layout fo report
Setup the grid layout using a variable of structure lvc_s_layo
Set grid title
gs_layout-grid_title = 'Flights'.
Selection mode - Single row without buttons
(This is the default mode
gs_layout-sel_mode = 'B'.
Name of the exception field (Traffic light field) and the color
field + set the exception and color field of the table
gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
gs_layout-info_fname = 'LINE_COLOR'.
LOOP AT gi_sflight INTO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
Value of traffic light field
g_wa_sflight-traffic_light = '1'.
Value of color field:
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
ELSE.
g_wa_sflight-traffic_light = '3'.
ENDIF.
MODIFY gi_sflight FROM g_wa_sflight.
ENDLOOP.
Grid setup for first display
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
CHANGING it_outtab = gi_sflight.
*-- End of grid setup -
Raise event toolbar to show the modified toolbar
CALL METHOD go_grid->set_toolbar_interactive.
Set focus to the grid. This is not necessary in this
example as there is only one control on the screen
CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0200 INPUT
MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN 'EXIT200'.
LEAVE TO SCREEN 100.
WHEN'SAVE'.
PERFORM save_changes.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form get_data
FORM get_data.
Read data from table SFLIGHT
SELECT *
FROM zsflight
INTO TABLE gi_sflight.
ENDFORM. " load_data_into_grid
*& Form change_flight
Reads the contents of the selected row in the grid, ans transfers
the data to screen 200, where it can be changed and saved.
FORM change_flight.
DATA:l_lines TYPE i.
REFRESH gi_index_rows.
CLEAR g_selected_row.
Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
Check if any row are selected at all. If not
table gi_index_rows will be empty
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a line'.
EXIT.
ENDIF.
Read indexes of selected rows. In this example only one
row can be selected as we are using gs_layout-sel_mode = 'B',
so it is only ncessary to read the first entry in
table gi_index_rows
LOOP AT gi_index_rows INTO g_selected_row.
IF sy-tabix = 1.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Transfer data from the selected row to screenm 200 and show
screen 200
CLEAR g_screen200.
MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
LEAVE TO SCREEN '200'.
ENDFORM. " change_flight
*& Form save_changes
Changes made in screen 200 are written to the datbase table
zsflight, and to the grid table gi_sflight, and the grid is
updated with method refresh_table_display to display the changes
FORM save_changes.
DATA: l_traffic_light TYPE c.
Update traffic light field
Update database table
MODIFY zsflight FROM g_screen200.
Update grid table , traffic light field and color field.
Note that it is necessary to use structure g_wa_sflight
for the update, as the screen structure does not have a
traffic light field
MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
g_wa_sflight-traffic_light = '1'.
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
clear g_wa_sflight-line_color.
ELSE.
g_wa_sflight-traffic_light = '3'.
clear g_wa_sflight-line_color.
ENDIF.
MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
Refresh grid
CALL METHOD go_grid->refresh_table_display.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN '100'.
ENDFORM. " save_changes
chk this blog
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
with regards,
Hema Sundara.
reward if found helpful.

Similar Messages

  • Sharepoint foundation 2013: office docs can be opened in browser using IE but not in firefox or chrome?

    Hi
    Sharepoint foundation 2013:
    why when we open an excel or word  using chrome and firefox browser it wants to download the file.
    It can be opened in browser using IE but not in firefox or chrome?
    Any issues?
    Thanks

    Hello MGerio,
    Can you check what your Browser File Handling settings are of the web application (of the excel/word files)?
    http://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-browser-file-handling-deep-dive.aspx
    - Dennis | Netherlands | Blog |
    Twitter

  • How to open a browser using button?

    Hi,experts,
    I create a button in a view in the WDJ.
    I can get a URL through call a webservice when I click the button and I need open a browser using the URL automatically. 
    How can I do it?
    Best regards,
    tao

    Hi Tao,
    You can use the following method of WindowManager in the action assigned to onAction event of your button:
    wdComponentAPI.getWindowManager().createNonModalExternalWindow(String URL,String  title);
    Regards,
    Ajay

  • Xcelsuis SWF - Not able to open in browser using Object TAG

    We want to open Xcelsuis analytic form outside InfoView, by providing user an option to click on link to open analytic directly from application.  We used SSO and Object tag in our custom JSP page. We were able to successfully pass SSO but couldnu2019t load SWF file. Although there wasnu2019t any error in browser while loading JSP page, but Adobe Flash object returns message that movie can't be loaded.
    Open Xcelsuis SWF using documentDownload and passing FlashVars like CELogonToken and CEWebServiceURL.
    Following are the steps:
    u2022     Created JSP file, which first generates logonToken and store in some variable.
    u2022     Generated Flashvars variable using following code:
    String Flashvars = "CELogonToken=" + Encoder.encodeURL(CELogonToken);
    Flashvars+= "&CEWebServiceURL=" + Encoder.encodeURL("http://winiadv22.ams.com:9085/dswsbobje/services/session")
    u2022     Used Flashvars in Object tag.
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=                                                         "http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" WIDTH="100%" HEIGHT="100%" id="myMovieName">
                   <PARAM NAME="movie" VALUE= ="../../opendoc/documentDownload?iDocID=18094&sKind=Flashu201D> <PARAM NAME="quality" VALUE="high"> <PARAM NAME="bgcolor" VALUE="#FFFFFF">
                   <PARAM NAME="play" VALUE="true"> <PARAM NAME="loop" VALUE="true"> <PARAM NAME=bgcolor VALUE="#FFFFFF">
    <PARAM NAME=FlashVars VALUE="<%=Flashvars%>">
                   <EMBED src="../../opendoc/documentDownload?iDocID=18094&sKind=Flash" FlashVars="<%=Flashvars%>" quality=high bgcolor=#FFFFFF WIDTH="100%" HEIGHT="100%" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" play="true" loop="true" PLUGINSPAGE=
                           "http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
                   </EMBED>
              </OBJECT>

    Have you set up a wildcard DNS entry for the spapps.com domain?
    Also if you're trying to connect from the server you might be hitting loop back check issues.

  • Problem opening a browser using applet

    I am trying to open a browser window with the following applet. The applet executes fine with no exception and even prints out the debug statement "Browser Opened" I put, but does not actually open the browser. I am using 1.3.1_05 version of plugin and using Appletviewer. Any suggestions?
    package com.info.applet;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.URL;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    public class TestApplet extends JApplet implements ActionListener {
         public void init() {
              Container cont = getContentPane();          
              JButton b = new JButton("Open Browser");
              cont.add(b);          
              b.addActionListener(this);
         public void actionPerformed(ActionEvent ae) {
              try {
                   getAppletContext().showDocument(new URL("http://www.cnn.com"));
                   System.out.println("Browser Opened" );
              } catch (Exception e) {
                   System.out.println("" + e);
    TestApplet.html
    ======================================================
    <html>
    <body>
    <applet code=com.info.applet.TestApplet.class width="200" height="200" >
    </applet>
    </body>
    </html>

    Hi
    I am doing the same, but using java script to open a new browser window here is the code i am using
    in Applet
    package com.info.applet;
    // import jar file to access javascript object from applet
    import netscape.javascript.*;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.URL;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    public class TestApplet extends JApplet implements ActionListener {
    public void init() {
    Container cont = getContentPane();
    JButton b = new JButton("Open Browser");
    cont.add(b);
    b.addActionListener(this);
    public void actionPerformed(ActionEvent ae) {
    try {
    JSObject win = (JSObject) JSObject.getWindow(this);
    win.eval("javascript:openWindow(\'"www.cnn.com"\')");
    System.out.println("Browser Opened" );
    } catch (Exception e) {
    System.out.println("" + e);
    in HTML
    TestApplet.html
    ======================================================
    <html>
    <head>
    function openWindow(url)
    window.open(url, 'mywindow');
    </head>
    <body>
    <applet code=com.info.applet.TestApplet.class width="200" height="200" >
    </applet>
    </body>
    </html>

  • Opening new browser using button

    Hi there:
    I am trying to insert a link to a webpage which I would like
    to have open in a new browser. I selected 'Open URL or file',
    entered the URL [complete with http] and then selected 'New' from
    the drop down list. When I run the file [I have done this locally
    from my hard drive and am wondering if that may be the issue] and
    click on the button nothing happens.
    As a test I changed the URL to be the location for file and
    it opens the file fine. Do I need to wait until the video is
    implemented on the web before the link will work?
    Thanks!

    public class WindowsProcess
         public static void main(String[] args)
              throws Exception
              String[] cmd = new String[3];
              cmd[0] = "cmd.exe";
              cmd[1] = "/C";
              cmd[2] = "start";
              Process process = Runtime.getRuntime().exec( cmd );
              process = Runtime.getRuntime().exec( cmd );
    }When you run the above code you should get two open dos windows.
    Now just just enter some html filename and hit enter in each window. IE should start up separately in each window.
    Thats also what should happen if you specify the html file as the fourth parameter. A new process should be created and two separate windows should open with a browser in each.

  • Acrobat print window crashed when try to a print the PDF opened through browser

    Hi,
    I have Acobat pro and reader installed on my machine.
    I have set the properties - Open pdf in browser. So, all the PDFs are opening in browser uses Acrobat not the reader.
    And this is way I want. It was woking fine on Windows XP.
    After Windows 7 upgrade, Print option on acrobat (pdf opened in browser), makes browser crashed. Printing window (pop up) appears but looks it is hanged. No OK, cancel buttons appears.
    If I uncheck the acrobat properties - Open pdf in browser, then it works fine. But my other applications which need acrobat in the browser start crashing.
    Is there any property/setting which is restricting print dialog box/ making browser not to respond?
    Please advise.

    Yes, I updated Acrobat through update option last week.
    Acrobat 9.5.2
    Windows 7 64 bit OS
    Adobe Reader XI
    Browser IE 10
    In print window couple of fields which get drop down automatically have blank values.
    Please let me know if you need more information. 
    Arcobat shows proper print window (pop up) if I uncheck the checkbox - Open pdf in browser. And then I open pdf in acrobat and try to print it.

  • Acrobat crashed when try to a print the PDF opened through browser

    Hi,
    I have Acobat pro and reader installed on my machine.
    I have set the properties - Open pdf in browser. So, all the PDFs are opening in browser uses Acrobat not the reader.
    And this is way I want. It was woking fine on Windows XP.
    After Windows 7 upgrade, Print option on acrobat (pdf opened in browser), makes browser crashed. Printing window (pop up) appears but looks it is hanged. No OK, cancel buttons appears.
    If I uncheck the acrobat properties - Open pdf in browser, then it works fine. But my other applications which need acrobat in the browser start crashing.
    Is there any property/setting which is restricting print dialog box/ making browser not to respond?
    Please advise.

    Yes, I updated Acrobat through update option last week.
    Acrobat 9.5.2
    Windows 7 64 bit OS
    Adobe Reader XI
    Browser IE 10
    In print window couple of fields which get drop down automatically have blank values.
    Please let me know if you need more information. 
    Arcobat shows proper print window (pop up) if I uncheck the checkbox - Open pdf in browser. And then I open pdf in acrobat and try to print it.

  • Open file browser?

    Hello all!
    I'm currently trying to create an interactive cd-rom using
    flash. The dilemma I've come across is opening windows' file
    browser to the cd's root. I can get it to open file browser using
    an external .exe file. I'm guessing it's going to have to be
    written in the .exe however, I don't have the expertise to know
    how. I'm guessing one of you flashers on here have accomplished
    this already!
    thanks!
    -E

    I have the same problem! I come up with many solutions and
    researched everything but no luck!
    Did anybody answer to ErOx's question?
    ErOx - have you solved it?

  • Runtime.exec() for openning a browser

    hey guys!!
    I could open a browser using a runtime.exec(). once i have opened it can i use the process.getOuputStream() method to read what is there in the browser.
    How do i communicate with the browser?
    -karthek

    No, getOutputStream will read only what the program writes to standard output. Typically, GUI programs don't even use standard output. The only way you can communicate with processes started by Runtime.exec that I know of is with the Process class.

  • How can I open and close private browsing using an IPAD mini in IOS 7?

    How can I open and close private browsing using an iPad mini in ios7?

    Tap the '+' to the right of the URL field to open a new tab, and at the bottom left of the screen there should be a 'Private' button - tap that and you can then go to the site that you want to go to

  • How to open a pdf file in a web browser using jsp

    Hi,
    I have a problem opening pdf file in browser using jsp.the following is my code.Can anyone help me.Thanks
    response.setContentType("application/pdf");
    String filename="C:\\FictPos\\mypdf.pdf";
    File file = new File(filename);
    FileInputStream in = new FileInputStream(file);
    OutputStream out1=response.getOutputStream();
    byte[] buf = new byte[4096];
    int count = 0;
    while ((count = in.read(buf)) >= 0)
    out1.write(buf, 0, count);
    in.close();
    out1.close();
    }

    Don't know the problem specifically, but here are some suggestions to investigate:
    Does it show anything in the page when you view source on it?
    I would recommend using a servlet rather than a JSP page for this, if only for the fact the JSPs can insert carriage returns into places where you might not want them to. This might screw up the PDF file format?
    Try setting the a link to the jsp, right-click and "save target as..." just to see if it gets any response at all - ie bypass the browser display.
    Good luck,
    evnafets

  • "This form cannot be opened in a web browser. to open this form use microsoft infopath" while adding a new Approval - Sharepoint 2010 and Publishing Approval workflow.

    I am trying to add a new workflow to a document library with the below mentioned settings and getting error saying "This form cannot be opened in a web browser. to open this form use microsoft infopath" while adding a new Approval - Sharepoint
    2010 and  Publishing Approval workflow" . For your information the I have checked the server default option to open in browser.
    Versioning Settings.
    Error
    This is quiet urgent issue . Any help would be really helpful.. Thanks.. 

    Hi Marlene,
    Thank you very much for your suggestions.
    But I am not creating a custom workflow in designer as Laura has mentioned. I am instead trying to create a new Out of the box Approval Workflow and I get the error mentioned above.
    As it works in other environment, I tried figuring out the possible differences which can lead to this error.
    Today I found one difference which is there are no form Templates within Infopath Configurations in Central Admin. Now I am trying to figure out what makes this form templates to be added to the template gallery.
    Regards,
    Vineeth

  • How to open pdf files in browser using flex

    hi,
    my project is having a Document explorer wchich contains pdf
    files,iwant to open it in the browser.can any one tell me how to
    open pdf documents using flex programming(i tried with different
    thing like swf's but my client wants only pdf formatt).

    Another option is by calling a JSP page. This example will
    open a pdf file into a new browser without displaying the download
    "save" prompt.
    Function to call the JSP:
    private function downloadFlyer(event:Event):void {
    var jspLink:URLRequest = new
    URLRequest("jsp/downloadpdf.jsp?fileName=Fundraiser_flyer_2008.pdf");
    navigateToURL( jspLink, "_blank" );
    JSP code:
    <%@ page errorPage="error.jsp" %>
    <%@ page import="java.io.*" %>
    <%
    //Get the parameters
    String downloadFileName=request.getParameter("fileName");
    String fileName = application.getRealPath("/downloads/" +
    downloadFileName);
    File file = new File(fileName);
    if (!file.exists()) {
    throw new IOException("File does not exist.");
    // Get the size of the file
    long length = file.length();
    // You cannot create an array using a long type.
    // It needs to be an int type.
    // Before converting to an int type, check
    // to ensure that file is not larger than Integer.MAX_VALUE.
    if (length > Integer.MAX_VALUE) {
    throw new IOException("File too big.");
    response.reset();
    response.resetBuffer();
    response.setContentType( "application/pdf" );
    response.setHeader ("Content-Disposition", "filename=" +
    downloadFileName);
    //Prevent the Java error: "getOutputStream() has already
    been called for this response"
    out.clear();
    out = pageContext.pushBody();
    InputStream in = new FileInputStream(file);
    OutputStream output = response.getOutputStream();
    try {
    int curByte=-1;
    while( (curByte=in.read()) !=-1){
    output.write(curByte);
    } catch (IOException ioe) {
    ioe.printStackTrace(System.out);
    } finally{
    output.flush();
    in.close();
    response.flushBuffer();
    %>

  • Unable to open .htm file in browser using SharePoint 2013 ?

    On Share Point 2013 we had .htm file which was published under excel as shown below (File name t1.htm)
    As the Icon is different from normal excel file.
    My question is why the .htm file is opening in Excel when we access from SharePoint Web Interface ?
    And when we use the option "Open in Explorer" it opens the .htm file in browser.
    I need the publish .htm file needs to be open in Browser.
    Thanks for reply.

    Looking at this a little more closely, what happens is when you upload the Excel HTM file, a folder is also uploaded to the Library (but hidden outside of the WebDAV view). This folder would be named "t1_files" in your case. If this folder is present (which
    it needs to be as t1.htm references files within it, including all of the sheets), then it will attempt to open with the client application because of the association within C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\XML\DOCICON.xml,
    referring to the line:
    <Mapping Key="Excel.Sheet" Value="ichtmxls.gif" EditText="Microsoft Excel" OpenControl="SharePoint.OpenDocuments" OpenApp="ms-excel" />
    Removing this line will cause it to be treated as a standard HTM file, but I'm not sure how that will work out for your scenario.
    The other option is to install and configure Office Web Apps 2013 on a separate server so you can display Office documents in the browser.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for

  • Replication in SAP R/3 on SQL server

    hi,   We want to read of R/3 data for some legacy system. I know that there are many ways for this matter but is there any limitation for one-side replication of data in SAP R/3 to a middle ware database? We use MS SQL server as R/3 RDBMS. Thanks a l

  • Problem saving a pdf in illustrator

    When I save a pdf file in Illustrator I get a sign saying "This file has no program associated to perform this action. Install the appropriate program or, if you already have it installed, create an association in the Control Panel Programs defaults

  • When installing adobe to iPod, Where is the 'Open With' in safari?

    Couldn't find Open With, help.

  • Migrating workflows from a 4.7 system to ECC 6.0 system

    Hi, I have workflows in a 4.7 system which will get used in a newly upgrade to ECC 6.0. Has anyone had problems with this? Is it okey to transport an old workflow to be used in a 6.0 system? What do I have to bear in mind when doing this and is it ea

  • Evaluation Path for View of Organizational Structure

    Hi all, I am trying to define new VIEWID using EVPATH which would do the following filtering (by using f.m. HRWPC_GET_NAV_SUBTREE): giving org.unit number, it would return employees of current org unit and in case that there are some sub org units  w