Display image in struts
Hi
i am new in struts and i have a image in my data base but i am unable to show that image in struts
what i did tilll now is
i get that images content as binary data and make the InputStream object
but when i try to write that InputStreams data it will not work and didnt show any image
i set the content type image/gif but still facing problem
can any one tell me the solution
thanks alot
lQuery = "Select ItemName,CategoryId,Item_image,item_Desc2 from item_master where ItemId='00c63f38-95d9-1028-b9d1-cb9eb7b97c40' and CategoryId='1823bc79-726e-1028-b4b9-b993b5d1f868'";
lStatement = lDAOFactory.getStatement(lConnection);
lResultSet = (ResultSet) lDAOFactory.executeQuery(lQuery, null, null, DAOFactory.SQLTYPEQUERY,lConnection, lStatement);
while(lResultSet.next())
Blob blob = lResultSet.getBlob("item_image");
InputStream istream = blob.getBinaryStream();
result.setM_inStreamItem_Image(istream);
this retrieve the image from the data base
InputStream istream =l_CatalougeItem.getM_inStreamItem_Image();
if(istream!=null)
OutputStream out= response.getOutputStream();
byte dataBytes[] = new byte[istream.available()];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < istream.available())
byteRead = istream.read(dataBytes, totalBytesRead, istream.available());
totalBytesRead += byteRead;
out.write( dataBytes );
it write the image in the socket
Similar Messages
-
How to display Image as Error instead of Error Message from Resource Bundle
hi,
I want to display images as error instead of error message from Application Properties in struts1.1
Ex:
I want to prompt a user to type password length min. of 6 char. If failed, need to show simple image as error rather
"Length should be min. 6".
reagrds
parthiban.BalusC wrote:
RahulSharna wrote:
in the respective resource bundle modify the value by something was below
error.password.length=<img src="/images/password-Length.gif" alt="Password Length Issue" align="center"/>
OK, it apparently allows HTML in error messages.Yes struts allows it :) -
ClasscastException while displaying image from content selector
Hi,
My requirement is show an image gif file in jsp, through portal.
This problem is specific to 8.1 version.
Created an image type content in BEA repository which i could retrieve from workshop
content preview correctly, with a rule (named filerule).
However, when tried to display the same from a simple jsp logic, got classcast
exception.
Below is the steps i have done.
1. import <%@ page import="com.bea.p13n.content.ContentHelper"%>
2.
<pz:contentSelector rule="filerule" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
id="ImageDocs"/>
<es:forEachInArray array="<%=ImageDocs%>" id="anImageDoc" type="com.bea.p13n.content.Content">
<img src="ShowDoc/<cm:printProperty
id="anImageDoc" name="identifier" encode="url"/>"
</es:forEachInArray>
The server console shows below exception:
java.lang.ClassCastException
at jsp_servlet.__index6._jspService(index6.jsp:19)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
er.java:208)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:305)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
FlowRequestProcessor.java:1304)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
ctor.forward(PageFlowRequestProcessor.java:1320)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
wRequestProcessor.java:1200)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processForwardCon
fig(PageFlowRequestProcessor.java:1094)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:279)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
equestProcessor.java:651)
at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
sterActionServlet.java:527)
at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
onServlet.java:152)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:305)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
FlowRequestProcessor.java:1304)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
ctor.forward(PageFlowRequestProcessor.java:1320)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
wRequestProcessor.java:1200)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
equestProcessor.java:638)
at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
sterActionServlet.java:527)
at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
onServlet.java:152)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6356)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
Also, there is no luck with displaying text content from a file, using printDoc
tag. Can some one point me to right resource.Hi panji,
I used 7.0 tag lib, just to make use of "printDoc" tag which is available in 7.0version
only and not in 810. However, i figured out a way to display image using 8.1 (
of course, by using request.getContextPath() + "/ShowBinary" + imagedoc.getPath())
But still, i do not find a way to display a doc type file in jsp, which is my
original problem.
As per the edocs at http://edocs.bea.com/workshop/docs81/doc/en/core/index.html,
<cm:getProperty node="<%=doc_node%>" name="file"/>
should be able to display a txt file but nothing is getting rendred onto jsp.
( i have created a book type content in the repo. and file attached is of type
txt ).
Can you pls give some clue what i am missing here?
thanks
Ramana
"Panji Aryaputra" <[email protected]> wrote:
Hi Ramana, could you just use the ShowPropertyServlet to display the
image
in jsp? That's what I am using now. Perhaps you have other reasons not
to
use it?
panji.a
"ramana" <[email protected]> wrote in message
news:[email protected]...
Hi,
My requirement is show an image gif file in jsp, through portal.
This problem is specific to 8.1 version.
Created an image type content in BEA repository which i could retrievefrom workshop
content preview correctly, with a rule (named filerule).
However, when tried to display the same from a simple jsp logic, gotclasscast
exception.
Below is the steps i have done.
1. import <%@ page import="com.bea.p13n.content.ContentHelper"%>
2.
<pz:contentSelector rule="filerule"contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
id="ImageDocs"/>
<es:forEachInArray array="<%=ImageDocs%>" id="anImageDoc"type="com.bea.p13n.content.Content">
<img src="ShowDoc/<cm:printProperty
id="anImageDoc" name="identifier" encode="url"/>"
</es:forEachInArray>
The server console shows below exception:
java.lang.ClassCastException
at jsp_servlet.__index6._jspService(index6.jsp:19)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atcom.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
er.java:208)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atweblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:305)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
FlowRequestProcessor.java:1304)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
ctor.forward(PageFlowRequestProcessor.java:1320)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
wRequestProcessor.java:1200)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processForwardCon
fig(PageFlowRequestProcessor.java:1094)
atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:279)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
equestProcessor.java:651)
atcom.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
sterActionServlet.java:527)
atcom.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
onServlet.java:152)
atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atweblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:305)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
FlowRequestProcessor.java:1304)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
ctor.forward(PageFlowRequestProcessor.java:1320)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
wRequestProcessor.java:1200)
atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
equestProcessor.java:638)
atcom.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
sterActionServlet.java:527)
atcom.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
onServlet.java:152)
atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
r.java:313)
atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6356)
atweblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
atweblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3635)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
Also, there is no luck with displaying text content from a file, usingprintDoc
tag. Can some one point me to right resource. -
Open and display image in MVC layout
Hello!
I cant figure out how I shall do this in an MVC layout:
The program request user to open an image file that are then displayed in a JLabel
My setup at the moment resolve in a nullpointerexeption because it dont get any actual image file, but I dont understand what I have missed.
I can not post the whole code fo you to run because it is to big, so I post the part that are the most important. please have a look.
PicturePanel
//Import Java library
import javax.swing.*;
import java.awt.*;
public class PicturePanel extends JPanel {
//Variables
private ImageIcon picture;
//Method to get information of the selected file
PicturePanel (String fileName) {
picture = new ImageIcon (fileName); //Get the filename
int w = picture.getIconWidth(); //Get the image with
int h = picture.getIconHeight(); //Get the image height
//Set preferable size for the image (Use the properties for the selected image)
setPreferredSize(new Dimension(w, h));
setMinimumSize(new Dimension(w, h));
setMaximumSize(new Dimension(w, h));
//Method to draw the selected image
protected void paintComponent(Graphics g) {
super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
}From my model:
//Local attributes
boolean check = false; //Used to see if a statement is true or not
PicturePanel pp;
JFileChooser fc;
int returnVal;
//newFile in File menu
public void newFile() {
//Open a file dialog in users home catalog
fc = new JFileChooser();
//In response to a button click:
returnVal = fc.showOpenDialog(pp);
System.out.println("You pressed new in file menu");
}From my controler:
//User press "New" in File menu
else if (user_action.equals("New")) {
//Call method in model class
model.newFile();
//Update changes
if (model.returnVal == JFileChooser.APPROVE_OPTION) {
System.out.println("Hello1");
File f = model.fc.getSelectedFile();
if (model.pp != null)
model.pp = new PicturePanel(f.getAbsolutePath());
System.out.println("Hello2");
//Display image (Here is line 83)
view.setImage_DisplayArea(model.pp);
System.out.println("Hello3");
}From my view:
//Sets the image to be displayed on the image_display area (Here is line 302)
public void setImage_DisplayArea(PicturePanel pp) {
image_display.add(pp);
}The complet error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:1015)You pressed new in file menu
Hello1
Hello2
at java.awt.Container.add(Container.java:351)
at View_Inlupp2.setImage_DisplayArea(View_Inlupp2.java:302)
at Control_Inlupp2.actionPerformed(Control_Inlupp2.java:83)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050)
at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091)
at java.awt.Component.processMouseEvent(Component.java:5602)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3129)
at java.awt.Component.processEvent(Component.java:5367)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4068)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1801)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Edited by: onslow77 on Dec 16, 2009 5:00 PM
Edited by: onslow77 on Dec 16, 2009 5:04 PMHello again!
Anyone that can help me figure out how to implement this in an MVC layout, I feel stuck.
I post a little program that open and display an image file so that you better can understand what I whant to do.
ShowImage
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import javax.swing.filechooser.*;
public class ShowImage extends JFrame{
//Variables
JFileChooser fc = new JFileChooser();
PicturePanel pp = null;
ShowImage () {
super("Show"); //Title
//Create the GUI
JPanel top = new JPanel();
add(top, BorderLayout.NORTH);
JButton openBtn = new JButton("Open");
top.add(openBtn);
openBtn.addActionListener(new Listner());
//Settings for the GUI
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setVisible(true);
class Listner implements ActionListener {
public void actionPerformed(ActionEvent ave) {
int answer = fc.showOpenDialog(ShowImage.this);
if (answer == JFileChooser.APPROVE_OPTION){
File f = fc.getSelectedFile();
//Check
System.out.println(f);
System.out.println(pp);
if (pp != null)
remove(pp); //Clean so that we can open another image
//Check
System.out.println(pp);
//Set the PicturePanel
pp = new PicturePanel(f.getAbsolutePath());
//Check
System.out.println(pp);
//Add PicturePanel to frame
add(pp, BorderLayout.CENTER);
validate();
pack();
repaint();
//Main
public static void main(String[] args) {
new ShowImage();
}PicturePanel
//Import Java library
import javax.swing.*;
import java.awt.*;
public class PicturePanel extends JPanel {
//Variables
private ImageIcon picture;
//Method to get information of the selected file
PicturePanel (String fileName) {
picture = new ImageIcon (fileName); //Get the filename
int w = picture.getIconWidth(); //Get the image with
int h = picture.getIconHeight(); //Get the image height
//Set preferable size for the image (Use the properties for the selected image)
setPreferredSize(new Dimension(w, h));
setMinimumSize(new Dimension(w, h));
setMaximumSize(new Dimension(w, h));
//Method to draw the selected image
protected void paintComponent(Graphics g) {
super.paintComponent(g); //We invoke super in order to: Paint the background, do custom painting.
g.drawImage(picture.getImage(), 0, 0, this); //Draw the image at its natural state
}//The endEdited by: onslow77 on Dec 16, 2009 7:30 PM -
Hi everyone, I am a newbie for labview. I just wanna ask you about image display in labview. Now I can display one image in my front panel. I open the file path and display it. First thing I wanna do is that is it possible to display on monitor full screen not on front panel and second thing is that how can I display images in folder and display it about 2 seconds delay in between? Pls kindly help me.
Thanks millions.
Solved!
Go to Solution.Hi there,
-I don't know whether the image full display can be possible or not, Any reason why you are asking for such requirement?
-The other question about reading files in a folder and display for 2sec can be done like shown in image.
-I've attached vi in lv 12 if needed.
-Next time, please post your vision related queries in Machine vision Board.
Thanks
uday,
Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
Certified LabVIEW Associate Developer (CLAD) Using LV13
Attachments:
Image_read_folder.vi 43 KB -
Display image in java.awt.List
hello guys,
How i can display image in java.awt.List means listbox. give me sample code. if you have
Waiting for your favorable reply.
Regards,
Bhavesh Kharwajava.awt.List you can not.
javax.swing.JLast you can. -
How to create a report in Form line Style and can display Image field?
Hi,
In Report builder 10g, I would like to create a Report with Form Line Style and this report included a Image field.
I can choose this Style only when Select Report type is Paper Layout. Because, If I choose Create both Web & Paper Layout or Create Web Layout only then in the next Style tab 03 option Form, Form letter and Mailing Label be Disabled.
But in Paper Layout, my report can not display Image field.
I tried with Web layout and all the other Styles (Except 03 mentioned be Disabled) then all Styles are displayed Imager field OK.
How to create a report in Form line Style and can display Image field?
I was change File Format property of my Image field from text to Image already in Property Inspector. But report only showed MM for my Image field.
Thanks & regards,
BACH
Message was edited by:
bachnpHere you go..Just follow these steps blindly and you are done.
1) Create a year prompt with presentation variable as pv_year
2) Create a report say Mid report with year column selected 3 times
- Put a filter of pv_year presentation variable on first year column with a default value say @{pv_year}{2008}
- Rename the second time column say YEAR+1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)+1
- Rename the second time column say YEAR-1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)-1
Now when you will run Mid Report, this will give you a records with value as 2008 2009 2007
3) Create your main report with criteria as Year and Measure col
- Change the fx for year column as CAST(TIME_DIM."YEAR" AS INT)
- Now put a filter on year column with Filter based on results of another request and select these:
Relationship = greater than or equal to any
Saved Request = Browse Mid Report
Use values in Column = YEAR-1
- Again,put a filter on year column with Filter based on results of another request and select these:
Relationship = less than or equal to any
Saved Request = Browse Mid Report (incase it doesn't allow you to select then select any other request first and then select Mid Report)
Use values in Column = YEAR+1
This will select Year > = 2007 AND Year < = 2009. Hence the results will be for year 2007,2008,2009
This will 100% work...
http://i56.tinypic.com/wqosgw.jpg
Cheers -
Problem Displaying Images in a JFrame
I am writing a program that displays images on a JFrame window. I have been reading the other postings about this topic however I have not been able to make my code work. I am hoping there is some obvious solution that I am not noticing. Please help, I am very confused!
public class WelcomeWindow {
private JLabel label;
private ImageIcon logo;
public WelcomeWindow() {
label = new JLabel();
logo = new ImageIcon("/images/logo.gif");
label.setIcon(logo);
this.getContentPane().add(label);Instead of a JLabel, have you tried to use a JButton containing the Icon?
Also (but I think you've done it already), you could do that :
File iconFile = new File("/images/logo.gif");
if (!iconFile.isFile()) {
System.out.println("Not a file");
That way you'll be certain that the path given is correct.
Hope this helps. -
Display image in sub_VI
I am running a Linux (no NI Vision support) LabVIEW application where I have a “main” DAQ VI collecting raw u8 data. I want to be able to display the data as an image in a sub-VI. The first time I call the sub-VI to display the first image everything works fine, however, on the second and subsequent calls to the sub-VI I get an error saying that the sub-Vi is already open and needs to be closed before being called. I don’t have the screen space to adequately display images in the main VI and still have the DAQ controls visible.
Is there a way to have one VI continuously collect and format image data and then display the data in a second VI?
Thanks in advanceThank you for the reply
In the example you provided the sub-VI is called, executes, and terminates. I need to be able to repeatedly call a sub-VI that does not terminate. I need to do this so that I can update an image and allow an operator to view the image (and perform event functions on the image such as mouse click).
Is there a way for a main VI to call a sub-VI and not have to pend (wait) for the sub-VI to complete execution?
Is there a way to call (i.e. pass data) to a sub-VI that is already running?
Thank you again for your help -
How can i Display images with may own table
Hi
I want display images with my own table. How can I use in this query.
SELECT '<a href="#" onclick="javascript:'
|| 'getImageHeight(''my_img'
|| '#ROWNUM#'');javascript:redirect'
|| '(''f?p=&APP_ID.:212'
|| ':&SESSION.:DISPLAY:NO::P212_IMAGE_ID:'
|| ID
|| ''');">'
|| '<img src="#IMAGE_PREFIX#edit.gif" '
|| 'alt="Edit"></a>' ID,
'<img id="my_img'
|| '#ROWNUM#" src="#WORKSPACE_IMAGES#'
|| filename
|| '"/>' image
FROM wwv_flow_filesThanks
Nr
Edited by: user10966033 on Sep 28, 2009 1:41 PMYou don't use #workspace_images# since that is for STATIC files, not images in a table..
see this thread for help: Re: Display image from blob
Thank you,
Tony Miller
Webster, TX -
Display image in classical report
Experts,
Please share how to display image stored in SO10 in to a classical report??Hi
check this
In the transaction OAOR, you should be able to insert your company Logo.
GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
FORM TOP-OF-PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING[]
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID ='GT_LIST_TOP_OF_PAGE'.
ENDFORM. "TOP-OF-PAGE
Here 'ENJOYSAP_LOGO' will replace by ur created logo.
Refer this link
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm
http://www.sap-img.com/abap/alv-logo.htm
http://www.sap-img.com/fu002.htm
Re: Logo on Login screen
Re: To change image into main menu of sap
Regards
Anji -
Display image in detail groups in jheadstart 11.1.1.3.35
Hi, I've been trying to make a project that should display one picture in one of the detail groups. but when i generate the jheadstart definition editor and run the project, it shows an empty box for the image (image is not loaded).
I've seen the source code and every thing seems right and when i use that detail group as a master group the image display just fine.
is jheadstart 11g have a problem for displaying image in detail groups? because I've heard this option works in 10g pretty fine.
please help me how i can fix this problem and i have to say my project deadline is coming :(We are not aware of such a problem.
To really check whether it is related to a detail group, can you temporarily make the detail group a top-level group, generate and run your application to see whether the problem goes away?
Make sure you first uncheck the Same Page checkbox before you drag and drop the detail group to become a top group.
There is a known ADF issue that when you upload a new image, the new image is only shown when you restart the session.
Steven Davelaar,
JHeadstart Team. -
Hi,
My requirement is to create a web dynpro application where the first view contains all images stored in ECC along with one button (Display image). When the user clicks on the button Display image then another view should display the image on the screen.
I have created View1 with a table,which display the details of the table STXBITMAPs in it,when i select a row and press a button second view is displayed with a UI conatiner of type IMAGE.
Basiccaly when button on view1 is pressed, I get the value of the TDNAME field via lead_selection method and set this value to a global attribute, whch inturn is copied into second view and bonded to the SOURCE attribute of the UI element.
My problem is , that global attribute is being updated probley and value have been passed to second view..but Image is not being displayed on the screen.
Can anyone help me out in this.
Thanks in advance.
PoojaYou don't necessarily have to move your images from STXBITMAPS to the MIME repository. You can display any image - not just those in the MIME repository, by placing the content in the ICM Cache. This creates a temporary URL for any content. So you just need to read the binary content of the image from STXBITMAPS into a XSTRING variable. From there you can use this code sample to put the content in the cache and generate a URL:
****Create the cached response object that we will insert our content into
data: cached_response type ref to if_http_response.
create object cached_response
type
cl_http_response
exporting
add_c_msg = 1.
* cached_response->set_compression( options = cached_response->IF_HTTP_ENTITY~CO_COMPRESS_IN_ALL_CASES ).
try. " ignore, if compression can not be switched on
call method cached_response->set_compression
exporting
options = cached_response->co_compress_based_on_mime_type
exceptions
others = 1.
catch cx_root.
endtry.
****set the data and the headers
data: l_app_type type string.
data: l_xstring type xstring.
cached_response->set_data( me->gx_content ).
l_app_type = 'image/x-ms-bmp'.
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = l_app_type ).
****Set the Response Status
cached_response->set_status( code = 200 reason = 'OK' ).
****Set the Cache Timeout - 60 seconds - we only need this in the cache
****long enough to build the page and allow the IFrame on the Client to request it.
cached_response->server_cache_expire_rel( expires_rel = i_cache_timeout ).
****Create a unique URL for the object
data: guid type guid_32.
call function 'GUID_CREATE'
importing
ev_guid_32 = guid.
concatenate i_path '/' guid '.' i_format into r_url.
****Cache the URL
cl_http_server=>server_cache_upload( url = r_url
response = cached_response ). -
Hi,
I want to display image link in one of the columns in report.
ex: if i click that image it should go to google maps.
I stored the image in /res/s_protal/image.jpg and also in oc4j.
I know to fmap to show it only once.
but i want to reflect it in all the rows of a column.
Things i tried:
Stored in the same machine took the ip addres and prot and given as below it was working.
But if i move it to other machines then it getting failed so again i want to update the machine ip.
http://225.225.225.225:9704/analytics/res/s_proact/images/images.jpg
Is there any possible way to give some common syntax so that the corresponding machine ip will be pointed once the
report moved to different machines.
Thanks,
satheeshHi Santeesh,
I just saw your post and I thought I'd ask you with my query:
I want to add some pop-up info on some of the data when the user hover on it. have you
got a clue what do I need to do for that?
Cheers,
Yonatan -
Display image in JPanel without saving any file to disk
Hi,
I am fetching images from database. I am saving this image, display in JPanel and delete it. But this is not actually I want.
I wish to fetch this image as stream , store in memory and display in JPanel without saving any fiel in disk.
I wonder if it is Possible or any used implementation that I can use in my project. Any idea or experienced knowledge is enough.
ThanksIn what format is the image coming to you from the database? If it's an InputStream subclass, just use javax.imageio.ImageIO:
InputStream in = getImageInputStream();
BufferedImage image = null;
try {
image = ImageIO.read(in);
} finally {
in.close();
// ... Display image in your JPanel as you have beenIf you receive the image as an array of bytes, use the same method as above, but with a ByteArrayInputStream:
byte[] imageData = getImageData();
ByteArrayInputStream in = new ByteArrayInputStream(imageData);
BufferedImage image = null;
try {
image = ImageIO.read(in);
} finally {
in.close();
// ... Display image in your JPanel as you have been
Maybe you are looking for
-
Open a SAPGUI transaction from a Java web application
Hi all, We are in the process of developing a Java based web application with SAP J2EE engine - but not SAP Enterprise Portal. One of the requirements we have is from one of the web screens there needs to be a button which launches SAPGUI and take
-
Problem in Search Help[F4] - Values Not being Dsplayed
Hi, Search help values are not being displayed. F4 help pop up is being displayed with the text on top: ' xxxx number of entries found". But no values are visible in that popup where it normaly displayes all values for selection. This is happening wi
-
Telnet, rlogin, ssh not ok on sun 240 with solaris 5.10 on it
Hello, I am facing some problems with connecting througth telnet, rlogin or ssh on a SUN 240 server carying solaris 10 software on it. When I try to connect througth the serial port, it gives me this error: telnet 10.151.145.6 2100Trying 10.151.145.6
-
Is there a way to show Custom message in Outlook Mail read Inspector Window same as When a File is opened in Protected View. If we open a Document from Untrusted location,the file is opened in Protected mode and a Red Message bar is shown below the r
-
DWM: only display workspaces with windows in them (in the status bar)
I was wondering if anyone either had a patch or had a few hints about the source in order to accomplish displaying only those workspaces with windows on them. I am willing to edit the source (dwm.c) but have no idea where to start.