Event-Driven Programming

Hello Everyone,
I am new to this forum and also new to event-driven programming. Anyways, I am doing a small exercise to get myself familiar with event-driven programming. In particular, the program responds to keys entered on a keyboard. The exercise in a way resembles how a second hand moves in a clock. So, here's what I am trying to do. Originally the hand points at 12 o'clock. when I press the right arrow key the hand should move 6 degrees to the right and when I press the left arrow key the hand should move 6 degrees to the left. The code I have so far seems fairly correct to me but when I run the program and press the arrow keys on my keyboard nothing happens. Any help would be appreciated and thank you in advance.
Here is my code:
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
public class hittingBalloons extends JFrame{
     hittingBalloons(){
          mouseKeyboardListeners p = new mouseKeyboardListeners();
          add(p);
          p.setFocusable(true);
     public static void main(String[] args){
          hittingBalloons frame = new hittingBalloons();
          frame.setTitle("Hitting Balloons");
          frame.setSize(500,500);
          frame.setLocationRelativeTo(null);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
     public class mouseKeyboardListeners extends JPanel{
          private int xCenter=250;
          private int yCenter=250;
          private int xEnd =250;
          private int yEnd =210;
          private int angle=0;
          private int gunLength=40;
          private int xBall = 150;
          private int yBall = 150;
          private int radius = 20;
          public mouseKeyboardListeners(){
               addKeyListener(new KeyAdapter(){
                    public void keyPressed(KeyEvent e){
                         if(e.getKeyCode() == KeyEvent.VK_LEFT){
                              angle = (int)(angle - (Math.PI/30));
                              xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                              yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                              repaint();
                         else if (e.getKeyCode() == KeyEvent.VK_RIGHT){
                              angle = (int)(angle + (Math.PI/30));
                              xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                              yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                              repaint();
          protected void paintComponent(Graphics g){
               super.paintComponent(g);
               g.drawLine(xCenter,yCenter,xEnd,yEnd);
}

A few notes and suggestions:
1) Welcome to the forum!
2) When posting code, please use code tags as it makes your code easier to read. the FAQ will show you how. e.g.,
import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
public class hittingBalloons extends JFrame{
     hittingBalloons(){
          mouseKeyboardListeners p = new mouseKeyboardListeners();
          add(p);
          p.setFocusable(true);
     public static void main(String[] args){
          hittingBalloons frame = new hittingBalloons();
          frame.setTitle("Hitting Balloons");
          frame.setSize(500,500);
          frame.setLocationRelativeTo(null);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
     public class mouseKeyboardListeners extends JPanel{
          private int xCenter=250;
          private int yCenter=250;
          private int xEnd =250;
          private int yEnd =210;
          private int angle=0;
          private int gunLength=40;
          private int xBall = 150;
          private int yBall = 150;
          private int radius = 20;
          public  mouseKeyboardListeners(){
               addKeyListener(new KeyAdapter(){
                    public void keyPressed(KeyEvent e){
                         if(e.getKeyCode() == KeyEvent.VK_LEFT){
                              angle = (int)(angle - (Math.PI/30));
                              xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                              yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                              repaint();
                         else if (e.getKeyCode() == KeyEvent.VK_RIGHT){
                              angle = (int)(angle + (Math.PI/30));
                              xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                              yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                              repaint();
          protected void paintComponent(Graphics g){
               super.paintComponent(g);
               g.drawLine(xCenter,yCenter,xEnd,yEnd);
}3) For key listeners to work, the component must have the focus, and JPanels don't get focus by default. You have to call setFocusable(true) first and then request focus in window on the JPanel.
4) Even better would be to use key binding, and to learn to use these, check out the Sun tutorial.
Luck and again, welcome!

Similar Messages

  • Periodic reading data with event driven programming

    Hi all
    I want to read data from a device periodically, for example every 2 seconds.
    but I want to use event driven programming in order to response user events.
    now I don't know how to do this......!!
    maybe I should use timed loop or timed sequence structure
    if I use this structures, should I use then inside the while loop or outside the while loop( I mean the while loop that contains the event cases)?
    please help me and accept my thanks....

    You ned to run these in two separate loops. Look at the Producer/Consumer template. Put a two second time-out on the Dequeue Element and you have a loop that will run every two seconds. The loop should also handle information from the event structure.
    Separate loops is the best way of handling this.
    Rob

  • Event Driven Programming is withheld from LabVIEW Base.

    Can anyone give me a good answer why?  Every other programming language in the world has Event Driven Programming (EDP) built in, even free languages.  So when all I wanted was to use LV as a graphical programming language, (hey, that's what the "G" in G-programming stands for) I was disappointed to find that in my undervalued LV Base I can't look for mouse movement, mouse enter, mouse leave, keyboard actions and countless other possibilities that would be standard fare in any other language, unless, I pay over 1200 dollars more for the Full development package.  I know I should have read up on it more before purchasing, and understood what I would be missing out on.  But how was I to know that the fundamental programming function of EDP would be considered on par with Data Acquisition and Signal Processing?  So basically in order to get a complete programming language, I need to spend more than twice the cost of the Base package just to receive the last key component.  And all this because the Evaluation of LV gives you near limitless possibilities, so a new LV programmer gets used to having these tools at his/her disposal, only to yank some of the most critical tools.  So after saying all this, I am pleading for an explanation.  Why isn't there at least some add-on module that would allow a user to install the withheld functionality of EDP to a Base Development package?  Surely making money is the goal of any business, and I won't claim bait and switch here, or any other wrong doing here.  But there is, in my opinion, a marketing misjudgment here.
    -Orion Williams

    Unfortunately to upgrade, it would cost me the difference between the base version and the full version.  What I think is in order is an add-on module that will give customers the functionality of EDP, without having to also pay for signal processing, which is clearly a more robust programming tool, that I don't need.  I am hoping to show NI that by withholding EDP from the base version with no upgrade option except paying for the full version, that their customers who come into LV at the base version are getting an undervalued version, and they know it, and that without at the very least, and add-on module for EDP, isolating smaller business and individuals.  I agree that signal processing, data acquisition and EDP are worth an extra 1300 dollars, but I don't agree that EDP on it's own is worth an extra 1300 dollars, but that's the only option that I have at this moment.  My suggestion is to create an add-on module that includes EDP and sell it for 300 dollars, since I know signal processing is a much more complex feature and is worth more of that upgrade price than EDP.  Of course all versions of LV should include EDP, so if that drives the price of LV base up, so be it.  Just don't let anyone else be fooled into thinking they are buying a Graphical Programming Language unless all the features of a programming language are included at all price points.  Can I get a witness?

  • Problem with drawing chart in event driven programming and XControl

    Dear my friends
    I have a xcontrol, that has two buttom and a chart. i want to do this:
    1- when i press the "start" button chart starts to add random numbers
    2- when I press the "stop" button the start should stop drawing random numbers.
     I mean after pressing the start the chart should add points until I press the stop button.
    also I add "start button value change"  event case and i put the code inside that event.
    but when i press the start the chart adds one point.
    using while loop inside a event case is not good for adding extra points.
    can someone help me how to do this?
    I oppologize due to my weak english.....

    An Xcontrol immediately returns after each Read or write. It should not stall the calling VI. It is not something that should run for extended periods. You can use a plain reentrant subVI, for example.
    If you want to learn about Xcontrols, have a look at the dual mode thermometer (or similar) that is included with the example finder.
    LabVIEW Champion . Do more with less code and in less time .

  • New LabHSM Toolkit - Agile development of complex event-driven maintainable LabVIEW applications with active objects / actors based on a universal Hierarchical State Machine / statechart template.

    Dear Fellow LabVIEW programmers:
    Most of the systems you deal with are reactive. It means that their
    primary function is constant interaction with their environment by
    sending and receiving events. But most likely, they can have something
    happening inside them too, even when they are not processing messages
    received from outside. So, such systems have to continuosly react to
    external and internal stimuli. Right? Moreover, most likely, they
    consist of subsystems that are reactive too and, in turn, can have
    their own "life", to an extent independent from other parts (with
    which they still communicate, of course). Reactive (event-driven)
    systems are more naturally modeled with active objects. So, why then
    should we try to model and code them with GOOP and its passive
    ("dead"!) objects?
    "Flat" State Machines have been known for decades to have severe
    limitations. It's been more than 20 years since Dr. Harel invented
    Hierarchical State Machines (statecharts) to fight those limitations.
    Then why does NI still tout the same old good Moore FSM as the
    ultimate tool for event-driven programming in LabVIEW in its $995
    State Diagram KIt?
    The LabHSM toolkit we are happy to present, makes it possible to
    easily create and then maintain complex event-driven applications in
    LabVIEW as a collection of HSM-driven active object VIs using a higher
    level of abstraction and agile software development methodologies.
    These active object VIs are created based on a universal Hierarchical
    State Machine ( HSM or statechart ) template. So. all your code looks
    similar regardless of its functionality!
    We all love just jump to code, right? However, to be good boys, we
    need to do design first. Then implement it in code. If the logic is
    modified we need to redo the design first and then redo the code. When
    using LabHSM where behavior information is abstracted into a separate
    HSM data file editable with a supplied editor, there is no need for
    coding separate from design any more. The modified behavior becomes
    code automatically as soon as the HSM file is saved. Design is code!
    The implementation basically follows Dr. Samek's Quantum Programming
    paradigm. (see http://www.quantum-leaps.com). However, as already
    mentioned, LabHSM stores the behavior information in a file separate
    from the code itself. It also adds state dependent priorities to
    events, a separate queue for public events/messages, and, of course,
    some LabVIEW specific code like capturing front panel user events and
    putting them into the private Events queue. Communication and
    instantiation functions are also rather specific for LabVIEW.
    It is available for UNLIMITED PERIOD trial. Please visit
    http://www.labhsm.com for details and download. The site also contains
    references which you may want to check to learn more about
    hierarchical state machines and active object computing.
    Since this is our debut we will appreciate any comments and
    suggestions. Our contact information is available on our site, of
    course.
    Have a G'day!

    Symtx is currently hiring the following position. Please contact me if interested.
    Amy Cable
    Symtx, HR
    [email protected]
    Symtx, the leading supplier of functional test equipment, hires the brightest & most talented engineering professionals to design & manufacture complex custom electronic systems for advanced technology leaders in the defense, aerospace, communications, medical, transportation & semiconductor industries. Symtx’ challenging & dynamic work environment seeks to fill openings with highly qualified electronic engineering design professionals.The ideal candidate will be responsible for defining the requirements, software design and code development, and integration of test control software for custom functional test systems. Candidate should be familiar with data acquisition concepts, instrument control, complex test, measurement and calibration algorithm development and definition and implementation of control interfaces to hardware. Prefer familiarity with instrument control via GPIB, VXI, MXI, RS-232 desirable. Requires BS/MSEE and 3 -7+ yrs of experience in one or several of the following test applications in a Windows NT/2000/XP environment using Labwindows CVI, TestStand, Labview, Visual Basic, C++ and knowledge of RF systems is a plus. Job responsibilities will include software design, development, integration, team leadership, and interfacing with customers( includes PDR’s & CDR’s).

  • Huge Basic Price Drop for LabHSM Toolkit for advanced event-driven development

    Dear fellow LabVIEWers :
    I am happy to announce that to increase the attractiveness of the LabHSM toolkit the basic price was just dropped from about $1,000 to just $249!
    As our website says, the price is not set in stone (even this new low one!). We encourage the prospective clients to make us an offer and we promise that no reasonable offer will be refused. So, some people have already done exactly that – told us a price they could afford and we sold them LabHSM at THEIR price. However, it seems to us that too many people don’t like the (too high in their opinion) basic price but still don’t notice the “Make us an offer” option (despite very large font and bright color) and/or just hesitate to make an offer. We hope that the new, significantly reduced basic price will make the toolkit more attractive to those folks who don’t like to negotiate.
    About LabHSM:
    LabHSM is a professionally designed toolkit that allows creating complex event-driven LabVIEW application as an easily maintainable collection of asynchronously communicating active objects ( actors ) based on a universal Hierarchical State Machine ( HSM or statechart ) template. The LabHSM  toolkit enables the programmer to work on a higher level of abstraction and utilize agile software development methodologies combining design and coding in one highly flexible process.
    Stanislav Rumega, CLA
    H View Labs
    http://labhsm.com

    An update: I am still in Milwaukee, Wisconsin, USA. The current client ran out of projects for me,
    so I am ACTIVELY looking now. An updated resume is attached. If you are in US and any farther from me than Chicago, relocation assistance is highly desired.
    Again,
    I am so fed up with US immigration "process" (almost NINE years here LEGALLY and green card is nowhere in sight!) that would SERIOUSLY consider UK, Australia, Canada, EU if somebody is SERIOUSLY willing
    to help with the papers and relocation.
    An updated resume is attached.
    Recent achievements:
    1. A couple of test stands  for testing  high voltage (15kV, 27kv, 38kV)  high current (up to 100A) reclosers. Those devices are used by electrical utilities companies. They are made by Cooper Power Systems. It's sort of a big three phase breaker but with the brains - it's own computer. Very sophisticated device. It is programmed at which currents and for how long to wait before opening the circuit, when and how many times to try to close it again before locking out, etc. See http://cooperpower.com/Products/Distribution/Reclosers/ for more info on.
    2.Updated the David Boyd's famous Tunnel Wiring Wizard to make it work with LV 8. See LAVA forums: http://forums.lavag.org/index.php?s=&showtopic=211&view=findpost&p=9207
    3. Created a Property and Method Selection (PMS :-)) Assistant to simplify access to undocumented (private) properties and methods in LabVIEW 7 through 8 - very useful for anybody experimenting with VI Scriping features. Again, see it on VI Scripting LAVA forum:
    http://forums.lavag.org/index.php?s=&showtopic=2662&view=findpost&p=10812
    Attachments:
    Stanislav Rumega Resume 05-2006.doc ‏96 KB

  • Wpf: Event driven vs MVVM design pattern

    I'm a beginning coder and I've been working on a WPF app for several months now and struggled to implement anything in MVVM due to time constraits to learn so I coded my program the only way to knew how: with code behind, tight coupling, and a whole bunch of
    spaghetti code.
    My program has grown into 20,000+ lines of messy (but working) code that is mostly event driven. The app I am building will probably be used and continue to be developed for years to come, but I will be the only one working on the code.
    However, now that I have time to start learning MVVM, I'm wondering how useful it really is to follow the MVVM pattern. I'm considering refactoring my code into the MVVM pattern but everything seems 100x difficult to do with little documentation. With using
    code behind and tight coupling, I can make the UI do exactly what I want it to do and everything seems like it can be coded so much faster through the event-driven methods.
    How important is it to follow the MVVM design pattern for WPF apps, especially in the long run? Do you think it's a good idea for me to invest my time to redesigning this app and following an MVVM pattern?

    20k lines is a lot.
    That will mean maintenance will be a significant overhead.
    Anything making maintenance harder will mean maintenance takes longer.
    If you're going to do any serious wpf development ( and 20k lines is serious imo) then you should be using mvvm.
    The thing is though, it's different.
    You will need to learn it before it becomes second nature and doesn't appear to be an overhead.
    It isn't true that "everything" can be coded so much faster with event driven methods.
    In fact a number of things are way easier to do using mvvm rather than code behind.
    If that isn't enough to persuade you.
    Teams use MVVM.
    Go to an interview and tell your prospective team lead you think mvvm is no good and you may as well not go to the interview.
    If it becomes obvious in an interview you haven't learnt mvvm then you will not be chosen.
    Teams also use automated testing.
    This is nigh on impossible with code behind and one of the selling points of mvvm.
    You can test without instantiating a view which means you can run thousands of fast tests in seconds.
    That means you can make changes safe in the knowledge you're not breaking stuff you haven't worked on.
    It means someone else in the team doesn't break your code without realising.
    Since UI and code are decoupled you can makes changes to either or both rather easier - that decoupling = flexibility.
    As your code base grows then re-factoring becomes MASSIVELY faster if you have automated tests in place and your layers are loosely coupled.
    I don't know about this paraticular app you have because I don't know almost anything about it.
    If you plan on doing professional wpf development then I suggest you re-adjust your opinions on MVVM. 
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • Creating Event driven process chain

    Hi all,
    In my scenario there are two chains in which
    1. First chain is normal chain, which we are using to
    load business data.
    2. Second chain will contain start variant and one ABAP
    program that will call first chain and this second
    chain is event driven.
    So can anybody send me relevant documents or
    information regarding how to create event? How to
    schedule process chain using event? and also how to call
    process chain using ABAP program?
    Thanks & Regards
    Ajinkya Deodhar

    Hi,
    Look into the following links:
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    Event collector:
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    Creation of Event:
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    Hope it hepls you

  • Event Driven Kanban Process

    Hi,
    I tried to follow the process mentioned from other threads on this subject but with no success.
    Scenario:
    Header Mtrl: A
    Assembly: B [E-D KANBAN]
    Assembly: C
    There is a requirement for A=100 ea. There must be dep.req generated for B = 100 ea??? as per the event  [correct me if I am wrong].
    How to exectute the above scenario?
    Can anyone guide with the work flow and TCode for the E-D Kanaban.
    Thanks in advance.
    Cheers
    Ramesh

    Q: Well, if the scenario which I mentioned is not ED what exactly it is - Please ellobrate?
    This scenario is not ED, this can be addressed by Kanban with MRP controller, in case of inhouse production it will be with
      the replinshment type 4 .
    Q 1/ If we need to manually create the ED signal in PK23 what advantage does we have compared to the MRP run?
    It is not any advantage, this is how it can be done.
    Q 2/ There is a order for A=100 ea. How the person responsible in the supply area will know that there is a req. for B (ED KANBAN) material?. How the person responsible for the supply area track these requirements?
    In case if you are working with kanban + MRP , you can use the program SAPMMPKC which can be scheduled in the BG to 
    Q 3/ I appreciate, if you could throw more light in - how automatically the ED is triggered once it receive the order/req.?
    Apart from all, i think you need to read more about the kanban and how it works.
    Generally kanban are used where there is continious flow between 2 workcentres.
    ie ) a constant demand and supply .
    10 containes flows between 2 workcentres in which one workcentre is supply and  another one is demand then kanban is used.
    during such situation if you are planing to increase one container just for 1 weeek to meet your increased demand ( like christmas, new year) then Event driven kanban can be used.
    Hope most of your querries are answered . you can also check about kanban here
    http://sap-pphelp.blogspot.com/2010/01/kanban-inhouse-production.html
    Reg
    Dsk

  • About the DDP(Document-Driven Programming)

    Hi all,
    I have been reading the J2EE tutorial and see the conception of DDP(Document-Driven Programming) at the section of introducing xml application.
    This tutorial says: DDP is "The newest approach to using XML is to construct a document that describes what an application page should look like. The document, rather than simply being displayed, consists of references to user interface components and business-logic components that are "hooked together" to create an application on-the-fly."
    Do this mean that, if we use DDP, we could only create the application UI pages totally in XML files? If it does, it will be flexible to create web applications and those applications can be easily maintained.
    I am interested about this topic but the tutorial gives a little words on DDP. By search the website, I can't find any useful document in which DDP is described in details.
    So I wonder if there are any online useful resources for DDP? Thanks for any suggestions!

    Well, you could do something like in the attached VI.
    I prefer NOT to have loops inside event cases, because they block the event structure. You can use the outer loop for everything and manipulate the timeouts.
    I would strongly suggest NOT to toggle booleans but to hardwire the desired states using diagram constants. Toggling must rely on the existing state, which can be unexpected unders certain conditions, especially if the program gets much bigger and you add features.
    Also, I think you are missing a state, because valve 5 gets closed once and never opens again. You should also initialize the toggle to a known state using a local variable at the start of the program, else things are out of sync if you would accidentally change the toggle when the VI is not running.
    You probably should add some logic on the other events to discard them if the state is not zero.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ValveBankStateMachine2MOD.vi ‏35 KB

  • New version of the LabHSM Toolkit for Complex Event-Driven Development is Now Available!

    A new version of the unique toolkit is now available for download. As announced earlier, LabHSM makes it possible to easily create and then maintain complex event-driven applications in LabVIEW as a collection of HSM-driven active object VIs using a higher level of abstraction and agile software development methodologies. These active object VIs are created based on a universal Hierarchical State Machine ( HSM or statechart ) template. Therefore, all your code looks similar regardless of its functionality!
    So, what’s new in version 1.1?
    • "No hands" block diagram modifications! Version 1.1 actually creates, renames, and removes actions on the block diagram as you define, rename, and remove them in the editor! (No, it can't fill in all the details for you, but it can do some, if you think ahead, by replicating similar actions.)
    • Two new screens, Events Usage and Actions Usage, (available in licensed copies only) clearly show where (in which state(s)/transition(s)) and how (is it an entry action, exit action or event handling action?) a particular event or action is used. Moreover, if after selecting an instance on the list, the Go To button is pressed, it makes the main screen jump to respective location in the HSM structure. In the case of Actions Usage screen, the respective action is also displayed on the block diagram. Thus, these screens provide two more different cross-sections of the HSM data set and two additional ways to navigate it – now along the Actions and Events dimensions too instead of just the state tree in the first version.
    • Version 1.1 can duplicate events or actions, which helps when you've got several that are similar. Changes in the events and actions lists are reflected immediately on the main screen and on the block diagram (which solves the previous problem of deleting a renamed event or action when it's still in use).
    • The Events and Actions List Editors are no longer modal and neither are the Events and Actions Usage screens, so you can have all the panels and the block diagram visible and move freely among them as you build your HSM (a good argument for an even larger monitor).
    • When you save an HSM file, version 1.1 automatically adds the .hsm extension if you leave it out and it remembers the last directory you used.
    • The Loaded VIs utility now can open and close block diagrams (if they are not protected with a password) and display only VIs with modal front panels, if desired—useful for quickly finding and closing accidentally opened (e.g., from the hierarchy window) modal VIs. Make a modal version of this utility and keep it on the Desktop for this purpose.
    • A new example of a simple hierarchical state machine and two more excellent tutorials from Paul F. Sullivan (SULLutions.com) are included into the package. The tutorials are also available online. The overview article has also been extended.
    As before, the LabHSM toolkit is available for UNLIMITED PERIOD trial. Please visit http://www.labhsm.com for details and download. The site also contains references which you may want to check to learn more about hierarchical state machines and active object computing.
    Stanislav Rumega
    NI Certified LabVIEW Developer
    H View Labs
    http://www.labhsm.com
    [email protected]
    US Toll-Free Phone/Fax: 877-570-8684

    I am not really sure if Azure support this but its worth to make your configuration file to support .NET 4.0
    $PShome\PowerShell_ISE.CONFIG and $PSHOME\PowerShell.exe.config will be not existing.
    So you can make an entry in configuration to support .NET framework 4.0
    like shown below
    $config_text = @"
    <?xml version="1.0"?>
    <configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0.30319"/>
    <supportedRuntime version="v2.0.50727"/>
    </startup>
    </configuration>
    $config_text| Out-File $pshome\powershell.exe.config
    $config_text| Out-File $pshome\powershell_ise.exe.config
    Close PowerShell Console and open as administrator.
    Try loading the modules back and let me know.
    Regards Chen V [MCTS SharePoint 2010]

  • Problem in Event driven report

    Dear Gurus...I created the following procedure to implement Event Driven Reporting:
    CREATE OR REPLACE procedure ABC.eve_drv_rep as
    myPlist system.SRW_PARAMLIST;
    myIdent system.SRW.Job_Ident;
    BEGIN
    myPlist := system.SRW_PARAMLIST(system.SRW_PARAMETER('',''));
    system.srw.add_parameter(myPlist,'GATEWAY','http://192.168.1.133/reports/rwservlet);
    system.srw.add_parameter(myPlist,'SERVER','rep_appsrv_frhome1');
    system.srw.add_parameter(myPlist,'REPORT','y:\02\02\Gry_02_01.rep');
    system.srw.add_parameter(myPlist,'USERID','def/xyz@nml');
    system.srw.add_parameter(myPlist,'DESTYPE','email');
    system.srw.add_parameter(myPlist,'DESFORMAT','PDF');
    system.srw.add_parameter(myPlist,'DESNAME','[email protected]');
    myIdent := system.srw.run_report(myPlist);
    EXCEPTION
    when others then
    raise_application_error(-20001,'Error sending email.Error: '||sqlerrm);
    --Dbms_Put.Put_Line('Error sending email.Error: '||dbms_util.get_detailed_sqlerrm);
    END;
    Procedure is created successfully but when I execute this procedure, I get the following error:
    ORA-20001'Error sending email.Error: ORA-20999
    ORA-06512: at "Nml.Eve_Drv_Rep", line 17
    ORA-06512: at line 1
    Can u guess where is the problem?
    2ndly I want to know that whether I should give IP address or Application Server Machine Name in GATEWAY parameter?
    And in SERVER parameter either I should give the Application Server Machine Name or Report Server name installed on Application Server Machine?
    Lastly from where I can get the complete list of Parameters to be added in SRW.Add_Parameter like SERVER, GATEWAY etc.
    Please note that we r using Database 10g Rel.2 and Forms and Reports services on Application Services and the report being called was developed in Reports 10g.

    Hi,
    Consider this corrected code.
    REPORT zztest
    NO STANDARD PAGE HEADING
    LINE-COUNT 36(3)
    LINE-SIZE 250.
    DATA: BEGIN OF itab OCCURS 0,
    carrid TYPE sbook-carrid,
    connid TYPE sbook-connid,
    fldate TYPE sbook-fldate,
    custtype TYPE sbook-custtype,
    class TYPE sbook-class,
    bookid TYPE sbook-bookid,
    END OF itab.
    DATA a TYPE i.
    SELECT carrid connid fldate custtype class bookid
    FROM sbook INTO CORRESPONDING FIELDS OF TABLE itab.
    SORT itab.
    ULINE.
    WRITE :1 'CARRID', 20'BOOK ID', 37'CLASS'.
    ULINE.
    LOOP AT itab .
    <b>  AT NEW carrid.
        WRITE: 1 itab-carrid.
      ENDAT.
      WRITE : 20 itab-bookid.
      WRITE : 40 itab-class.</b>
      AT END OF carrid.
        ULINE.
      ENDAT.
    ENDLOOP.
    <b>Your problem was.</b>
      AT NEW carrid.
        WRITE: 1 itab-carrid.
      ENDAT.
      WRITE : <b>/</b>20 itab-bookid. "New Line <b>/</b>
      WRITE : 40 itab-class.
    Regards,
    Arun Sambargi.

  • Please tell me the different events in program

    Hi,
    Please tell me the different events in program
    Saurabh Garg

    •     INITIALIZATION
    •     AT SELECTION-SCREEN
    •     START-OF-SELECTION
    •     TOP-OF-PAGE
    •     END-OF-PAGE
    •     END-OF-SELECTION
    <b>
    •     AT SELECTION-SCREEN ON <field></b>
    Additions
    1. ... ON psel
    2. ... ON END OF sel
    3. ... ON VALUE-REQUEST FOR psel_low_high .
    4. ... ON HELP-REQUEST FOR psel_low_high
    5. ... ON RADIOBUTTON GROUP radi
    6. ... ON BLOCK block
    7. ... OUTPUT
    <b>Interactive Events</b>
    •     At line-selection
    •     At user-command
    Message was edited by: Ashok Parupalli

  • Error in event driven reporting

    Dear Gurus...I created the following procedure to implement Event Driven Reporting:
    CREATE OR REPLACE procedure ABC.eve_drv_rep as
    myPlist system.SRW_PARAMLIST;
    myIdent system.SRW.Job_Ident;
    BEGIN
    myPlist := system.SRW_PARAMLIST(system.SRW_PARAMETER('',''));
    system.srw.add_parameter(myPlist,'GATEWAY','http://192.168.1.133/reports/rwservlet);
    system.srw.add_parameter(myPlist,'SERVER','rep_appsrv_frhome1');
    system.srw.add_parameter(myPlist,'REPORT','y:\02\02\Gry_02_01.rep');
    system.srw.add_parameter(myPlist,'USERID','def/xyz@nml');
    system.srw.add_parameter(myPlist,'DESTYPE','email');
    system.srw.add_parameter(myPlist,'DESFORMAT','PDF');
    system.srw.add_parameter(myPlist,'DESNAME','[email protected]');
    myIdent := system.srw.run_report(myPlist);
    EXCEPTION
    when others then
    raise_application_error(-20001,'Error sending email.Error: '||sqlerrm);
    --Dbms_Put.Put_Line('Error sending email.Error: '||dbms_util.get_detailed_sqlerrm);
    END;
    Procedure is created successfully but when I execute this procedure, I get the following error:
    ORA-20001'Error sending email.Error: ORA-20999
    ORA-06512: at "Nml.Eve_Drv_Rep", line 17
    ORA-06512: at line 1
    Can u guess where is the problem?
    2ndly I want to know that whether I should give IP address or Application Server Machine Name in GATEWAY parameter?
    And in SERVER parameter either I should give the Application Server Machine Name or Report Server name installed on Application Server Machine?
    Lastly from where I can get the complete list of Parameters to be added in SRW.Add_Parameter like SERVER, GATEWAY etc.
    Please note that we r using Database 10g Rel.2 and Forms and Reports services on Application Server on Widows Server-2003 platform and the report being called was developed in Reports 10g.

    A few remarks:
    Remove the exception handler, since it masks the exact error.
    Turn on debugging, because it will give you better information about the error.
    srw.start_debugging;
    srw.stop_debugging;Did you configure an smtp server in server_name.conf?
    Are you able to run the report directly from your browser with the same URL?
    where I can get the complete list of Parameters to be added in SRW.Add_Parameter like SERVER, GATEWAY etc.Oracle has manuals for everything.
    http://download.oracle.com/docs/cd/E12839_01/bi.1111/b32121/pbr_evnt001.htm#i1007523

  • Error in event driven procedure

    Dear Gurus...I created the following procedure to implement Event Driven Reporting:
    CREATE OR REPLACE procedure ABC.eve_drv_rep as
    myPlist system.SRW_PARAMLIST;
    myIdent system.SRW.Job_Ident;
    BEGIN
    myPlist := system.SRW_PARAMLIST(system.SRW_PARAMETER('',''));
    system.srw.add_parameter(myPlist,'GATEWAY','http://192.168.1.133/reports/rwservlet);
    system.srw.add_parameter(myPlist,'SERVER','rep_appsrv_frhome1');
    system.srw.add_parameter(myPlist,'REPORT','y:\02\02\Gry_02_01.rep');
    system.srw.add_parameter(myPlist,'USERID','def/xyz@nml');
    system.srw.add_parameter(myPlist,'DESTYPE','email');
    system.srw.add_parameter(myPlist,'DESFORMAT','PDF');
    system.srw.add_parameter(myPlist,'DESNAME','[email protected]');
    myIdent := system.srw.run_report(myPlist);
    EXCEPTION
    when others then
    raise_application_error(-20001,'Error sending email.Error: '||sqlerrm);
    --Dbms_Put.Put_Line('Error sending email.Error: '||dbms_util.get_detailed_sqlerrm);
    END;
    Procedure is created successfully but when I execute this procedure, I get the following error:
    ORA-20001'Error sending email.Error: ORA-20999
    ORA-06512: at "Nml.Eve_Drv_Rep", line 17
    ORA-06512: at line 1
    Can u guess where is the problem?
    2ndly I want to know that whether I should give IP address or Application Server Machine Name in GATEWAY parameter?
    And in SERVER parameter either I should give the Application Server Machine Name or Report Server name installed on Application Server Machine?
    Lastly from where I can get the complete list of Parameters to be added in SRW.Add_Parameter like SERVER, GATEWAY etc.
    Please note that we r using Database 10g Rel.2 and Forms and Reports services on Application Server on Widows Server-2003 platform and the report being called was developed in Reports 10g.

    Hi,
    Remove this (And never put it in again)
    EXCEPTION
    when others then
    raise_application_error(-20001,'Error sending email.Error: '||sqlerrm);
    --Dbms_Put.Put_Line('Error sending email.Error: '||dbms_util.get_detailed_sqlerrm);This will tell you more about what is going on, such as giving you the location of the error.
    But 20999, is a user defined exception, are you putting objects into system schema?
    Regards
    Peter

Maybe you are looking for