Store and display value in array
Hello Experts!
I need help with outputting a report that caculate the cost base on the quantities from 1 to 100 ( SummaryOfCost = QtyCost * Qty ).
I have tried to implement this with an array but always get "A subscript must be between 1 and the size of the array" error.
What is the best way to accomplish this by your experience? I would REALLY appreciate any help and thankful for all the support I've received in my previous post!
Thank you so much!
Lin
Sample Data:
PartNo ItemName QtyCost( per one Qty)
001 A $1
B $2
C $3
D $4
G $5
u2026 . .
002 A $1.1
B $2.1
C $3.2
D $4.3
G $5.6
u2026 . .
The resuld should be :
PartNo ItemName Qty SummaryOfCost
001 A 1 $1
2 $2
3 $3
4 $4
5 $5
100 $500
B 1 $2
2 $4
3 $6
100 $200
C ..........
002 A
Edited by: xtan57 on Jul 30, 2010 6:14 PM
Edited by: xtan57 on Jul 30, 2010 6:15 PM
Edited by: xtan57 on Jul 30, 2010 6:17 PM
Edited by: xtan57 on Jul 30, 2010 6:26 PM
Edited by: xtan57 on Jul 30, 2010 6:26 PM
Edited by: xtan57 on Jul 30, 2010 6:34 PM
Edited by: xtan57 on Jul 30, 2010 6:39 PM
Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551
Similar Messages
-
Re: [SunONE-JATO] Re: Using an object to store and display data
Personally, I think there is little or no value to creating a "domain"
object that itself relies on a JATO QueryModel internally, but hides that
fact and requires use of BeanAdapterModel.
It would be more appropriate (and much less work, and more scalable) to just
derive a QueryModel subclass and add the domain-specific behavior to the
model. In other words, what's the point of creating an object that hides
JATO inside it when you're running in JATO to begin with? Now if the domain
object were doing plain JDBC, and thus trying to be JATO independent, that
would be different. However, you could still implement the Model interface
on the object (or use BeanAdapterModel) to integrate it seamlessly with the
View tier.
Todd
----- Original Message -----
From: "grschroeder" <grschroeder@y...>
Sent: Wednesday, July 31, 2002 12:00 PM
Subject: [SunONE-JATO] Re: Using an object to store and display data
Craig,
I think it all finally makes sense. First, your assumption is
correct regarding the process flow. The ViewBean will interact with
a custom Javabean which will then in turn interact with a SQL Model
to access the database. So now let me make sure I understand what I
need to do. Basically the custom Javabean will have a method to get
the SQLModel. I would then invoke the setValue method on the
SQLModel and call the appropriate execute method( e.g.,
executeUpdate, etc. ) just like I would do from a ViewBean. Does
this sound correct?
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
Greg,
see below...
grschroeder wrote:
Thanks for the help Craig. I looked at the sample code that makes
use of the BeanAdapterModel. Basically it looks like it allows a
view to interact with a bean the same way it would interact with
any
other model. That part I think I understand.
This is correct.
The part I'm a little
unclear on still is how to interface this BeanAdapterModel( which
is
a very basic model ) that I now have with a query model toactually
interact with the database.
Not sure what you mean by "interface this BeanAdapterModel ... witha
query model". Does this mean that you have a ViewBean the interactswith
a custom JavaBean via the BeanAdpterModel wrapper, and from the
JavaBean you are interacting with the SQL Model?
So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
SQL Model > RDBMS
That's what I am reading anyway. Please explain this to me.
Would I need to make direct JDBC calls
from my custom model instead of letting JATO dynamically create
the
calls for me?
If my assumptions above are correct, then the custom JavaBean cansimply
use the SQL Model in exactly the same manner as the ViewBean,otherwise,
if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
which is fine, if you do it "right" (connection pooling, result set
handling, etc.).
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
I think the best approach would be to treat your Domain Objects
(DO) as
the Database (the enterprise tier) from JATO's perspective. You
could
create custom models that interface with our DO's and then the
JATO
Views could easily bind to the custom DO models just like anyother
model. This should eliminate the need for pushing data/objectsfrom
>
view
to model to database.
There is a JATO class called BeanAdapterModel that might be just
what
you need, however, I am not experienced with using it. Maybe
someone
else on my team or in the community could better explain how to
use
>
this
class.
craig
grschroeder wrote:
Venki,
Thanks for the response. Actually, I'm not sure if I can answer
all
of your questions because those are some of the same questions
that
we're trying to answer ourselves. Basically, what we're trying
to
>do
is incorporate our domain object model into the JATO framework.
My
thinking was that one way we could accomplish this was by
storing
>a
Javabean object in the HTTPSession to represent an object in the
domain model, and that the Viewbean and JATO Model could get and
set
data from there. If you have a better suggestion of how to
accomplish this, I'm definitely open to hearing it.
Thanks,
Greg
--- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
OK grschroeder , first let me get this straight:
0. Are you going to pass this object to the model, or are u
going
>
to pass the session object to the model?
1. Is there any specific reason for this approach you are
taking?
2. Will there be a notification from the object u havementioned
>to
have the model persist the data?
3. What about the reverse case, when the model refreshes the
data,
how are you going to refresh you object?
4. The JavaBean Object that u are talking about, is it your own
object or is it implementation of an existing JATO interface?
~Venki
grschroeder wrote:I'm fairly new to JATO, but I think I now
have
>a
basic understanding
of how Viewbeans and Models interact. However, I want to
incorporate
the use of a Javabean object that will be stored in the HTTP
session
and will act as the connection between the Viewbean and Model
instead
of having the Viewbean and Model interact directly with each
other.
Basically I would like to have the Model set data in the object
stored in the session so that the Viewbean can pull it out to
display
it. And vice versa, once the user modifies the data and is
ready
>
to
persist it, I would like to have the Viewbean set data in the
object
stored in the session so that the Model can pull it out to
store
>it
in the database. I'm not sure what the best approach would be
to
accomplish this. Any help you could give would be greatly
appreciated.
Thanks,
Greg
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
Venki
IT Solutions
#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
91-44-4925740(Home) 91-44-8212877(Work)
* Luck is what happens when Preparation meets Opportunity.
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspPersonally, I think there is little or no value to creating a "domain"
object that itself relies on a JATO QueryModel internally, but hides that
fact and requires use of BeanAdapterModel.
It would be more appropriate (and much less work, and more scalable) to just
derive a QueryModel subclass and add the domain-specific behavior to the
model. In other words, what's the point of creating an object that hides
JATO inside it when you're running in JATO to begin with? Now if the domain
object were doing plain JDBC, and thus trying to be JATO independent, that
would be different. However, you could still implement the Model interface
on the object (or use BeanAdapterModel) to integrate it seamlessly with the
View tier.
Todd
----- Original Message -----
From: "grschroeder" <grschroeder@y...>
Sent: Wednesday, July 31, 2002 12:00 PM
Subject: [SunONE-JATO] Re: Using an object to store and display data
Craig,
I think it all finally makes sense. First, your assumption is
correct regarding the process flow. The ViewBean will interact with
a custom Javabean which will then in turn interact with a SQL Model
to access the database. So now let me make sure I understand what I
need to do. Basically the custom Javabean will have a method to get
the SQLModel. I would then invoke the setValue method on the
SQLModel and call the appropriate execute method( e.g.,
executeUpdate, etc. ) just like I would do from a ViewBean. Does
this sound correct?
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
Greg,
see below...
grschroeder wrote:
Thanks for the help Craig. I looked at the sample code that makes
use of the BeanAdapterModel. Basically it looks like it allows a
view to interact with a bean the same way it would interact with
any
other model. That part I think I understand.
This is correct.
The part I'm a little
unclear on still is how to interface this BeanAdapterModel( which
is
a very basic model ) that I now have with a query model toactually
interact with the database.
Not sure what you mean by "interface this BeanAdapterModel ... witha
query model". Does this mean that you have a ViewBean the interactswith
a custom JavaBean via the BeanAdpterModel wrapper, and from the
JavaBean you are interacting with the SQL Model?
So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
SQL Model > RDBMS
That's what I am reading anyway. Please explain this to me.
Would I need to make direct JDBC calls
from my custom model instead of letting JATO dynamically create
the
calls for me?
If my assumptions above are correct, then the custom JavaBean cansimply
use the SQL Model in exactly the same manner as the ViewBean,otherwise,
if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
which is fine, if you do it "right" (connection pooling, result set
handling, etc.).
Thanks,
Greg
--- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
wrote:
I think the best approach would be to treat your Domain Objects
(DO) as
the Database (the enterprise tier) from JATO's perspective. You
could
create custom models that interface with our DO's and then the
JATO
Views could easily bind to the custom DO models just like anyother
model. This should eliminate the need for pushing data/objectsfrom
>
view
to model to database.
There is a JATO class called BeanAdapterModel that might be just
what
you need, however, I am not experienced with using it. Maybe
someone
else on my team or in the community could better explain how to
use
>
this
class.
craig
grschroeder wrote:
Venki,
Thanks for the response. Actually, I'm not sure if I can answer
all
of your questions because those are some of the same questions
that
we're trying to answer ourselves. Basically, what we're trying
to
>do
is incorporate our domain object model into the JATO framework.
My
thinking was that one way we could accomplish this was by
storing
>a
Javabean object in the HTTPSession to represent an object in the
domain model, and that the Viewbean and JATO Model could get and
set
data from there. If you have a better suggestion of how to
accomplish this, I'm definitely open to hearing it.
Thanks,
Greg
--- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
OK grschroeder , first let me get this straight:
0. Are you going to pass this object to the model, or are u
going
>
to pass the session object to the model?
1. Is there any specific reason for this approach you are
taking?
2. Will there be a notification from the object u havementioned
>to
have the model persist the data?
3. What about the reverse case, when the model refreshes the
data,
how are you going to refresh you object?
4. The JavaBean Object that u are talking about, is it your own
object or is it implementation of an existing JATO interface?
~Venki
grschroeder wrote:I'm fairly new to JATO, but I think I now
have
>a
basic understanding
of how Viewbeans and Models interact. However, I want to
incorporate
the use of a Javabean object that will be stored in the HTTP
session
and will act as the connection between the Viewbean and Model
instead
of having the Viewbean and Model interact directly with each
other.
Basically I would like to have the Model set data in the object
stored in the session so that the Viewbean can pull it out to
display
it. And vice versa, once the user modifies the data and is
ready
>
to
persist it, I would like to have the Viewbean set data in the
object
stored in the session so that the Model can pull it out to
store
>it
in the database. I'm not sure what the best approach would be
to
accomplish this. Any help you could give would be greatly
appreciated.
Thanks,
Greg
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
Venki
IT Solutions
#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
91-44-4925740(Home) 91-44-8212877(Work)
* Luck is what happens when Preparation meets Opportunity.
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
To download the latest version of JATO, please visit:
http://www.sun.com/software/download/developer/5102.html
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Store and Display doc/pdf files in the database using Forms
Hi all,
How can i store and display doc/pdf files in the database using Forms 10g?.
ArifHow to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
Solution
Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
here are steps to get a small test form running, using WebUtil 1.06.
Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
Feel free to copy this note to a text editor, and do a global find/replace on
[OraHome] with your actual value (no trailing slash). Then it is easy to
copy/paste actual commands to be executed from the note copy.
1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
2) Copy or move jacob.jar and jacob.dll
[JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
cd [JacobStage]
copy jacob.jar [OraHome]\forms\java\.
copy jacob.dll [OraHome]\forms\webutil\.
The Jacob staging area is no longer needed, and may be deleted.
3) Sign frmwebutil.jar and jacob.jar
Open a DOS command prompt.
Add [OraHome]\jdk\bin to the PATH:
set PATH=[OraHome]\jdk\bin;%PATH%
Sign the files, and check the output for success:
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
you may skip this step. Otherwise,
Create a schema to hold the WebUtil stored code, and privileges needed to
connect and create a stored package. Schema name "WEBUTIL" is recommended
for no reason other than consistency over the user base.
Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
out the EXIT statement, to be able to see whether the objects were created witout
errors.
Start SQL*Plus as SYSTEM, and issue:
CREATE USER webutil IDENTIFIED BY [password]
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;
GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
CONNECT webutil/[password]@[connectstring]
@[OraHome]\forms\create_webutil_db.sql
-- Inspect SQL*Plus output for errors, and then
CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
Reconnect as SYSTEM, and issue:
grant execute on webutil_db to public;
5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
to the CLASSPATH entry.
6) Start the OC4J instance
7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
It is important to generate the PLX, to avoid the FRM-40039 discussed in
Note 303682.1
If the PLX is not generated, the Webutil.pll library would have to be attached with
full path information to all forms wishing to use WebUtil. This is NOT recommended.
8) Create a new FMB.
Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
There is no need to Subclass the WebutilConfig object.
Attach the Webutil.pll Library, and remove the path.
Add an ON-LOGON trigger with the code
NULL;
to avoid having to connect to an RDBMS (optional).
Create a new button on a new canvas, with the code
show_webutil_information (TRUE);
in a WHEN-BUTTON-PRESSED trigger.
Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
the "Application Server URL" is empty.
Then append "?config=webutil" at the end, so you end up with a URL of the form
http://server:port/forms/frmservlet?config=webutil
10) Run your form.sarah -
Store and display word document in database through forms
how can i store a word document in database through forms 6i or 10g, and display it through forms from database.
i know how to store a binary file in database through DBMS_LOB package, but i want to do it throug forms. is it possible?
regardsHi Alex
"Create a datablock and specify the item datatype as blob"
BUT: How to bring the document to the blob?
Hi user 611..
Warning: It is easy if you use an OLE-Object - but OLE is a special format. The result will not be the same as with dbms_LOB.
We have a application with documents stored via OLE - terrible!
OLE is no longer supported by forms 10. But webutil would help.
I asked a similar question and got a good answer:
OLE-Container and migration to the web
Wolfram -
Store and Display Image from Database
Now that MySQL is working (woo hoo!) with JSC, I have a couple of questions for any experts out there...
1. How would I perform an image or other file upload from a browser?
2. How would I retrieve and display an image from a db on a jsp page?
Thanks for any help.Craig, I think I have a simpler way to load an image on the page, although for the time being I'm not retrieving from a database, but from the file system. The problem is that I'm not getting the pages to load continuously with new images. At some point it apears that the session gets clogges and can not load new pictures. I'll try to include the page bean code just below. This time I'm not adding the "code" tags because I haven't being successful with that. If you have problems , please, contact me at [email protected].
The core of the code is in a couple of button_action methods.
If you need, I can give access to the http server where this is running.
Luiz
package untitled;
import javax.faces.*;
import com.sun.jsfcl.app.*;
import javax.faces.component.html.*;
import com.sun.jsfcl.std.*;
import javax.faces.component.*;
import javax.swing.filechooser.*;
import javax.swing.*;
import java.io.*;
* Creator-managed class.
* Your code should be placed at the end.
public class Page1 extends AbstractPageBean {
private HtmlForm form1 = new HtmlForm();
private FileSystemView filesystem = FileSystemView.getFileSystemView();
private File path = new File("C:/Documents and Settings/Luiz Costa/My Documents/Creator/Projects/PictureAlbum/build/images/Isadora\'s Wedding");
private File[] fileslist = filesystem.getFiles(path, false);
private int counter = 1;
private int iw = 0;
private int ih = 0;
private Integer aiw = new Integer("1");
private float aar = 0;
private float ar = 0;
private ImageIcon ii = null;
public HtmlForm getForm1() {
return form1;
public void setForm1(HtmlForm hf) {
this.form1 = hf;
private HtmlGraphicImage image1 = new HtmlGraphicImage();
public HtmlGraphicImage getImage1() {
return image1;
public void setImage1(HtmlGraphicImage hgi) {
this.image1 = hgi;
private HtmlCommandButton button1 = new HtmlCommandButton();
public HtmlCommandButton getButton1() {
return button1;
public void setButton1(HtmlCommandButton hcb) {
this.button1 = hcb;
private HtmlCommandButton button2 = new HtmlCommandButton();
public HtmlCommandButton getButton2() {
return button2;
public void setButton2(HtmlCommandButton hcb) {
this.button2 = hcb;
private HtmlGraphicImage image2 = new HtmlGraphicImage();
public HtmlGraphicImage getImage2() {
return image2;
public void setImage2(HtmlGraphicImage hgi) {
this.image2 = hgi;
private HtmlOutputText outputText1 = new HtmlOutputText();
public HtmlOutputText getOutputText1() {
return outputText1;
public void setOutputText1(HtmlOutputText hot) {
this.outputText1 = hot;
* This constructor contains Creator-managed initialization code.
* Your initialization code can be placed at the end,
* but, this code will be invoked only the first time the page is rendered,
* and any properties set in the .jsp file will override settings here.
public Page1() {
// Creator-managed initialization code
try {
catch ( Exception e) {
log("Page1 Initialization Failure", e);
throw new FacesException(e);
// User provided initialization code
public String button1_action() {
// Add your event code here...
outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"left"+counter);
ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
// aiw = new Integer(image1.getWidth());
aiw = new Integer(ii.getIconHeight());
aar = ar*aiw.intValue();
image1.setHeight(""+(int)aar);
outputText1.setValue(image1.getHeight());
image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
// aiw = new Integer(image2.getWidth());
aiw = new Integer(ii.getIconHeight());
aar = ar*aiw.intValue();
image2.setHeight(""+(int)aar);
outputText1.setValue(image2.getHeight());
image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
counter = (counter-1+fileslist.length) % fileslist.length;
return null;
public String button2_action() {
// Add your event code here...
outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"right"+counter);
ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
// aiw = new Integer(image1.getWidth());
aiw = new Integer(ii.getIconHeight());
aar = ar*aiw.intValue();
image1.setHeight(""+(int)aar);
outputText1.setValue(image1.getHeight());
image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
// aiw = new Integer(image2.getWidth());
aiw = new Integer(ii.getIconHeight());
aar = ar*aiw.intValue();
image2.setHeight(""+(int)aar);
outputText1.setValue(image2.getHeight());
image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
counter = (counter+1+fileslist.length) % fileslist.length;
return null;
} -
How to store and display Response from REST Service
Hi,
My WADL has defined the response that my REST service returns back as below :
<object name="Get_Root">
<property name="RequestId" type="number" />
<property name="Name" type="string" />
<property name="fromPlace" type="string" />
<property name="toPlace" type="string" />
<property name="fromDate" type="string" />
<property name="toDate" type="string" />
</object>
I want to store this response; response is a single entry of the above type and not a collection (I am making the request on a button click) and then display it on the screen in multiple labels.
How can I do this? Will I have to use a collection and a gallery, even though I have a single response?
Thanks,
PragyaOkay.. got it. So MyRestData has a Get function taking some n arguments and it responds back with an object of the type I had mentioned before.
From what I understood, I have to write the below code for each label
MyRestData!Get(.....)!Name
MyRestData!Get(.....)!fromPlace
MyRestData!Get(.....)!toPlace ...and so on
Wouldn't that translate to different REST calls? Is there a way to get and store the entire response object
in the app and access each of its properties/subelements locally?
Also when you wrote the below before
Text: "The name is: " & MyRestData!Get_Root!Name
it seems that I can access the response object Get_Root using MyRestData. This is not the case for me. MyRestData only lets me access the Get function using "!", and not the response object in any way.
Thanks for your help! -
How to load and display a byte array (jpeg) image file dynamically in Flex?
My web service client (servlet) received a binary jpeg data from an Image Server. The Flex application invokes the
servlet via HttpService and receives the binary jpeg data as byte array. How could it be displayed dynamically
without writing the byte array to a jpeg file? Please help (some sample code is very much appreciated).JPEGEncoder is only useful for converting BitmapData to ByteArray, not the other way around.
By the way JPEGEncoder and PNGEncoder are part of the Flex SDK now, so no need to use AS3Lib (alltough it's a good library to have around).
To display/use a ByteArray as image, use a Loader instance with the loadBytes method.
Loader.loadBytes(bytes:ByteArray, context:LoaderContext = null);
Listen for the complete event on the Loader.contentLoaderInfo and get the BitmapData in the event handler.
private function loadJpeg():void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
//jpgBA is the ByteArray loaded from webservice
loader.loadBytes(jpgBA);
private function loaderCompleteHandler(evt:Event):void {
var t:LoaderInfo = evt.currentTarget as LoaderInfo;
// display the jpeg in an Image component
img.source = t.content;
<mx:Image id="img" scaleContent="false" /> -
How to Store and Retrieve values in cookie
Hi am having two List boxes in a jsp page.. By default i will give set of values to one List box and then i will move some value from one list box to another list box.. Now my requirement is i have to store these two list box values into cookie.. If i come back the page again it shoud show the previous values in list boxes.. If any one knows this please guide me..
ThanksWhy do you need to use cookies in your case? A session attribute would be more reliable.
-
Reading a text file and transferring values into array
Hi,
I have a problem. So what I am trying to do is that, I read a text file and insert specific values from the text file into an array for future needs.
But I have to make sure that there is no duplicate entries. So thats what I have but, my method takes forever to finish...
here is my code:
String nomFichier = "Test_" + numTest + "_" + date + ".txt";
String ligne = "";
int z = 0;
int j = 0;
BufferedReader lecteurFichier = new BufferedReader(new FileReader(nomFichier));
while ((ligne = lecteurFichier.readLine()) != null) {
if (z > 3)
String valeur = "";
String dist = "";
boolean unique = true;
String [] chiffre = ligne.split(";");
if (intervalleAnalyser == 1)
valeur = chiffre[3];
dist = chiffre[4];
if (intervalleAnalyser == 2)
valeur = chiffre[2];
dist = chiffre[4];
if (intervalleAnalyser == 3)
valeur = chiffre[1];
dist = chiffre[4];
if (z == 4) {
intervalleDiagramme[j] = valeur;
j++;
if (z > 4) {
for (int i = 0; i < intervalleDiagramme.length; i++)
for (int x = 0; x < i; x++)
if(intervalleDiagramme[i] == intervalleDiagramme[x])
unique = false;
if (unique)
intervalleDiagramme[j] = valeur;
j++;
z++;
lecteurFichier.close(); // toujours fermer le fichierHi,
Thanks for your reply,
1) Yeah I have a method that asks the question and assigns it to a variable.
2) Well the z will stop once there is no lines to read no?
for the set.add(), I am not that familar...
I changed bit a code and I have this now:
if (z > 4) {
for (int i = 0; i < intervalleDiagramme.length; i++)
System.out.println(intervalleDiagramme);
if(intervalleDiagramme[i].equals(valeur))
System.out.println(intervalleDiagramme[i] + " " + valeur);
unique = false;
if (unique)
intervalleDiagramme[j] = valeur;
EDIT:
I figured a way to assign " " to all the values in my array. But I get this error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 380
at TP3.lireFichier(TP3.java:305)
And my line 305 is: intervalleDiagramme[j] = valeur;
EDIT2:
So ok I found my mistake and corrected it. But I want to know is there a way of doing this without setting the size of the array? because sometimes there needs to be 21 values sometimes 19 and sometimes 20....
If I take out: = new String [21] out I get a NullPointer error...
Edited by: Ara1992Habs on Dec 13, 2009 7:29 AM
Edited by: Ara1992Habs on Dec 13, 2009 7:37 AM -
Numeric fields and display values
Hi All,
I have a few numeric fields in my form. I want to display "null" in those fields when they do not contain a value in the db i.e. whenever the fields are left blank they should display "Null" in the form but will have a Null value in the db.
Any idea on how to do this?
Thanks.Personally I'd have a WHEN-VALIDATE-ITEM trigger on the display items, and once the value had passed any validation I would update the database item accordingly (i.e. set db_field to TO_NUMBER(display_field) unless it's 'NULL' then set it to null). That way forms knows that the record has changed.
-
Store and display other language
hi friends
database - 11g
apex - 4.1
i have form based on table. i want to display and store language "gujarati" in database. How it possible??
ThanksHi,
you should set your applications Application Primary Language to Gujarati(gu).
When you open your application click on the button "Edit Application Properties" then click on the tab "Globalization" there you can select Gujarati(gu) as your Application Primary Language.
regards,
Erik-jan -
How to call the column names into the prompt and display values dynamically
Hi,
i have a typical requirement where I have to call 3 columns into the AGE Prompt (I know we can use the Column Selector to call the columns) .Below is the Screen Shot.
!http://i46.tinypic.com/2qjfukh.jpg!
2nd Requirement)
The three columns I have are order Date, Ship Date and Entry Date.
Whenever I click on Orderdate from the Prompt, It should dynamically show its values in the report.
and When I click on the Ship Date from the Prompt, it should display the corresponding values in the report.
and so on with the Entry Date.
Can anybody help me how to acheive this.
Thanks a ton.Ok so then you can use a fake column prompt. Here's one quick approach (nicer and cleaner with LOV tables but I don't if you have any of those).
- Create a fresh prompt using any column you want.
- Open the column formula using the fx button and replace the formula with 'abc'.
- Use "SqL Results" as the "Show" option.
- SQL:
select case when 1=0 the Markets.Region else 'Order Date' from Paint.Markets UNION ALL
select case when 1=0 the Markets.Region else 'Ship Date' from Paint.Markets UNION ALL
select case when 1=0 the Markets.Region else 'Entry Date' from Paint.Markets
- Set Variable = Presentation Variable = @{vPresVarSelectedDate}{Order Date}
- Label = Date
Then in the request, you change the column formula for the date. I'm going to make it short and just assume you called your time dimension alias(es) like the lowest grain:
"@{vPresVarSelectedDate}{Order Date}"."@{vPresVarSelectedDate}{Order Date}"
Cheers,
C. -
please can you show me how to collect informations from some JComponents like JComboBox, JList , JTextField, JTextArea etc and store them on clicking on a single button and also retreiving them by clicking on another single button
below are some functions that u can use:
JComboBox: getSelectedItem()
JList: getSelectedValue()
JTextField, JTextArea: getText()
basically u need to have button, add an action listener for the button, and store the value using the above functions when the button is clicked.
hth. -
Retrieving data from TCP/IP in xml and displaying values?
Hey, I am using a program to retrieve data from a machine and outputting it in xml to the localhost. On a seperate computer, I am trying to create a client application to read the xml data from that IP host and just output the important values instead of the whole script. I am new to Labview and programming, has anyone written a program similar to what I am trying to accomplish? I searched for it but couldn't quite find what I was looking for. I really could use some help with trying to figure this out and appreciate any help or advice you could give me.
Where did you search? There are examples that ship with LabVIEW that show you how to do client-server applications using TCP/IP. Did you try those? You would need to add the parsing of the data you receive (i.e., the XML).
-
Hi,
I use BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV to create a POPList by using the view oe_transaction_types, but there is no any data displayed in the order type column, while can use table oe_transaction_types_tl to create the POP List and display value. Does the Web ADI LOV not support the MOAC? Here is the API:
BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV(P_APPLICATION_ID => 20009, --IN NUMBER,
P_INTERFACE_CODE => 'XXX_UPL_ORD_INTF', --IN VARCHAR2,
P_INTERFACE_COL_NAME => 'P_ORDER_TYPE', --IN VARCHAR2,
P_ID_COL => 'NAME', --IN VARCHAR2,
P_MEAN_COL => 'NAME', --IN VARCHAR2,
P_DESC_COL => 'DESCRIPTION', --IN VARCHAR2,
P_TABLE => 'OE_TRANSACTION_TYPES', --IN VARCHAR2,
P_ADDL_W_C => 'TRANSACTION_TYPE_CODE = ''ORDER'' AND NVL(END_DATE_ACTIVE, SYSDATE) BETWEEN START_DATE_ACTIVE AND SYSDATE',
P_WINDOW_CAPTION => 'Order Type', --IN VARCHAR2,
P_WINDOW_WIDTH => 500, --IN NUMBER,
P_WINDOW_HEIGHT => 400, --IN NUMBER,
P_TABLE_BLOCK_SIZE => 10, --IN NUMBER,
P_TABLE_SORT_ORDER => 'NAME', --IN VARCHAR2,
P_USER_ID => -1, --IN NUMBER,
P_TABLE_COLUMNS => 'NAME,DESCRIPTION', -- IN VARCHAR2,
--P_TABLE_SELECT_COLUMNS IN VARCHAR2,
--P_TABLE_COLUMN_ALIAS IN VARCHAR2,
--P_TABLE_HEADERS IN VARCHAR2,
P_POPLIST_FLAG => 'Y');Duplicate post.
How to restrict the display of Integrator in Web ADI
How to restrict the display of Integrator in Web ADI
Maybe you are looking for
-
Does moving sites using Content and Structure cause issues in SQL content db's?
I would like to be able to use "manage content and structure" to move sub-sites within a site collection (SharePoint 2010). For example I have a site that is right under my top level site and I would like to move it to be the child site of one of its
-
having major problems with my ipod shuffle 2nd gen. I installed i tunes 7.02, then installed my new shuffle. I checked the auto update of the ipod and the ipod then loaded all of the songs it could from my library onto the piod. I attempted to change
-
SAP R/3 4.7 BSP call Crystal Report on BOBJ XI 3.1.
Hi there, I was hoping somebody could give me the high level steps to call a Crystal Report from a BSP (the data source for Crystal is from the R/3 4.7 server) and then have the Crystal Report shown in the BSP session. And, would it possible to have
-
How do I get to the airport card in a Nehalem?
I'm thinking my airport card may not be connected correct or something but I cant figure out where it is to check. I have the 2.66GHz Quad-Core Intel Xeon "Nehalem" I can't find any videos or images of this model mac. When i go to about this mac the
-
Why will MSN Live Mail not open in Safari
I can not get MSN Live Mail to open in Safari. I can MSN, but when I click on Hotmail it just keeps trying to load without getting anywhere?????