DoModal and Save Method in FieldChange

Hi All,
I have a scenario where On FieldChange Event,i have to save Record and then move to a secondary page.
On FieldChange, I code something like this
&MY_REC.Save();
DoModal(Page.MY_PAGE_SEC, "", - 1, - 1);
But I am getting Error
"Think-time PeopleCode event (EvalDoModal), but a SQL update has occurred in the commit interval."
"Think-time PeopleCode events such as messages requiring a user response cannot be executed if a SQL update, insert, or delete has occurred in the commit interval. Examples of PeopleCode that invoke update type of SQL includes Process Scheduler, TriggerBusinessEvent, or MarkWorked. A unit of work cannot contain both think-time events and update type SQL."
I would be very thankful if you provide some solution. What i want is, On Button click, I have to save record and move to secondary page.
Thanks

Try this
&MY_REC.Save();
CommitWork();
DoModal(Page.MY_PAGE_SEC, "", - 1, - 1);

Similar Messages

  • End program and save methods

    Okay so I'm working on a project with some friends and we're trying to write a java program (with a gui interface) that will create a text file that will store peoples info... My part is to create end and save buttons. The end button will pop up another window that will ask the user if they would like to save to the file and then shutdown the program. The save button should save and go back into the program to enter more entries... Can someone help me try to make this happen? I'm new and trying to learn java..
    THANKS IN ADVANCE

    Hey Flounder is this what you had in mind for me to write?
    //package components
              import java.io.ByteArrayInputStream;
              import java.io.IOException;
    //Button
              JButton saveButton;
    //For layout purposes, put the buttons in a separate panel
            JPanel buttonPanel = new JPanel();
              buttonPanel.add(saveButton);
    //Handle save button action.
            if (e.getSource() == saveButton) {
                FileSaveService fss = null;
                FileContents fileContents = null;
                ByteArrayInputStream is = new ByteArrayInputStream(
                        (new String("Saved by TeamDcmm").getBytes()));
                try {
                    fss = (FileSaveService)ServiceManager.
                              lookup("javax.jnlp.FileSaveService");
                } catch (UnavailableServiceException exc) { }
                if (fss != null) {
                    try {
                        fileContents = fss.saveFileDialog(null,
                                                          null,
                                                          is,
                                                          "TeamDcmm.txt");
                    } catch (Exception exc) {
                        log.append("Save command failed: "
                                   + exc.getLocalizedMessage()
                                   + newline);
                        log.setCaretPosition(log.getDocument().getLength());
                if (fileContents != null) {
                    try {
                        log.append("Saved file: " + fileContents.getName()
                                   + "." + newline);
                    } catch (IOException exc) {
                        log.append("Problem saving file: "
                                   + exc.getLocalizedMessage()
                                   + newline);
                } else {
                    log.append("User canceled save request." + newline);
                log.setCaretPosition(log.getDocument().getLength());
            }Edited by: zrankin on Mar 17, 2009 4:42 PM
    Edited by: zrankin on Mar 17, 2009 4:43 PM
    Edited by: zrankin on Mar 17, 2009 4:43 PM

  • Creating Load and Save methods to save to a DOT file.

    I have to create methods to save to a file and load to a file but I am not sure how to do this. So I was wondering if I could get advice on how to do this, thank you.

    LR's support for video metadata is very incomplete, and it doesn't write out video metadata back to the video file or to XMP sidecars.  Please see and vote on this topic in the official Adobe feedback forum:
    Lightroom: Metadata applied to videos in Lightroom isn't available in other applications

  • Can I Save and Saveas an excel running into a webbrowser (C#)? Permissions problems?

    Hi,
    When we open an excel via the Open method we can configure the parameters 'readonly = false' and 'editable = true' to allow saving with Save and Saveas methods avoiding the messages "A file named 'test.xls' already exists in this location. Do you want to replace it?"
    The problem is that I don't open the Excel file as above . My application (C#) charges the excel in a webbrowser inside a windows form so I prepere a workbook, I open it in the WebBrowser ( with Navigate method, not Open method) and  then  I assign the WebBrowser document to the application so I could continue to control it
    The question is: Is there any way to open this Excel file in a webbrowser with permissions similar to 'readonly = false' and 'editable = true' of the Open method???
    - If not, the Save function doesn't work and the saving only occurs when I change the content of the webbrowser ( for instance when I it's executed the line  mywebBrowser.Navigate("about:blank", false); ). Moreover It appears the messege "A file named 'test.xls' already exists in this location. Do you want to replace it?"
    - On the other way, if it can't be done, It`ll never works the Saveas function...
    I'd appreciate any suggest!

    This question won't get much action in the C# group...try posting it in the Discussions in Office Development or Discussions in Automation forum for interop questions.
    William Wegerson (www.OmegaCoder.Com)

  • Bopf save method

    Hi all,
    we have scenario where we are updating multiple record in bopf tables.
    in this we are using modify and save method of transnational manager.
    if we are updating 10 records and if  5th record is getting error while saving .
    it will not update remaining records.
    and save method will have 5th record error and same error its giving for the 6th record and not updating data .
    here 6th record data is correct and it should update.
    how we should clear this eo_messages of previous record in save method.
    any idea.
    thanks.
    Kesar.

    Hello Keser,
    Since you use the transaction manager save , I assume that you are updating the records from a report or some kind of external service consumer. How do you do the update ? Do you do a mass update by building all records in the modifications table and make a single call , or do you make a separate modify call per record ?
    If the error message leads to a failed save , it would mean that the BO has a consistency group of validations configured preventing the save from failing when the BO is inconsistent ( meaning if the validation return a failed key , the BO is inconsistent and shall not be saved ) resulting in the entire transaction failing.
    From a consumer perspective , the BO service provider provides the message to the service consumer indicating what is wrong , subduing/ignoring/removing that message will not result in the whole transaction proceeding to a successful save.
    You can do one of the two things here.
    1. The bad way - create one transaction per record, so only the transaction with the inconsistent record fails , the others are successful. This is not a recommended approach , you should always make use of mass enablement wherever possible.
    2. React to the error message from the first failed transaction , correct the inconsistent record and attempt the modification again. This method might require some user interaction , and goes against the idea of a fire and forget report.
    Thanks,
    Indranil.

  • Using iTunes why can you not backup and save your voicemail?  Guide me through this step by step if possible.  If alternate method MUST be used then provide same.  Truly appreciate this.

    Using iTunes why can you not backup and save your voicemail?  Guide me through this step by step if possible.  If alternate method MUST be used then provide same.  Truly appreciate this.

    Create and delete iPhone, iPad, and iPod touch backups in iTunes - Apple Support  - link doesn't state that voicemail is part of the backup
    iCloud: iCloud storage and backup overview  states that VVM is part of the icloud backup.
    You can also contact your cell phone provider - as voicemail is a carrier feature.

  • I am using both PSE 13 and Lightroom 5.  When I use Lightroom as an external editor and save the photo, it shows up in PSE13 as an edited file but does not look any different.  Why doesn't it appear edited?

    I am using both PSE 13 and Lightroom 5.  When I use Lightroom as an external editor and save the photo, it shows up in PSE13 as an edited file but does not look any different.  Why doesn't it appear edited?

    People who have Photoshop, but don't have Lightroom, need ACR so that they can use Raw files. Without ACR they could do nothing with those (they may also like having ACR so that they can work on other kinds of image using the same kinds of adjustments and techniques, as are used with Raw files).
    People who have Lightroom, can get access to Raw files regardless whether ACR is present or not. They can use Lightroom on other kinds of image also, using the same methods. LR can pass images directly into Photoshop without passing via ACR (or else does so transparently, which amounts to substantially the same thing).
    ACR does not, strictly speaking, even need to be installed for this external editing to happen. In fact, not even PS needs to be - since a different image editor can be used instead, while still retaining the Adobe Raw conversion etc.
    Lightroom "subcontracts out" specialised external tasks, in this workflow, but is still your "main contractor": the image is otherwise located, viewed, managed, adjusted/presented and output entirely using LR.
    So IMO we can divide image processing into:
    operations that involve pixels and layers and layer masks and adjustment layers etc (of the kind done inside Photoshop)
    operations that involve parametric edits (of the kind done in ACR where you are not using a Lightroom based workflow; otherwise, done inside Lightroom)
    When PS is called in, that's because those tasks are impossible or unsuitable to do in Lightroom. But those tasks can't be done in ACR either - by definition, since LR and ACR have exactly the same image processing "feature set".
    Lightroom is irrelevant to the Bridge + ACR + PS workflow. This workflow requires both your PS and your ACR to be current enough, to support your Raw format etc.
    ACR and Bridge are irrelevant to the LR + (image editor) workflow. It is in this case, only LR which needs to be current enough to support your Raw format etc.
    RP

  • Get image from Excel as shape and Save as .jpg

    Hello,
       I'm fairly new to ActiveX and am having a hard time doing a seemingly simple thing: getting a named image from an Excel file and saving it as a .jpg.  I have seen similar things done for Excel chart objects, but as I understand it images are "shapes" in Excel and I've been unable to find the right method to extract a shape. Please, if anyone could take a look at the attached folder and tell me if I am on the right track, if there is a better way to do this, or if there is a way to do this at all, it would be helpful.  Note that I don't care how efficient a strategy is developed - if I need to save to an intermediate file of another type, that's fine. The only goal is to be able to extract this image and save it with one mouse-click and no manual intervention.
    Folder contains: 1 example Excel file containing the image named "Picture 1"; 1 vi showing the method I've found for exporting Excel charts as .jpg's; and 1 vi with the progress I have made so far trying to pick the image from the Excel file and save it as a .jpg.  
    Thanks in advance!
    Megan
    Solved!
    Go to Solution.
    Attachments:
    GetExcelPicture.zip ‏70 KB

    Hi megan,
    see this link.
    Hope it helps.
    Mike

  • Automatcially Execute Report (with input parametrs) and Save to Excel/PDF

    I have an SSIS package that does this in SQL 2008 R2 by means of a Script Task that uses ReportExecution2005. I cannot get this to work in SQL2012. It the script builds without error but reports a compile error when I close the Script Task, with the dreaded
    red X in the Control Flow window.
    It has occurred to me that perhaps I can do the same thing using SSRS Web Service, supplying the necessary information in the URL. I know how to supply parameter values and tell it to render in Excel (or PDF) format but user action is still required to
    save the file. Is there a way to provide an output file name in the URL so that the file is automatically saved without even displaying the report?
    I an also looking at PowerShell/ReportExcution2005 as an option and will raised separate post on that subject.
    R Campbell

    Hi Dick Campbell,
    According to your description, you want to export report to Excel/PDF from the a web site and save it without displaying the report, if that is the case, we can use ReportExcution2005.asmx as the report rendering web service.
    SQL Server Reporting Services is essentially implemented as a set of Web services, commonly referred to as SOAP API. In order to use the endpoints from Visual Studio, please refer to the following steps:
    Add Web reference to the endpoints.
    Then we need to initialize the report by calling the LoadReport() method.
    If the report contains parameters, we need to declare and populate an array of ParameterValue objects. Once the parameters are set up, we can call the SetExecutionParameters() method and pass them in rsExec.SetExecutionParameters(executionParams, "en-us").
    Call the Render() method. This method renders the report and returns it as a byte array that we can save into a file.
    The following code is for your reference:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using WebApplication3.ReportExecution2005;
    using System.IO;
    namespace WebApplication3
    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    ReportExecutionService rsExec = new ReportExecutionService();
    rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;
    rsExec.Url = "http://servername/ReportServer/reportexecution2005.asmx";
    string historyID = null;
    string reportPath = "/multi-value parameter/sub";
    rsExec.LoadReport(reportPath, historyID);
    ReportExecution2005.ParameterValue[] executionParams;
    executionParams = new ReportExecution2005.ParameterValue[1];
    executionParams[0] = new ReportExecution2005.ParameterValue();
    executionParams[0].Name = "group";
    executionParams[0].Value = "Europe";
    new ReportExecution2005.ParameterValue();
    rsExec.SetExecutionParameters(executionParams, "en-us");
    string deviceInfo = null;
    string extension;
    string encoding;
    string mimeType;
    ReportExecution2005.Warning[] warnings = null;
    string[] streamIDs = null;
    string format = "Excel";
    Byte[] results = rsExec.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
    FileStream stream = File.OpenWrite("c:\\Users\\Reports\\report.xlsx");
    stream.Write(results, 0, results.Length);
    stream.Close();
    For more information, please refer to the following document:
    http://www.experts-exchange.com/Programming/Microsoft_Development/Q_27581973.html
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Adobe air with flex, file new, open and save for Desktop software program

    I already have a headache from all the searching. I cannot believe this to be such a confusing topic as every software program we create must be able to save user input, right.
    Here is the problem:
    Novel writing software program Main window has tabnavigator with four navigatorcontent pages 1. characters, 2. worlds, 3. objects, 4. Editor
    Each navigatorcontent page has user input fields in the form of textinput component, textarea component, richtexteditor component, etc.
    problem 1:
    The user needs to be able to open a new project and give it a name and state where it must be saved. All user input in the Novel writing software program must be attached to the file name the user specified - cannot give sample code cause I don't even know where to start looking anymore.
    Problem 2:
    If the user has now defined a new project name, all his input from the different input components has to be compiled into a single file that can be saved. (Dan Pichelman gave me a satisfactory answer on using the file.borwseforsave funtion.) That makes sense, but I first need to get all the user input into that single file. I was convinced that it must be an xml file and that there would be a guide on how to do this but...
    Problem 3:
    This brings me to another problem. All the pages I've researched so  far tell me how to load data from an xml file into a component, but not how to write the text from the component into the xml file. And this xml file cannot be the prefs file in the storage directory, it has to be named by the user and then after filling in all his text in the different tabs of the software, must be saved in this xml file and saved where the user chooses.
    Problem 4:
    now that the user put in his text and it is written to an xml file that he has named and set the path to, he goes on vacation and in two weeks opens his saved file to work on his project again. All the data that was stored in the xml must now be written back into the different user input components so he can continue working on his project, truth be told, there are some samles and tutorials on this subject, but again from only a single page perspective not a multiple tab perspective.
    Problem 5:
    Now the user has deleted and/or changed some text he put in when he started, he wrote some more text in the textareas and texteditor and he clicks the file - save button. The xml file or whatever needs to be used must be updated and saved with all the changes overwriting the old file.
    Problem 6:
    The data entered by the user will end up being a book of say 400 pages. This data will obviously be mostly in the richtexteditor component, so whatever method of saving is used, database or xml or whatever, needs to be able to contain all this data.
    Thought, if you are working with for instance, microsoft powerpoint, it has multiple pages all containing different user inputs and when you click flie - save, it saves all that input into one file. When I as a user opens that saved file it loads all that content back into its place and I can change and manipulate the input and save it again. I would have thought this would be one of the first things adobe or any other software would teach as this is what sofware programs are all about. But alas, the tutorials on this subject for adobe air for Desktop application is extreeeeemely rare.
    My promise is, if someone can help me with this or there is a tutorial out there that covers this properly I  will write a tutorial on this for other newbies as I progress step by step.  
    Pleeeeeeease help this ignorant novice
    Regards

    to save a file you would do something like:
    FileWriter fw = new FileWriter( fileName );
    textComponent.write( fw );
    fw.close();See the JFileChoose API for filtering files by extension. The API gives an example.

  • I want to transfer all my iPhoto, iTunes, contacts, etc. files from my MacBook, which I am selling to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine be transferred to the Pro?.

    I want to transfer all my iPhoto, iTunes, contacts,documents, etc. files from my MacBook, which I am selling, to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine from the MacBook be transferred to the Pro in some way? I would like to capture the files as they appear on the MacBook, such as "Events" in iPhoto and the various song categories within iTunes without having to rename them all once saved on the Pro, which is the case with photos when I simply save them to thumb drive and import them to the Pro. Sny advice would be appreciated.
    Best regards,
    Rob.

    Michael,
                 Thanks for all your assistance. There is no need for apologies, Migration Assistant did indeed create a second account for the MacBook data. It has just taken me some time to figure out how to access it. I now have all the MB data in one account and the MBP files in another, which suits me fine. In fact, it is an advantage in my case as it keeps the private and business aspects separated.
    I will however try the fatcatsoftware to transfer all the iPhoto files to my iMac, where I keep my main photo library. and it will be of help to keep the events, etc in the transfer. As far as iTunes is concerned, I have HomeSharing on all my computers and this has obviated the need to worry about playlists being transferred successfully. However, HomeSharing did not appear to share the iPhone/iPod apps that were stored on the MB and although these have now come across with the new MacBook account on the MBP, I was wondering whether my iPhone and iPod will be recognised by the MBP and sync with it? Will I need to have the MB account open to achieve this or will the MBP recognise and sync with the iPhone/iPod automatically irrespective of which account is open?
    Thanks for the tip on deauthorising my iTunes account from the MB before sellng. This I will do and I believe the best way to remove all of my data from the hard drive is to reinstall the MacOSX operating system software. Is this the right approach to securely delete everything?
    Thanks again for sharing your expertise and your guidance through this exercise.
    Best regards,
    Rob.

  • Enable the field in the list display and insert the new value and  save it.

    Hi
    In a report when I am in third list using ALV a field which is disabled should be enabled and  have to insert the new value in it and  save.
    please tell me how to do it using classes and methods and also using ALV's.
    Promise to reward points.
    Regards
    Mac

    Hi madan,
    Please find the code sample,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/79b5e890-0201-0010-7f8e-b7c207edf7c2
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ec31e990-0201-0010-f4b6-c02d876ce033
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/117beb90-0201-0010-67a8-fff1482209ae
    Regards
    Kathirvel

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • Export table rows to Excel and save to BLOB field

    Hi all,
    I try to find out how export data from table to Excel file format and save the result to BLOB field in some other table.
    I know how to download report from Page by submit, but I need to process data and instead of returning result to user as Excel file - save it in BLOB.
    Also I found implementation on JAVA for the issue but actually I wanna study out - Is it possible to resolve this issue by PL/SQL and APEX API methods?
    So, any ideas :) ??
    Thanks,

    It is not very difficult.
    Here is the function I use to get a CSV file from a query :
    PROCEDURE get_query_result_as_csv_file(
         in_query    IN VARCHAR2,
         in_filename IN VARCHAR2)
    IS
         l_blob BLOB;
         l_raw     RAW(32767);
         l_cursor INTEGER;
         l_cursor_status INTEGER;
         l_col_count      NUMBER;
         l_col_val VARCHAR2(32767);
         l_desc_tbl sys.dbms_sql.desc_tab2;
    BEGIN
         -- create temporary BLOB
         dbms_lob.createtemporary(l_blob, FALSE);
         -- open BLOB
         dbms_lob.open(l_blob, dbms_lob.lob_readwrite);
         -- open cursor (and get cursor id)
         l_cursor := dbms_sql.open_cursor;
         -- parse query
         dbms_sql.parse(l_cursor,  in_query, dbms_sql.native);
         -- get number of columns and description
         dbms_sql.describe_columns2(l_cursor, l_col_count, l_desc_tbl);
         -- define report columns
         FOR i IN 1 .. l_col_count LOOP
              dbms_sql.define_column(l_cursor, i, l_col_val, 32767);
         END LOOP;
         -- write column headings to CSV file
         FOR i IN 1 .. l_col_count LOOP
              l_col_val := l_desc_tbl(i).col_name;
              IF i = l_col_count THEN
                   l_col_val := '"' || l_col_val || '"' || chr(10);
              ELSE
                   l_col_val := '"' || l_col_val || '",';
              END IF;
              l_raw := utl_raw.cast_to_raw(l_col_val);
              dbms_lob.writeappend(l_blob, utl_raw.length(l_raw), l_raw);
         END LOOP;
         -- execute the query
         l_cursor_status := dbms_sql.execute(l_cursor);
         -- write result set to CSV file
         LOOP
              EXIT WHEN dbms_sql.fetch_rows(l_cursor) <= 0 OR dbms_sql.last_row_count > 1000;
              FOR i IN 1 .. l_col_count LOOP
                   dbms_sql.column_value(l_cursor, i, l_col_val);
                   IF i = l_col_count THEN
                        l_col_val := '"' || l_col_val || '"' || chr(10);
                   ELSE
                        l_col_val := '"' || l_col_val || '",';
                   END IF;
                   l_raw := utl_raw.cast_to_raw(l_col_val);
                   dbms_lob.writeappend(l_blob, utl_raw.length(l_raw), l_raw);
              END LOOP;
         END LOOP;
         -- close cursor and BLOB
         dbms_sql.close_cursor(l_cursor);
         dbms_lob.close(l_blob);
         -- set http headers
         owa_util.mime_header('application/octet', FALSE);
         htp.p('content-length: ' || dbms_lob.getlength(l_blob));
         htp.p('content-disposition: attachment;filename="' || in_filename || '.csv"');
         owa_util.http_header_close;
         -- download the file
         wpg_docload.download_file(l_blob);
    END;If you need to get the query dynamically from your report, you can try to get the source from the apex_application_page_regions table :
    SELECT region_source
    FROM apex_application_page_regions
    WHERE application_id = 111 -- replace with your application id
    AND static_id = 'static_id_of_your_report'Then instead of using wpg_docload.download_file, simply insert the BLOB into your table.
    Good luck.
    Yann.

  • Unable to Hide *Review and Save* step using personlization

    Hi,
    using personlization we want to hide  * Review and Save*  step in bank information iview under Personal Information.
    FYI...
    Step 1)  click on Content Administration
    Step 2) Expand Portal Content
    Step 3) Expand Content Provided by SAP
    Step 4) Expand End User Content
    Step 5) Expand Employee Self Service
    Step 6) Expand Roles
    Step 7) double click Employee Self service
    Step 8) Expand Personal Information
    Step 9) Select the Personal Information page and click on preview buttonStep
    Step 10) In the popup window click on Bank Information
    Step 11) select Review and Save and control right click to open the
    Personalization window
    step 12) In the Personalization window, select Review and save and
    select the radio button visible No and click on the Apply Button.
    Step 13) As a result the following error screen is displayed
    java.lang.IllegalArgumentException: Name portal_content/com.sap.pct/srvconfig/com.sap.pct.erp.srvconfig.ess.employee_self_service/com.sap.pct.erp.srvconfig.in/com.sap.pct.erp.srvconfig.bank/com.sap.pct.erp.srvconfig.fpmapplications/com.sap.pct.erp.srvconfig.per_bank_in/com.sap.xss.config.roadmapsteps/r3 is incorrect. It must only contain a..zA..Z0..9._-$ symbols.
        at com.sap.tc.webdynpro.repository.model.DelegatorRepositoryModelClass.checkCreate(DelegatorRepositoryModelClass.java:400)
        at com.sap.tc.webdynpro.repository.model.DelegatorRepositoryModelClass.createRelatedModelObject(DelegatorRepositoryModelClass.java:318)
        at com.sap.tc.webdynpro.progmodel.personalization.ViewPersonalization$Implementation.createInElements(ViewPersonalization.java:128)
        at com.sap.tc.webdynpro.progmodel.view.ViewElement._getPersonalization(ViewElement.java:318)
        at com.sap.tc.webdynpro.progmodel.view.PersonalizationHelper.setOverriddenProperty(PersonalizationHelper.java:942)
    Thanks,
    vijay.

    Hi Vijay,
    To edit the text you can follow the method or follow Note 1234273.
    And For making any changes to the roadmap you might want to look at modifying it from Self Service Administrator.
    Check the below links on more info on SSA.
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/3b6c0cfa6c1bcbe10000000a1553f7/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/bf/a74fecb9434fe7bd760c75db094366/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/6a/3e47d0a0dc4abaa58f93689a077334/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/07/acc80592b4451badb0f90ccd3bc55b/frameset.htm
    Hope this helps.
    Cheers-
    Pramod

Maybe you are looking for

  • Calling function in to procedure

    how can i call a function in a procedure? i m calculating average in function and i want to display that avg in dbms output of procedure.how can i do that?

  • Can't upload any music. Please help

    Tried the sync function of Blackberry software - no luck "no media card detected" "make sure MTP and Mass sstorage are enabled"  they are! Tried using USB and My Computer but the device doesn't show up. Help please!

  • Filtering Software Recommendations Needed

    Our CF e-commerce site currently has over 20k products. We're utilizing verity to allow customers to search as well as providing category-based navigation. Evenso with that many products, we're just not being effective at getting customers the produc

  • Ipad or mini?

    Thinking of Purchasing an Ipad not sure if i should go with the Mini?  Next question with or without cellular data?  I already have the Iphone 5

  • Error with invalid chars found in characteristics

    Hi,    I am loading information for this field EKPO-TXZ01 (PO text) into ODS and then into infocube. I have no issue loading this field content into ODS. However from ODS to infocube, I encountered error that says invalid chars found. (This field was