Writing to dat using GUI

Can someone please help me with my code as i am stuck, I have succesfully displayed the question i want to screen using the button find. Then and only then will the bottom panel be shown with the question and relevant answers displayed in text boxes.
I need help in overwriting what the text box said to what the user then changes it to and writing it to the dat file. any help on this would be greatly appreciated as its part of an assignment i have to do for next week and this is only one part of it cheers. My code is as follows:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class UpdateQuestions extends JFrame implements ActionListener
     Container cPane;
     JPanel p1,p2;
     JButton btnFind,btnUpdate,btnClose;
     JTextField tfNumberSearch,tfQuestionNum,tfQuestion,tfAnswerA,tfAnswerB,tfAnswerC,tfCorrect;
     JLabel lblNumberSearch,lblQuestion,lblAnswerA,lblAnswerB,lblAnswerC,lblCorrect;
     RandomAccessFile rf;
     UpdateQuestions()
          cPane = getContentPane();
          cPane.setBackground(Color.RED);
          //Build Update Window
          setTitle("Update Quiz Questions");
          setSize(1024,768);
          setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
          //Absolute Layout Manager
          cPane.setLayout(null);
          //Size & Layout For Top Panel
          p1 = new JPanel();
          p1.setBackground(Color.WHITE);
          p1.setBounds(50,50,600,100);
          p1.setLayout(null);
          cPane.add(p1);
          //Top Panel
          lblNumberSearch = new JLabel("Enter Question No");
          lblNumberSearch.setFont(new Font("Serif",Font.BOLD,24));
          lblNumberSearch.setForeground(Color.BLACK);
          lblNumberSearch.setBounds(10,30,200,50);
          p1.add(lblNumberSearch);
          tfNumberSearch = new JTextField();
          tfNumberSearch.setFont(new Font("Serif",Font.BOLD,18));
          tfNumberSearch.setColumns(3);
          tfNumberSearch.setForeground(Color.BLACK);
          tfNumberSearch.setBounds(210,30,100,50);
          p1.add(tfNumberSearch);
          btnFind = new JButton("Find");
          btnFind.setFont(new Font("Serif",Font.BOLD,26));
          btnFind.addActionListener(this);
          btnFind.setBounds(400,10,100,80);
          p1.add(btnFind);
          p1.setVisible(true);
          //Size & Layout For Bottom Panel
          p2 = new JPanel();
          p2.setBounds(50,250,900,400);
          p2.setLayout(null);
          cPane.add(p2);
          // Question Label & Text Box
          lblQuestion = new JLabel("Question");
          lblQuestion.setFont(new Font("Serif",Font.BOLD,24));
          lblQuestion.setForeground(Color.BLACK);
          lblQuestion.setBounds(10,10,330,50);
          p2.add(lblQuestion);
          tfQuestion = new JTextField();
          tfQuestion.setFont(new Font("Serif",Font.BOLD,18));
          tfQuestion.setColumns(50);
          tfQuestion.setForeground(Color.BLACK);
          tfQuestion.setBounds(150,10,600,50);
          p2.add(tfQuestion);
          //Answer A Label & Text Box
          lblAnswerA = new JLabel("Answer A");
          lblAnswerA.setFont(new Font("Serif",Font.BOLD,24));
          lblAnswerA.setForeground(Color.BLACK);
          lblAnswerA.setBounds(10,90,330,50);
          p2.add(lblAnswerA);
          tfAnswerA = new JTextField();
          tfAnswerA.setFont(new Font("Serif",Font.BOLD,18));
          tfAnswerA.setColumns(20);
          tfAnswerA.setForeground(Color.BLACK);
          tfAnswerA.setBounds(150,90,400,50);
          p2.add(tfAnswerA);
          //Answer B Label & Text Box
          lblAnswerB = new JLabel("Answer B");
          lblAnswerB.setFont(new Font("Serif",Font.BOLD,24));
          lblAnswerB.setForeground(Color.BLACK);
          lblAnswerB.setBounds(10,170,330,50);
          p2.add(lblAnswerB);
          tfAnswerB = new JTextField();
          tfAnswerB.setFont(new Font("Serif",Font.BOLD,18));
          tfAnswerB.setColumns(20);
          tfAnswerB.setForeground(Color.BLACK);
          tfAnswerB.setBounds(150,170,400,50);
          p2.add(tfAnswerB);
          //Answer C Label & Text Box
          lblAnswerC = new JLabel("Answer C");
          lblAnswerC.setFont(new Font("Serif",Font.BOLD,24));
          lblAnswerC.setForeground(Color.BLACK);
          lblAnswerC.setBounds(10,250,330,50);
          p2.add(lblAnswerC);
          tfAnswerC = new JTextField();
          tfAnswerC.setFont(new Font("Serif",Font.BOLD,18));
          tfAnswerC.setColumns(20);
          tfAnswerC.setForeground(Color.BLACK);
          tfAnswerC.setBounds(150,250,400,50);
          p2.add(tfAnswerC);
          //Correct Answer Label & Text Box
          lblCorrect = new JLabel("Correct");
          lblCorrect.setFont(new Font("Serif",Font.BOLD,24));
          lblCorrect.setForeground(Color.BLACK);
          lblCorrect.setBounds(10,330,330,50);
          p2.add(lblCorrect);
          tfCorrect = new JTextField();
          tfCorrect.setFont(new Font("Serif",Font.BOLD,18));
          tfCorrect.setColumns(20);
          tfCorrect.setForeground(Color.BLACK);
          tfCorrect.setBounds(150,330,400,50);
          p2.add(tfCorrect);
          btnUpdate = new JButton("Update");
          btnUpdate.setFont(new Font("Serif",Font.BOLD,26));
          btnUpdate.addActionListener(this);
          btnUpdate.setBounds(700,300,150,80);
          p2.add(btnUpdate);
          p2.setVisible(false);
     private String pad(String s,int size)
          int x;
          for (x = s.length(); x < size; x++)
               s = s + " ";
          return s;
     public void actionPerformed(ActionEvent e)
          int num;
          if(e.getSource()==btnClose)
               try
                    rf.close();
                    setVisible(false);
               catch(IOException ex3)
               JOptionPane.showMessageDialog(null,"Cannot Close Question.dat");
          if(e.getSource()==btnFind)
               boolean eof,found;
               int qNo;
               long posQ, posAnsA, posAnsB, posAnsC, posCorrect;
               String question="", answerA="", answerB="", answerC="", answerCorrect="";
               num = Integer.parseInt(tfNumberSearch.getText());
               eof=false;
               found=false;
               try
                    rf = new RandomAccessFile("Question.dat","rw");
                    rf.seek(0);
               catch(FileNotFoundException ex1)
                    JOptionPane.showMessageDialog(null,"Cannot Open Question.dat");
               catch (IOException ex)
                    eof=true;
               while(!eof)
                    try
                         qNo = rf.readInt();
                         posQ = rf.getFilePointer(); question = rf.readUTF();
                         posAnsA = rf.getFilePointer(); answerA=rf.readUTF();
                         posAnsB = rf.getFilePointer(); answerB=rf.readUTF();
                         posAnsC = rf.getFilePointer(); answerC=rf.readUTF();
                         posCorrect = rf.getFilePointer(); answerCorrect=rf.readUTF();
                         if(num==qNo)
                              found=true;
                              eof=true;
                              tfQuestion.setText(question);
                              tfAnswerA.setText(answerA);
                              tfAnswerB.setText(answerB);
                              tfAnswerC.setText(answerC);
                              tfCorrect.setText(answerCorrect);
                              p2.setVisible(true);
                              rf.close();                                                  
                    catch (IOException ex)
                         eof=true;
               }// End of While not !eof     
          }// End of Find Button
          if(e.getSource()==btnUpdate)
               String question, answerA, answerB, answerC, answerCorrect;
               long posQ, posAnsA, posAnsB, posAnsC, posCorrect;
               question = tfQuestion.getText();
               question = pad(question,80);
               answerA = tfAnswerA.getText();
               answerA = pad(answerA,20);
               answerB = tfAnswerB.getText();
               answerB = pad(answerB,20);
               answerC = tfAnswerC.getText();
               answerC = pad(answerC,20);
               answerCorrect = tfCorrect.getText();
               answerCorrect = pad(answerCorrect,20);
               rf.seek(posQ);
               rf.writeUTF(question);
               rf.seek(posAnsA);
               rf.writeUTF(answerA);
               rf.seek(posAnsB);
               rf.writeUTF(answerB);
               rf.seek(posAnsC);
               rf.writeUTF(answerC);
               rf.seek(posCorrect);
               rf.writeUTF(answerCorrect);
     }//End of Action Performed
}//End of UpdateQuestions

