on 06-25-2007 1:38 PM
Hello everybody,
I'm developing an application and i need to display a html page inside a view.
I'm developing in SAP NetWeaver Developer Studio, Version: 7.1.0 and UI element like iFrame, or IView does not exists.
Do you have a suggestion, idea or advice?
Thank you,
Constantin
Use LinkTOURL element and set the reference property to the html link you want to open.
Regards
Firasath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
very simple ..
Inclued a iframe element ,
Just in source specify the html page name.
Store the HTML file it in src>MIMEs>Components> if any package appears store it in that
ADjust the height and width as required...
Also on click od linktoUrl u can open that file:
Just specift the complete path as in reference ../../../resources/sap.com/ifrstool/Components/com.sap.ifrs.comp.IFRSComp/Video.html
U can get this path from the page view Source incase u have added any image as such u can get that path from their also just replace the last image name with html page name
i had included video in html page and displayed :
<html>
<head>
</head>
<body>
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="Proton.wmv">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<PARAM name="autostart" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="Proton.wmv" NAME="MediaPlayer" WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
</body>
</html>
Thanks if you need any more info..............reply
hope this works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Constantin,
For writing Html in iFrame u can use com.lowagie.text package and u can use these inbuild classes.
com.lowagie.text.BadElementException;
com.lowagie.text.Cell;
com.lowagie.text.Chunk;
com.lowagie.text.Document;
com.lowagie.text.DocumentException;
com.lowagie.text.Element;
com.lowagie.text.Image;
com.lowagie.text.Paragraph;
com.lowagie.text.Table;
com.lowagie.text.html.HtmlWriter;
com.lowagie.text.rtf.style.RtfFont;
first u have to create a method
like this
private void <method name>() {
try {
String filename = this.<name/id> + ".html";
IPrivateView.IContextElement elem =
wdContext.createContextElement();
elem.setRTFOutPut(getBytesFromFile(new File(filename)));
final IWDCachedWebResource resource =
WDWebResource.getWebResource(
elem.getRTFOutPut(),
WDWebResourceType.HTML);
//resource.setResourceName("HTML_inline.html"); original
resource.setResourceName("HTML_inline"this.<name/id>".html");
resource.setAttachement(false);
resource.setReadOnce(false);
wdContext.currentContextElement().setUrl(resource.getAbsoluteURL());
} catch (WDURLException e) {
logger.errorT(e.getMessage());
wdThis.wdGetPortfolioMessagesInterface().reportError(
"<custom message",
<Parameters>,
true);
//wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
//e.printStackTrace();
}
than for writing in iframe create a method like this.
private void generateIframe() {
String newLine = "";
Document doc = new Document();
String filename = this.<name/id> + ".html";
HtmlWriter html = null;
try {
RtfFont rtffontN = new RtfFont(FONT, FONT_SIZE, RtfFont.NORMAL);
RtfFont rtffont = new RtfFont(FONT, FONT_SIZE, RtfFont.BOLD);
RtfFont headfont = new RtfFont(FONT, 12, RtfFont.BOLD);
DataOutputStream ds =
new DataOutputStream(new ByteArrayOutputStream());
ds = new DataOutputStream(new FileOutputStream(filename));
html = HtmlWriter.getInstance(doc, ds);
//html = HtmlWriter.getInstance(doc,new FileOutputStream(filename));
doc.open();
//now here u can use the classes like Cell ,table,Document for writing the html code in the iFRAME .for more information on this u can refer this site all the api documentation is given here.
http://itext.ugent.be/library/api/
after writing the html code using com.lowagie.text package.
at the end call the method which u declared earlier to this method.and create a context element URL map it to the source of Iframe in properties view.
Please Reward points for an helpfull answer.
Regards,
Siddharth jain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the answer,
...but i don't want to display the page in a window (new or existing).
I want to have the page displayed in one view inside a window.
I want to obtain the old "IFrame effect".
Constantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes,
For example i have a window composed by 3 view and in one view i want to display a html page like www.sap.com.
Regards,
Constantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Do u want to bring an already existing HTML page in a view?
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.