Retrieve and store the last page num. of a report created with the XML Publ

The customer has the need to store the last page number of a report created using XML Publisher technology.
This page number is to be recovered for reuse as a starting page number next to the launch of the report itself.
The last page number would be stored in a custom table. The value passed through the procedure defined in AfterReport pkg.
At the next launch of the report to retrieve the value of the last page of the previous launch BeforReport the procedure.
Can you not retrieve the value when the report is processed?
Now the customer has created a parameter in the report indicating the first page number to be included in the report itself.
The customer has to remember when launching the report on the last page number of the previous launch.
With Report Builder you can do it. But the new reports are made with R12 XML Publisher technology.
Is there anyone who can give us a solution?
thanks
Antonella

If you are new to BI Publisher then what I am going to suggest next may have not much sense.
But, anyways I am sharing this idea with the rest of the community for their benefit.
It is not impossible but requires some work. You will have to have total control of the document generation and process each step individually:
- Process before report generation
- Generate PDF
- Count PDF pages
- Process information of PDF pages
In order for you to do this you will have to use BI Publisher APIs.
xdocore.jar + Versioninfo.jar contain all you need. I just tested it myself.
Thanks
Jorge
p.s if you consider your question answered then please mark my answer either as "Correct" or "Helpful"

Similar Messages

  • Export data in CSV and store the file in local drive

    Hi,
    Here is the requirements.
    Fetch the values from table (around 60000 records), and export them into CSV file and store the file in local drive.
    I have written servlet to to this and it is working fine expect saving the file in local drive. At the moment, it is asking to save as in local drive. i want to save the file automatically in particular path (/var/www/files/). Below is the code.
    String file = "CandidatesDetails" + sd + ".csv";
                        queryString = "select * from candidate where candidate.status='A'";
                        connection = ConnectionPoolHelper.getConnection();
                        response.setContentType("application/csv");
                        response.setHeader("content-disposition", "filename=" + file);
                        System.out.println("Query= " + queryString);
                        ps = connection.prepareStatement(queryString,
                                  ResultSet.TYPE_SCROLL_INSENSITIVE,
                                  ResultSet.CONCUR_READ_ONLY);
                        rs = ps.executeQuery();
                        datas = "CANDIDATE ID,CANDIDATE TITLE,FIRST NAME,LAST NAME,E-MAIL,NATIONALITY ID,NATIONALITY,COUNTRY ID,COUNTRY NAME,INDUSTRY ID,INDUSTRY DESCRIPTION,EXPERIENCE,DATE OF BIRTH,HEAR ABOUT US\n";
                        oout.write(datas);
                        String country = "";
                        String nationality = "";
                        String hearABtUs = "";
                        while (rs.next()) {
                             nationality = rs.getString(7);
                             if (nationality == null)
                                  nationality = "";
                             else if (nationality.equals("null"))
                                  nationality = "";
                             country = rs.getString(9);
                             if (country == null)
                                  country = "";
                             else if (country.equals("null"))
                                  country = "";
                             hearABtUs = rs.getString(14);
                             if (hearABtUs == null)
                                  hearABtUs = "";
                             else if (hearABtUs.equals("null"))
                                  hearABtUs = "";
                             else
                                  hearABtUs = hearABtUs.replaceAll(",", ";");
                             datas = rs.getInt(1) + "," + rs.getString(2) + ","
                                       + rs.getString(3) + "," + rs.getString(4) + ","
                                       + rs.getString(5) + "," + rs.getInt(6) + ","
                                       + nationality + "," + rs.getInt(8) + "," + country
                                       + "," + rs.getInt(10) + "," + rs.getString(11)
                                       + "," + rs.getString(12) + "," + rs.getString(13)
                                       + "," + hearABtUs + "\n";
                             oout.write(datas); Regards,
    Dongan.

    Here is the first few lines
    public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              HttpSession session = request.getSession(true);
              String datas = "";
              PreparedStatement ps = null;
              ResultSet rs = null;
              String queryString = "";
              Connection connection;
              PrintWriter oout = response.getWriter();
              java.util.Date d = new java.util.Date();
              SimpleDateFormat dateformat = new SimpleDateFormat("dd-MMM-yyyy");
              String sd = dateformat.format(d);
              tryAt the moment, when i run http://localhost:8080/project/CandidatesDetail, it will ask me to save the file somewhere. I should manually mention the path to save the file. what i want is, it should automatically save it in the location C:\projects\files\.
    thanks.
    Regards,
    Dongan
    Edited by: Dongan on Oct 26, 2007 5:22 AM

  • Add terms and conditions on last page of PO using XSL-FO stylesheet

    Hi
    I need to add terms and conditions on last page of PO pdf. I have changed the values for profile options PO;Terms and Conditions Filename and PO: In file path to the file name and filepath of my terms and conditions txt file. Do I have to make any changes to the stylesheet for it to be printed on the last page? if so, what are the changes to be made?
    This is really urgent and I would appreciate any help.
    Thanks,
    Sharmila

    Hi,
    In main window &next-page&  eq 0. condition does not work . 
    even &page& eq &formpages& may not work out not sure.So what you need to do is.
    In the print program
    just describe your internal table say lines v_lines
    and in the loop put one count varaible say v_count
    then in the script put condition as below.
    if v_count eq v_lines.
    /:NEW-PAGE pagename  ( say last)
    endif.
    Reward points if useful.
    Regards,
    Nageswar

  • How to execute unix command through odi and store the result in table

    I have to reconcile  if data is loaded in table from csv file or not . I have to create a oracle data integrator package/interface/procedure to execute unix command to count number of rows in the csv files and store the count result in a table then i have to query the loaded table and count number of rows there and store in the table and have to compare is counts are same or not,  Please assist me how to make package/interface/procedure to  execute unix command and store result in oracle table.
    Thanks in Advance

    Use ODI OS command tool in the ODI package.
    create an interface in ODI using LKM File to Sql and the output file generated with the csv file's row count as a source and the db table(where the count needs to be stored) as a target

  • Script for gather and store the log running queries details in a table?

    Hi All,
    Please suggest the best query that gather and store the long running queries details in a table.
    Thanks,
    rup

    The below links would help you...
    Ben Snaidero
    performance-dashboard

  • HT1688 I deleted a text message by mistake.  How do I retrieve and restore the text message to the incoming message?

    I deleted a text message by mistake.  How do I retrieve and restore the messages?

    If you backed up after getting the message and before deleting it you can restore your phone and the message will be back. If not then it is gone forever.

  • How to select and store the dynamically clicked values in the checkboxes?

    Hi Gurus
    How to select and store the dynamically clicked values in the checkboxes?
    Scenario:-
    I am having a tree structure but I am not getting that user has clicked the which nodes.
    So how to do it.
    Pls.

    Hi,
    Once again, this is dependent on what your implementation expects. It would seem that your implementation is expecting all of the API to be coded in Java Card so it would make sense that you would load these packages like any other package. Loading an applet is not a special case, it just has an extra step of installing instances of it (and can actually be installed). Any other Java package just needs to be loaded. As such, just load your CAP files for each package of the API before loading any code that depends on it.
    Cheers,
    Shane

  • Import and flow the xml text in a indesign document

    pls,anyone give me a solution for import and flow the xml text in a document.
    thanks,
    screen410099

    See http://forums.adobe.com/thread/838745?tstart=0
    Would you mind waiting a bit before asking again and again and again and then again? It's possible the person who can answer you question just didn't happen to read the forums this week.

  • Not able to retrieve and insert the value to Home_country filed in MDM

    Hi All,
    I am new to the JAVA API,
    I have creted one application in webdynpro using the JAVA API. I am able to search the data based on "Firstname" "Lastname" and "Email address".
    I need to basically two functionalities
    1) Search
    2) Insertion of new records
    *1) Search*__
    But searching based on the Country is not able to do it.
    we have two tables .
    1) Country table> Contains all the list of the country codes and County name.
    2) People table > Contains the country filed. So for this filed lookup table is country. also this country filed is drop down  not have opton edit in the MDM.
    I am sending the following used for searching the records based on the First Name and country.
    But based on the first name it is working fine but Country it is giving some code like "R100" "R12". It is not givng the actual name of the country.
    FieldSearchDimension sd1 = new FieldSearchDimension(fields[2].getId());
                   TextSearchConstraint sc1 = new TextSearchConstraint(First_Name,TextSearchConstraint.EQUALS);
                   sch.addSearchItem(sd1,sc1);          
    FieldSearchDimension sd4 = new FieldSearchDimension(fields[9].getId());
                   TextSearchConstraint sc4 = new TextSearchConstraint(Home_Country,TextSearchConstraint.EQUALS);
    //               TextSearchConstraint sc4 = new TextSearchConstraint("IN",TextSearchConstraint.EQUALS);
                   sch.addSearchItem(sd4,sc4);
    cmd = new RetrieveLimitedRecordsCommand(connections);
                   cmd.setResultDefinition(rdPeople);
                   cmd.setSearch(sch);
                   cmd.setSession(sessionId);
    try
                        cmd.execute();
                        catch(CommandException e)
                             e.printStackTrace();
                        recs = cmd.getRecords();
                        wdContext.nodeResult_Table().invalidate();
    //retreiving the Data from the resultset
    if(recs.getCount()!=0)
      for(int i=0;i<recs.getCount();i++)
           //First Name
         IResult_TableElement resEle=wdContext.nodeResult_Table().createResult_TableElement();
         if(!(recs.getRecord(i).getFieldValue(fields[0].getId()).isNull()))
         //wdComponentAPI.getMessageManager().reportSuccess("Network Id-->"+recs.getRecord(i).getFieldValue(fields[0].getId()).toString());
         resEle.setNetwork_ID(recs.getRecord(i).getFieldValue(fields[0].getId()).toString());
           //Country
          if(!(recs.getRecord(i).getFieldValue(fields[9].getId()).isNull()))
         resEle.setDisplay_Name(recs.getRecord(i).getFieldValue(fields[9].getId()).toString());
         wdContext.nodeResult_Table().addElement(i,resEle);
    By the above field is not giving the respective country name is avilable. it is giving some value"R100" rather giving of India.
    _ 2)  For creating the record in the  "people" table._
    I am able to insert the data all the information "firstname" "Last name", "email" except "Country" entered by the user by using the following code.
    //Insert
    First_Name=wdContext.currentPersonal_DetailsElement().getAttributeAsText("First_Name");
         Last_Name=wdContext.currentPersonal_DetailsElement().getAttributeAsText("Last_Name");
         Middle_Name_or_Initial=wdContext.currentPersonal_DetailsElement().getAttributeAsText("Middle_Name_or_Initial");
         Home_Country=wdContext.currentPersonal_DetailsElement().getAttributeAsText("Home_Country");
    CreateRecordCommand createRecordCommand =new CreateRecordCommand(connections);
         Record r1 = RecordFactory.createEmptyRecord(tables[0].getId());     
         try
    //               Retrieve Lookup Field Properties, when Field Properties is given as input.
    //           LookupFieldProperties lookupField = (LookupFieldProperties) fields[9];          
    ////     Retrieve Lookup Field Properties, when Field Properties is given as input.
    //           LookupFieldProperties lookupFieldSer = (LookupFieldProperties) fieldProp;
    //          //setting the values for firstname and lastname
            r1.setFieldValue(fields[0].getId(),new StringValue(Network_ID));
            r1.setFieldValue(fields[2].getId(),new StringValue(First_Name));
            r1.setFieldValue(fields[3].getId(),new StringValue(Last_Name));
    r1.serFieldValue(FieldValue(fields[9].getId(), new Stringvalue(Home_country));
            createRecordCommand.setSession(sessionId);
            createRecordCommand.setRecord(r1);
         try {
              createRecordCommand.execute();
          } catch (CommandException e2) {
    Let me know what are the changes need to be done for inserting the country information in people table.

    Hi Greg,
    Thanks for the reply,
    Actually,I  was doing the same thing what  you suggested. I am sending the piece of code . Can look it it .Is any thing wrong.
              //inserting the Country lookup filed to record object.
    *       if(Home_Country.length()!=0)*
    *     /when pass the int position number for the country by retreiving from the country table it is working fine. But we      cannot depend on position. Because People table internally refering the other db table while inserting the country      filed in the People table./     *
    *          r1.setFieldValue(fields[9].getId(),new LookupValue(new RecordId(12)));*
    *     //When i PAss the String to the following function i am getting the unsupportedFormat Exception          *
    *          r1.setFieldValue(fields[9].getId(),new LookupValue(new RecordId("Australia")));*
    InCountry . They have defined only two columns called.
    1) ISO-2 Code
    2) Country Name.
    Sample data
    ISO-2 Code  |   Country Name
    US                    United StatesOf America
    AU                    Australia
    Ar                     Argentina
    Like the above data we have 250 country names
    So , I displaying all the country list in my interface and holding in the Array.
    Ex: When the user chooses the Australia.  When I pass directly as an "Australia" to
    r1.setFieldValue(fields[9].getId(),new LookupValue(new RecordId("Australia"))).  it is giving me error.
    Then i try to pass the postion of the"Australia" in country table. Like if the Austrila is an 2 record. I am looping through my array and find the record position as "2".
    I am passing as
    r1.setFieldValue(fields[9].getId(),new LookupValue(new RecordId(2)));
    It is inserting into the people database. But not an Australia. It is inserting as "Argentina".
    When the record inserting in people table refering some table at the database level , that table called "A2i_16_TEXT" This contains three columns.
    A2i_16_TEXT(columns)
    1) Id
    2) LangId
    2) Field Id
    4) TextField
    Example Data
    Id  |  LangId  |  Textfield
    3       0            Australia
    2       0            Argentina
    4       0            United States Of America
    As i am showing the above table for "Argentina" Id is "2". When i pass the 2 for inserting the country filed.Instead of inserting "Australia". It is inserting the "Argentina" by refering this table.
    Through MDM API we are not able to access this " A2i_16_TEXT"  table. Because it is maintaining at the db level to find the perticular id for the respective country before inserting in to the people table.
    So kindly suggest me how to solve this problem. What i am doing in the code is correct or not.
    Regards
    Vijay

  • Combo box in JavaScript and store the combo box values into database

    i am a developer, i have a task ie.. i have combo box in JavaScript and i have to store the combo box values into database through JavaServerPage..
    i please every one to have a look on this and please reply soon....

    dear sir,
    your suggestions are really greater the god.............
    i have applied as you said , now i am the page as updated and also i nform you that its multi select ....
    i will show the codings , then u will get a clear identification
    <script language= "JavaScript">
    <!--
    function one2two() {
        m1len = m1.length ;
        for ( i=0; i<m1len ; i++){
            if (m1.options.selected == true ) {
    m2len = m2.length;
    m2.options[m2len]= new Option(m1.options[i].text);
    for ( i = (m1len -1); i>=0; i--){
    if (m1.options[i].selected == true ) {
    m1.options[i] = null;
    function two2one() {
    m2len = m2.length ;
    for ( i=0; i<m2len ; i++){
    if (m2.options[i].selected == true ) {
    m1len = m1.length;
    m1.options[m1len]= new Option(m2.options[i].text);
    for ( i=(m2len-1); i>=0; i--) {
    if (m2.options[i].selected == true ) {
    m2.options[i] = null;
    //-->
    </script>
    <form method="POST" name="theForm" action="update.jsp">
    <table bgcolor="white" border="1" cellpadding="5" cellspacing="2" align="center">
    <tr><td align="center">
    <select id=menu1 size=10 multiple>
    <option>javascript</option>
    <option>php</option>
    <option>Zeo</option>
    <option>asp</option>
    <option>jsp</option>
    <option>ajax</option>
    <option>struts</option>
    </select>
    <p align="center"><input type="button" onClick="one2two()" value=" >> "></p>
    </td><td align="center">
    Languages you know:<BR>
    <SELECT NAME="language" multiple>
    <OPTION VALUE="c">C
    <OPTION VALUE="c++">C++
    </SELECT>
    <p align="center"><input type="button" onClick="two2one()" value=" << " ></p>
    </td></tr></table>
    <center><input type="submit" value="update"></center>
    </form>
    <h4><u>Back<h4>
    <script language= "JavaScript">
    var m1 = document.theForm.menu1;
    var m2 = document.theForm.language;
    </script>
    </body>
    </html>

  • Printing Terms and Conditions on last page of invoice

    Hi All,
    I am generating receivables invoices in PDF format from Oracle EBS R12i using BIP 5.6.3.
    I have a requirement to print T&Cs separately on the last page of each invoice so that:
    1. Regular invoice header and footer information do print on T&Cs page
    2. Page count on invoice should not T&C page. Example, if there are 3 pages in an invoice where first 2 are for transaction details and third for T&C then page count should display only as page 1 and 2 as "Page 1 of 2" and Page "2 of 2" (not as "Page 1 of 3", "Page 2 of 3" and "Page 3 of 3")
    Also I seen following thread on this forum but unfortunately its inconclusive:
    Printing Terms & Conditions page for Purchase Orders
    I would appreciate if you someone can throw in bright ideas about how this can be achieved.
    br

    I also have similar issue printing POs. I have followed the steps of Tim - http://blogs.oracle.com/xmlpublisher/2007/10/here_are_my_terms_conditions.html but the T&C page is being counted in the page total.
    Any idea to fix this issue? Thanks in advance.

  • Double click and get and store the value in variable.

    Hi,
    My intention is when i double click a particular record on a tabular, i want to capture or store the particular value of record into a variable and call that variable in print/preview button PLSQL code.
    Below i show the screenshot which contain a tabular and print preview button. After populating the data. the user will double click on the agent code LC354 and click the print/preview button it should display report for only the
    agent code of LC354(this is what i want). But normally when i click the print preview button it wil show the report of agent code of LC354 and LC325(this what i dont want).
    http://imageshack.us/photo/my-images/811/printpb.png/
    My problem is how to capture the value((*LC354*)) of particular record after double click the agent code(*LC354*)?
    i tried to store agent code in variable AG_CNT in mouse double click trigger with following plsql code. but it dosent work.
    declare
    AG_CNT varchar2(10);
    begin
    *AG_CNT* :=GET_ITEM_PROPERTY('RFQ_AGENT_DETAILS.AGENT_CODE',CURRENT_RECORD);
    end;after that pass that AG_CNT value in *:AG_CODE*. below code is in print/preview button.
         cursor c1 is select nvl(count(ENQUIRY_NO),0) from scott.EXP_QUOTE_STATUS
         where ltrim(rtrim(upper(job_status))) like 'APPROVED%' and ENQUIRY_NO = :REQ_FOR_QUOT.ENQUIRY_NO
    AND AGENT_CODE=*:AG_CODE* ;how to do this?
    skud.

    Hi skud
    i juast want to store the agent code to variable.if i did get ur point...
    Why don't u just use a simple assign statment for example...
    DECLARE
    V_VALUE  NUMBER;
    BEGIN
    V_VALUE := LC354 ; -- IF it was a value as LC354 static i mean
    -- or u could use any value
    V_VALUE := :ur_form_item_name; --- if it was dynamic
    END;That's it .
    Hope this helps...
    Regards,
    Ammatu Allah.

  • HT5622 looking to take off my photo's off my phone and store them on my computer, how does this work with the new update on a iphone 3g

    trying to take photos off my 3G since the upgrade,,,   I am not seeing the popup to take photo's off and store them on my computer

    thanks folks,  I quessed i could do it this way.. Usually the window pops up to transfer the pictures...
    THANKS FOR ALL OF YOUR HELP!!!!!!!!!!!!!!!!!

  • How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?

    I want to do the below task using powershell script only.
    I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
    This image is csv file only. 
    Could you please any one help me.
    Thanks in advance.
    By
    A Path finder 
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Not certain this is what you're after, but this :
    #import the contents of both csv files
    $dbexcel=import-csv c:\dbexcel.csv
    $liveexcel=import-csv C:\liveexcel.csv
    #prepare the output csv and create the headers
    $outputexcel="c:\outputexcel.csv"
    $outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
    $outputline | out-file $outputexcel
    #Loop through each record based on the number of records (assuming equal number in both files)
    for ($i=0; $i -le $dbexcel.Length-1;$i++)
    # Assign the yes / null values to equal the word equivalent
    if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
    if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
    #create the live of csv content from the two input csv files
    $outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
    #output that line to the csv file
    $outputline | out-file $outputexcel -Append
    should do what you're looking for, or give you enough to edit it to your exact need.
    I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers).

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* 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);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // 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();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.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);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    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");
    /* MAIN METHOD */
    /* 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);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

Maybe you are looking for

  • Logic doesn't save MX4's plug-in settings :-(

    Anyone working with the MOTU MX4 software instrument? I had an amazing session going today, and when I saved and closed the project, Logic didn't save any of the plug-in's preset information. Each instance of the plug came up in the default patch. DO

  • No sound from Quicktime Pro

    I've developed an issue whereby I cannot get any sound at all from my QT player, just video. I followed the instructions via this link http://support.apple.com/kb/HT2178 but everything was as it should be, but there was a message under audio output w

  • No updates on iPhoto and iMovie, says they were purchased on another account; I only have the one.

    I just received my new MacBook Pro 13, and while updating software and installing Office and Acrobat, found that I could not update iMove or iPhoto, because they were purchased under a different account.  I've only ever had one apple ID, and iMovie a

  • Payment Wizard - Payment Run Selection

    Hi, I have a question regarding data shown on the Payment Wizard in the Payment Run Selection window. Does anyone know what the TOTAL column in this window is made up of?  The reason is that this column does not match the OUTGOING figure in the Recom

  • IPod Touch Playlist Question

    I know that the Touch (2g) can create Genius playlists, but I was curious if I could make my own playlists (I'm really new to the whole mp3/mp4/etc. player world) on it. Since I am a runner, I'd like to be able choose a handful of songs, put them on