Create your JFrames, then use
myFirstFrame.setVisible( true );
// time to launch second
mySecondFrame.setVisible( true );
// time to hide second
mySecondFrame.setVisible( false );The simplest file I/O will work for you. Use a FileOutputStream to write the file. I think three lines of code should do the trick. See the API docs for java.io.

Similar Messages

  • Displaying real-time data using gui meter from multiple channels.

    I am using DAQ USB-6009 for my assignment. Part of my task is to display real-data from multiple channels in the form of gui meters.  eg. irradiance and voltage...
    I used a split signal to separate the signals from different channels coming out of the data output terminal of the DAQ assistant. The problem is that I do not know which vi to connect in between the split signal and the gui meter. I am looking for one vi that is capable of handling signals (measurement)  and outputting the data to the gui meters simultaneously and individually based on the channel they are coming from.

    Thnx for your tip, Dennis.
    However, I have another problem that just occurred to me when my VI manages to execute as I wanted.
    I noticed that the needle on my gui meter will only "appears" to be responding to every changes to its input when I have set it to run continuously and the only way to stop it is via abortion which might leave the resources (eg. external hardware) in unknown state. Is there any safer and workable ways to organise the VIs using while loop?
    I have placed my DAQ assistant, write to measurement file (vi), add function, split signal and gui meters all in 1 single while loop.
        DAQ-------> write to measurement file
                 |
                 |                                                 ​                   |--------------------------------> add function----> gui meters
                 ---------------------------------------------> split signals ---|--------------------------------> add function----> gui meters
                                                      ​                                |--------------------------------> add function----> gui meters
    If I do the following steps,
    1. press run continuously to start the VI
    2. click the same button to disable continuous run when the VI has completed its task.
    3. click the stop button in the front panel to stop the while loop
    Does doing these steps ensure that I will not leave resources in unknown state? Is it a safer way to stop a VI which is running continuously?
    Pardon me for I am new to LabView. Even though, I have read the user's
    manual and tried out all the execises, there are some concepts that I
    need clarification on and mistakes that I need to discover through more hands-on.

  • Writing CLOB data using UTL_FILE to several files by settingmaxrows in loop

    Hey Gurus,
    I have a procedure that creates a CLOB document (in the form of a table in oracle 9i). I need to now write this large CLOB data (with some 270,000 rows) into several files, setting the row max at 1000. So essentially ther would be some sort of loop construct and substr process that creates a file after looping through 1000 rows and then continues the count and creates a another file until all 270 xml files are created. Simple enough right...lol? Well I've tried doing this and haven't gotten anywhere. My pl/sql coding skills are too elementary I am guessing. I've only been doing this for about three months and could use the assistance of a more experienced person here.
    Here are the particulars...
    CLOB doc is a table in my Oracle 9i application named "XML_CLOB"
    Directory name to write output to "DIR_PATH"
    DIRECTORY PATH is "\app\cdg\cov"
    Regards,
    Chris

    the xmldata itself in the CLOB would look like this for one row.
    <macess_exp_import_export_file><file_header><file_information></file_information></file_header><items><documents><document><external_reference></external_reference><processing_instructions><update>Date of Service</update></processing_instructions><filing_instructions><folder_ids><folder id="UNKNOWN" folder_type_id="19"></folder></folder_ids></filing_instructions><document_header><document_type id="27"></document_type><document_id>CUE0000179</document_id><document_description>CUE0000179</document_description><document_date name="Date of Service">1900-01-01</document_date><document_properties></document_properties></document_header><document_data><internal_file><document_file_path>\\adam\GiftSystems\Huron\TIFS\066\CUE0000179.tif</document_file_path><document_extension>TIF</document_extension></internal_file></document_data></document></documents></items></macess_exp_import_export_file>

  • Writing the file using Write to SGL and reading the data using Read from SGL

    Hello Sir, I have a problem using the Write to SGL VI. When I am trying to write the captured data using DAQ board to a SGL file, I am unable to store the data as desired. There might be some problem with the VI which I am using to write the data to SGL file. I am not able to figure out the minor problem I am facing.  I am attaching a zip file which contains five files.
    1)      Acquire_Current_Binary_Exp.vi -> This is the VI which I used to store my data using Write to SGL file.
    2)      Retrive_BINARY_Data.vi -> This is the VI which I used to Read from SGL file and plot it
    3)      Binary_Capture -> This is the captured data using (1) which can be plotted using (2) and what I observed is the plot is different and also the time scare is not as expected.
    4)      Unexpected_Graph.png is the unexpected graph when I am using Write to SGL and Read from SGL to store and retrieve the data.
    5)      Expected_Graph.png -> This is the expected data format I supposed to get. I have obtained this plot when I have used write to LVM and read from LVM file to store and retrieve the data.
    I tried a lot modifying the sub VI’s but it doesn’t work for me. What I think is I am doing some mistake while I am writing the data to SGL and Reading the data from SGL. Also, I don’t know the reason why my graph is not like (5) rather I am getting something like its in (4). Its totally different. You can also observe the difference between the time scale of (4) and (5).
    Attachments:
    Krishna_Files.zip ‏552 KB

    The binary data file has no time axis information, it is pure y data. Only the LVM file contains information about t(0) and dt. Since you throw away this information before saving to the binary file, it cannot be retrieved.
    Did you try wiring a 2 as suggested?
    (see also http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=925 )
    Message Edited by altenbach on 07-29-2005 11:35 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Retrive_BINARY_DataMOD2.vi ‏1982 KB

  • Help: writing large data to excel using java

    Hi All
    I had a question writing a 6000 rows of data with 20 colums to a excel sheet. I am using Apache POI
    When we are writing some data to a file we store the data in an stringbuffer and then write the data to the file all at once.
    Is the same possible with excel? if so how?
    And what is the best way of wring data to an EXCEL file considering the above data into consideration.
    Please guide me thanks in advance.
    Regards
    Diana

    Text Files and Excel formatted files treat things differently--basically no, you cannot group multiple fields into one string: Excel has the concept of cells that you need to write the data into and will act similar to fields in a DB. On the other hand, you can drop the Excel formatting and write CSV files and Excel will load them just fine. With a CSV file you can write it all to a String, StringBuffer, StringBuilder or what ever String type of object you want and write an entire line at a time.

  • Need help in SQL Queries using GUI controls or variables

    Hello, all
    I have a big problem (I have already had with Visual Basic a few mounths ago) with Java while writing my SQL Queries.
    I would like to know how I must do to use variable data or GUI control data in my SQL Query to select only some records.
    Here, my first Query that works without any problem (no WHERE clause !!!) :
    Statement requeteBedes = connectBedes.createStatement();
    ResultSet resultatSeries = requeteBedes.executeQuery("SELECT * FROM Series");
    initComboBoxSeries(resultatSeries);the method "initComboBoxSeries" fills a JComboBox with all the names of the series in my database.
    Here comes my problem.I would like to use the value of the selected "series" in the JComboBox to search in another table of the same Database. I made another statement but it returns a Null ResultSet :
    ResultSet resultatSearchAlbumsFromSeries = requeteBedes.executeQuery("SELECT * FROM bandes_dess WHERE  ser_nom = '" + strComboBoxSeriesSelected + "' "); The variable strComboBoxSeriesSelected contains the value of the selected line in the combobox with all the series, filled after the first query that is here above and that works very well.
    Could some one help me and tell me how I must use variables or GUI controls values in my SQL Queries or tell me if there is a place where I could find an explanation of that kind of problems (like more "advanced SQL Queries", as the ones currently used in all the Learning Java 2 books)
    Thank you all for your help.
    Christian.

    executeQuery() will never return null. At least that's what the spec says. You are probably catching an exception (probably a syntax error caused by a single quote in strComboBoxSeriesSelected) and ignoring it. Or do you mean the ResultSet contains no rows?
    Anyway, to use parameterized queries, take a look at PreparedStatements. Your code should look like this using PreparedStatement:Statement requeteBedes = connectBedes.prepareStatement("SELECT * FROM bandes_dess WHERE  ser_nom = ?");
    requeteBedes.setString(1, strComboBoxSeriesSelected);
    ResultSet resultatSeries = requeteBedes.executeQuery();Alin.

  • Header in Excel when downloading using GUI DOWNLOAD

    Hi,
    I have a requirement where i need to download data from table into an excel sheet on a location in PC. I used FM 'GUI DOWNLOAD' for this purpose. Now, i need a header to be displayed in the excel when i download. The header should contain a date which is entered during the execution as a screen input. How to display this date as a header in the excel sheet when using GUI DOWNLOAD.

    Hi,
    If you only want the header to be displayed in the first row, you can do as suggested by Ikshula.
    If you want a real excel header, you can use OLE and set the property ActiveSheet.PageSetup.LeftHeader (or CenterHeader, or RightHeader) to the value "&D". This will add the current system date as header (you can of course pass any other value between the " ").
    Kr,
    m.

  • Problem writing meta data changes in xmp in spite of enabled settings

    Dear Adobe Community
    After struggling with this for two full days and one night, you are my last hope before I give up and migrate to Aperture instead.
    I am having problems with Lightroom 5 writing meta data changes into xmp and including development settings in JPEG, inspite of having ticked all three boxed in catalog settings.
    In spite of having checked all boxes, Lightroom refused to actually perform the actions. I allowed the save action to take a lot longer than the saving indicator showed was needed, but regardless of this no edits made in the photo would be visible outside Lightroom. I also tried unticking and ticking and restarting my compute.
    Therefore, I uninstalled the program and the reinstalled it again (the trial version both times). I added about 5000 images to Lightroom (i.e. referenced). After having made a couple of changes for one photo in development settings, I tried closing the program. However, then this message was then displayed:
    I left the program open and running for about 5-5 hours, then tried closing the program, but the message still came up so I closed the program and restarted the computer. I tried making changes to another photo, saving and then closing and the same message comes up. The program also becomes unresponsive, and of course still no meta data has been saved to the photo, i.e. when opening it outside Lightroom, the edits of the photos is not shown.
    What do do? I would greatly appreciate any insights, since I have now completely hit the wall.
    Oh yes, that´s right:
    What version of Lightroom? Include the minor version number (e.g., Lighroom 4 with the 4.1 update).
    Lightroom 5.3
    Have you installed the recent updates? (If not, you should. They fix a lot of problems.)
    I installed the program two days ago and then for the second time today.
    What operating system? This should include specific minor version numbers, like "Mac OSX v10.6.8"---not just "Mac".
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
    What kind(s) of image file(s)? When talking about camera raw files, include the model of camera.
    JPEG
    If you are getting error message(s), what is the full text of the error message(s)?
    Please see screen dumps above
    What were you doing when the problem occurred?
    Trying to save metadata + trying to open images that it seemed I had saved meta data to
    Has this ever worked before?
    No
    What other software are you running?
    For some time Chrome, Firefox, Itunes. Then I closed all other software.
    Tell us about your computer hardware. How much RAM is installed?  How much free space is on your system (C:) drive?
    4 GB 1333 MHz DDR3
    Has this ever worked before?  If so, do you recall any changes you made to Lightroom, such as adding Plug-ins, presets, etc.?  Did you make any changes to your system, such as updating hardware, printers or drivers, or installing/uninstalling any programs?
    No, the problems have been there all the time.

    AnnaK wrote:
    Hi Rob
    I think you succeeded in partly convincing me. : ) I think I will go for a non-destrucitve program like LR when I am back in Sweden, but will opt for a destructive one for now.  Unfortuntately, I have an Olypmus- so judging from your comment NX2 might not be for me.
    Hi AnnaK (see below).
    AnnaK wrote:
    My old snaps are JPEG, but I recently upgraded to an Olympus e-pl5 and will notw (edited by RC) start shooting RAW.
    Note: I edited your statement: I assume you meant now instead of not.
    If you start shooting raw, then you're gonna need a raw processor, regardless of what the next step in the process will be. And there are none better for this purpose than Lightroom, in my opinion. As has been said, you can export those back to Lightroom as jpeg then delete the raws, if storage is a major issue, or convert to Lossy DNG. Both of those options assume you're willing to adopt a non-destructive workflow, from there on out anyway (not an absolute requirement, but probably makes the most sense). It's generally a bad idea to edit a jpeg then resave it as a jpeg, because quality gets progressively worse every time you do that. Still, it's what I (and everybody else) did for years before Lightroom, and if you want to adopt such a workflow then yeah: you'll need a destructive editor that you like (or as I said, you can continue to use Lightroom in that fashion, by exporting new jpegs and deleting originals - really? that's how you want to go???). Reminder: NX2 works great on jpegs, and so is still very much a candidate in my mind - my biggest reservation in recommending it is uncertainty of it's future (it's kinda in limbo right now).
    AnnaK wrote:
    Rob Cole wrote:
    There is a plugin which will automatically delete originals upon export, but relying on plugins makes for additional complication too.
    Which plugin is this?
    Exportant (the option is invisible by default, but can be made visible by editing a text config file). To be clear: I do not recommend using Exportant for this purpose until after you've got everything else setup and functioning, and even then it would be worth reconsidering.
    AnnaK wrote:
    Rob Cole wrote:
    What I do is auto-publish to all consumption destinations after each round of edits, but that takes more space.
    How do you do this?
    Via Publish Services.
    PS - I also use features in 'Publish Service Assistant' and 'Change Manager' plugins (for complete automation), but most people just select publish collections and/or sets and click 'Publish' - if you only have a few collections/services it's convenient enough.
    AnnaK wrote:
    Would you happen to have any tips on which plugins I may want to use together with Photoshop Elements?
    No - sorry, maybe somebody else does.
    Did I get 'em all?
    Rob

  • Exception writing binary data to the output stream to client -Broken pipe

    Hi,
    I am trying to use the drag & drop feature using Contributor mode of Webcenter sites. Single Image Page Attribute is working properly where as Multiple Image Page Attribute throws the following error:
    [ERROR] [.kernel.Default (self-tuning)'] [logging.cs.satellite.request] Exception writing binary data to the output stream to client 10.191.117.106
    java.net.SocketException: Broken pipe
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:568)
         at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:539)
         at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:427)
         at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:648)
         at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:333)
         at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:148)
         at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:148)
         at COM.FutureTense.Servlet.ServletRequest$OutputOutputStream.write(ServletRequest.java:80)
         at COM.FutureTense.Servlet.ServletRequest.write(ServletRequest.java:1633)
         at com.openmarket.Satellite.RequestContext.write(RequestContext.java:1123)
         at com.openmarket.Satellite.BytePiece.stream(DataPiece.java:253)
         at com.openmarket.Satellite.CacheObjectImpl.stream(CacheObjectImpl.java:651)
         at com.openmarket.Satellite.Http11Responder.respondForWrapper(Http11Responder.java:142)
         at com.openmarket.Satellite.WrapperAwareResponder.respond(WrapperAwareResponder.java:36)
         at com.openmarket.Satellite.SatelliteServer.execute(SatelliteServer.java:85)
         at com.openmarket.Satellite.servlet.BaseServlet.doGet(BaseServlet.java:118)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at com.fatwire.wem.sso.cas.filter.CASFilter.doFilter(CASFilter.java:557)
         at com.fatwire.wem.sso.SSOFilter.doFilter(SSOFilter.java:51)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Thanks
    KarthiK

    Thank u very much,
         FileOutputStream opGif = new FileOutputStream(destFile, false);
    I have changed above line with the following line:
         PrintWriter opGif = new PrintWriter ( new FileWriter(destFile, false));
    and now this code is working very fine.
    Thanks once again...

  • Writing binary data to a file without carriage returns every 512 bytes

    Is there a VI for writing binary data to a file without carriage returns being inserted every 512 bytes?
    Thanks

    Hi Momolxg,
    I could be way off on this. I tried to simulate what you've done by
    making a for loop that would run a set number of times. For my example I
    used 1025. I wired the iteration terminal to a 'Write to SGL File.vi'
    outside the loop with indexing enabled. It wrote the SGL data from 0 to
    1024 to the file. I then read the file with a 'Read Characters from
    File.vi' and searched the output for a carriage return (0D hex). It was
    found five times. The reason why was the SGL number it was reading had a
    13 (0D hex) in it. Perhaps you're running into a similar problem?
    I tried it again, this time using the 'Write to I16 File.vi'. The
    carriage return was found five times: the 28th character the first time
    then on the 512th character four consecutive time
    s after that. I suppose
    that makes sense that you'd find a 0D in the numbers at equal spacings if
    they're incrementing this way... In this case the carriage returns you're
    seeing are actually numbers from your data.
    One big difference is that I'm using a set pattern of numbers. This
    doesn't appear to be your case. Is there a better way we can duplicate
    your problem? It sounds interesting. Again my simulation could be way
    off. (I'm also running this on LV60 for Linux so my results could be
    different)
    - Kevin
    In article <[email protected]>,
    "momolxg" wrote:
    > Is there a VI for writing binary data to a file without carriage returns
    > being inserted every 512 bytes? Thanks

  • Wrting zip Data using File adapter

    Did any one tried or implemented writing zip/gz file using File adapter.
    I know how to write opaque data using Base64Binary. But i am not getting on how to use file adapter for writing zip file.
    Any help / suggestions are greatly appreciated.
    Thanks !!

    Thanks for the reply, have been using opaque for a while now and know the read & write for that.
    My problem is i am not able to get how i can write compressed data , writing binary data is fine i can use string->encode->base64binary->opaque and can write that.
    But that will not be the compressed form.
    Thanks !!

  • What's the fastest C function for writing binary data to disk?

    I'm acquiring data at high speeds across multiple boards and I'm having a hard time writing the data to disk fast enough to keep up. I'm programming in C in Visual Studios and I'm currently using fwrite. I have a similar system set up in LabView and my C code can't perform as well. Is there a better or faster way to write to disk in C?

    Some speculated a few years ago that there would be
    no reason to use Fortran too. :)Are you saying there's a reason to use Fortran? Help me lord!
    Anyway, they were right! The industry may be stalling, but the vision is not. The economy and many other factors are to blame for why we haven't been able to break out of the computing paradigm we're stuck in. It's like the automobile, it hasn't changed in a century. Why? $$$
    Oh, people said we'd have flying cars by now, where are they? Well we do have them! But we're too busy spending that 400 billion a year on war instead of evolving as a species.
    Anyway, when we take the next step and have true distributed computing with multi-core processors everywhere, Java will run, Java will scale, and Java will outperform ANYTHING available.
    And speaking of game programming, the PS3 developers are having a hell of a time doing the 3 CPUs. Why? Because all they've ever done is single & double processor systems. It's time to think out of the box. When a game console hits the market with 512 CPU cores, do you REALLY think C/C++ will run on that? But, Java was designed for it.
    Java = the future
    C++ = the past

  • Getting an error as "Access denied" while writing the data into CRM 2013?

    Hi,
    I have written code in Script component Transformation to connect CRM 2013. I have used CRM 2013 SDK to connect it.
    #region
    Help:  Introduction to the Script Component
    /* The Script Component allows you to perform virtually any operation that can be accomplished in
    * a .Net application within the context of an Integration Services data flow.
    * Expand the other regions which have "Help" prefixes for examples of specific ways to use
    * Integration Services features within this script component. */
    #endregion
    #region
    Namespaces
    using
    System;
    using
    System.Data;
    using
    Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using
    Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using
    Microsoft.Xrm.Sdk;
    using
    Microsoft.Xrm.Sdk.Query;
    using
    Microsoft.Xrm.Sdk.Client;
    using
    Microsoft.Xrm.Sdk.Messages;
    using
    System.ServiceModel;
    using
    System.ServiceModel.Description;
    #endregion
    [Microsoft.SqlServer.Dts.Pipeline.
    SSISScriptComponentEntryPointAttribute]
    public
    classScriptMain:
    UserComponent
    //This
    method is called once, before rows begin to be processed in the data flow.
    ///You
    can remove this method if you don't need to do anything here.
    IOrganizationServiceorganizationservice;   
    // Variables for the CRM webservice credentials
    // You could also declare them in the PreExecute
    // if you don't use it anywhere else
    stringCrmUrl =
    stringCrmDomainName =
    stringCrmUserName =
    stringCrmPassWord =
    publicoverridevoidPreExecute()
    base.PreExecute();
             * Add your code here
    CrmUrl =
    this.Variables.CrmWebservice.ToString();
            CrmDomainName =
    this.Variables.CrmDomainName.ToString();
            CrmUserName =
    this.Variables.CrmUserName.ToString();
            CrmPassWord =
    this.Variables.CrmPassWord.ToString();
    // Connect to webservice with credentials
    ClientCredentialscredentials =
    newClientCredentials();
            credentials.UserName.UserName =
    string.Format("{0}\\{1}",
    CrmDomainName, CrmUserName);//"[email protected]";
            credentials.UserName.Password = CrmPassWord;
            organizationservice =
    newOrganizationServiceProxy(newUri(CrmUrl),
    null, credentials,
    null);
    ///This
    method is called after all the rows have passed through this component.
    ///You
    can delete this method if you don't need to do anything here.
    //</summary>
    publicoverridevoidPostExecute()
    base.PostExecute();
             * Add your code here
    ///<summary>
    ///This
    method is called once for every row that passes through the component from Input0.
    //<param
    name="Row">The row that is currently passing through the component</param>
    publicoverridevoidInput0_ProcessInputRow(Input0BufferRow)
             * Add your code here
    EntityContact =
    newEntity("Contact");
       Contact["Employeeid"] = Row.EmpId;    
     if (!Row.Prefix_IsNull)
        Contact["MiddleName"] = Row.Prefix;
    organizationservice.Create(Contact);
    I was getting an error when the Create method is called from Organizationservice object and it is executing fine till that method. Could you please suggest me how to go further on this?
    Thanks &amp;amp; Regards, Anil

    Hi Anil, 
    You want to make sure you use lower case for both CRM entity and field names. 
    In any case, writing a custom script component to talk to CRM may not sound terribly hard, but as soon as you get more business requirements and you deal with more entities, you will find it is not something trivial.
    For this reason, we highly recommend you check out a commercial offering which will actually save you a lot of time and effort. Check out our solution at http://www.kingswaysoft.com/products/ssis-integration-toolkit-for-microsoft-dynamics-crm/ for
    further details, we offer many integration features for Microsoft Dynamics CRM you can't find elsewhere, such as Upsert, Text Lookup, many-to-many relationship support, various writing actions, etc. 
    Disclaimer: I work for KingswaySoft
    Daniel Cai | http://danielcai.blogspot.com |
    @danielcai | Data Integration made easy with
    SSIS Integration Toolkit

  • How to display table field data using checkbox

    Dear sir,
              I have created PR using ME51N.  Our PR datas in EKPO table. 
              I have created select-option with prdat and Checkbox for to view PR open or closed status.
              I want check PR status details from date to date using check box.
             I have created the following code, but i will not generate output
    DATA: BEGIN OF leban OCCURS 0.
            INCLUDE STRUCTURE ekpo.
    DATA END OF leban.
    DATA new(1).
    SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.
    parameters lopen like new AS CHECKBOX USER-COMMAND opn.
    parameters lclose like new as checkbox user-command cls.
    at selection-screen.
    if ldat is initial.
       message 'Enter a value' type 'W'.
    endif.
    case sy-ucomm.
    when 'opn'.
       perform getpr.
       perform findopenpr  tables leban.
    endcase.
    form getpr.
    select * from ekpo into leban where PRDAT in ldat.
    append leban.
    endselect.
    endform.
    form findopenpr tables ekpo.
        IF LOPEN = 'X'.
           select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.
           SORT leban BY bnfpo.
           CLEAR leban.
           if not sy-subrc = 0.
             message  'PR OPEN' type 'S'.
           ENDIF.
           WRITE: / LEBAN-BANFN.
        ENDIF.
    endform.
    With Regards,
    Baskaran

    Hi,
    Try this way,
    You shouldnt be writing two select statements into the same internal table. Also i dont see any use of perform getpr. so remove that and try
    DATA: BEGIN OF leban OCCURS 0.
    INCLUDE STRUCTURE ekpo.
    DATA END OF leban.
    DATA: BEGIN OF leban1 OCCURS 0.
    INCLUDE STRUCTURE ekpo.
    DATA END OF leban1.
    DATA new(1).
    SELECT-OPTIONS ldat FOR sy-datum. "NO-DISPLAY.
    parameters lopen like new AS CHECKBOX USER-COMMAND opn.
    parameters lclose like new as checkbox user-command cls.
    at selection-screen.
    if ldat is initial.
    message 'Enter a value' type 'W'.
    endif.
    IF LOPEN = 'X'.
    select single * from ekpo into leban where PRDAT IN LDAT AND banfn = lopen.
    if sy-subrc = 0.
    message 'PR OPEN' type 'S'.
    ENDIF.
    WRITE: / LEBAN-BANFN.
    endif.
    if LCLOSE = 'X'.
    select single * from ekpo into leban1 where PRDAT IN LDAT AND banfn eq space.
    if sy-subrc = 0.
    message 'PR CLOSE' type 'S'.
    ENDIF.
    WRITE: / LEBAN1-BANFN.
    ENDIF.
    Regards,
    Vik
    Edited by: vikred on Aug 7, 2009 6:55 PM
    Edited by: vikred on Aug 7, 2009 7:23 PM

  • Can anyone tell me how to use GUI status in ALV report.

    Can anyone tell me how to use GUI status in ALV report. I want to use  buttons in ALV report.

    Juheb,
    see the link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    Adding a button on the ALV grid using OOPs
    check these sites.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
    chk this.
    alv-pfstatus:
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
    then how to capture that button click.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
    REPORT ZTESTALV.
    TYPE-POOLS: SLIS.
    *- Fieldcatalog
    DATA: IT_FIELDCAT  TYPE LVC_T_FCAT,
          IT_FIELDCAT1  TYPE SLIS_T_FIELDCAT_ALV..
    *- For Events
    DATA:IT_EVENTS TYPE SLIS_T_EVENT.
    DATA:  X_FIELDCAT  TYPE LVC_S_FCAT,
            X_FIELDCAT1  TYPE SLIS_FIELDCAT_ALV.
    DATA:X_LAYOUT TYPE LVC_S_LAYO.
    "{ FOR DISABLE
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    "} FOR DISABLE
    DATA: BEGIN OF IT_VBAP OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
       <b>   BUTTON(10),</b>
         END OF IT_VBAP.
    DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
    SELECT VBELN
           POSNR
           UP TO 10 ROWS
          INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
          FROM VBAP.
    DATA:L_POS TYPE I VALUE 1.
    CLEAR: L_POS.
    L_POS = L_POS + 1.
    <b>X_FIELDCAT-SELTEXT = 'Button'.
    x_fieldcat-fieldname = 'BUTTON'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-OUTPUTLEN = '10'.
    X_FIELDCAT-style = X_FIELDCAT-style bit-xor
                      cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
                      cl_gui_alv_grid=>MC_STYLE_ENABLEd.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.</b>
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'VBELN'.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '10'.
    x_fieldcat-ref_field = 'VBELN'.
    x_fieldcat-ref_table = 'VBAK'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'POSNR'.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '5'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    "{FOR DISABLE HERE 6ROW IS DISABLED
    SY-TABIX = 6.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 10.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    *LS_EDIT-FIELDNAME = 'POSNR'.
    *LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    *LS_EDIT-STYLE2 = SPACE.
    *LS_EDIT-STYLE3 = SPACE.
    *LS_EDIT-STYLE4 = SPACE.
    *LS_EDIT-MAXLEN = 6.
    *INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE .
    X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
    "} UP TO HERE
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
        I_CALLBACK_PROGRAM = SY-REPID
        IS_LAYOUT_LVC      = X_LAYOUT
        IT_FIELDCAT_LVC    = IT_FIELDCAT
      TABLES
        T_OUTTAB           = IT_VBAP[]
      EXCEPTIONS
        PROGRAM_ERROR      = 1
        OTHERS             = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Don't forget to reward if useful....

Maybe you are looking for

  • Customizing ActiveX Viewer for Crystal Reports 2008

    Here's the scenario.    We have reports designed in Crystal Reports 2008, that are deployed on Business Objects 3.1 Infoview. All reports have Parameters for users to choose. All reports are expected to refresh on open.Some are dynamic some are stand

  • Bank information

    Hi All,            I need to load in all the employee bank information in to SAP. My company only have a record of all the empoyees routing number in their legacy system but not the bank name. How can I find information about their corresponding bank

  • Customer Num (Kunnr) using Partner Functions (PARVW) in MV45AFZZ

    Hi all, Is it possible to get the Customer Number(KUNNR) by using Partner Function (PARVW) in MV45AFZZ, how? My requirement is to get the NAME1 and NAME2, for this i need the customer number and by passing only the partner function. But in VBPA datab

  • Iphone 4s won't turn on, but flash light is on

    Hello all, I have an iPhone 4s which is approx 5 weeks old, has never been dropped and has no water damage. The other day the flash light came on and I couldn't get it off but the phone was working perfectly fine. Then the phone died and now I can no

  • XP Home download?

    Hi Having acquired (2nd hand) a Toshiba Equium L10-273 with broken screen, which I subsequently replaced and then upgraded the memory, I would like to reload windows xp home from scratch but unfortunately the disc was misplaced before I acquired the