Editing a for loop to print correctly

I have the following code
public void printReceipts(){
          JOptionPane frame = new JOptionPane();
          for(int i = 0; i < borrowersList.size();i++){
               for(int j = 0; j < books.size();j++){
                    if(borrowersList.get(i).getLibraryNumber().equals(books.get(j).getLibraryCardNumber())){
                         milliLate = (tempDate.getTime() - books.get(j).getReturnDate().getTime());
                         daysLate = (milliLate/ 86400000);
                         bookDebt = (daysLate * 2);
                         borrowersList.get(i).setDebt(bookDebt);
                         JOptionPane.showMessageDialog(frame, borrowersList.get(i).getName() + "\n"
                                   + borrowersList.get(i).getStreetAddress() + "\n"
                                   + borrowersList.get(i).getPostalCode() + " "
                                   + borrowersList.get(i).getCity() + " \n"
                                   + "\n" + "As of today " + tempDate + " you owe \"The little library \"" +borrowersList.get(i).getDebt() + " kr for the books."  + "\n"
                                   + "\n" + books.get(j).getAuthor() + " " + books.get(j).getTitle() + ", amount due "+ bookDebt +
          }which prints borrowers that owe the library money.
The problem is that if a borrower has 2 books, it will print the loop each time with the different book.
i.e
Wile E. Coyote
The Second Valley from the Left
987 65 The Desert
As of today 2007 09 20 you owe "The little library" 300 kr for the books
James Joyces Ulysses, amount due 96:-
Wile E. Coyote
The Second Valley from the Left
987 65 The Desert
As of today 2007 09 20 you owe "The little library" 230 kr for the books
Fyodor Dostoyevsky Crime and Punishment, amount due 134:-
I would like it to print out only once for each borrower
i.e.
Wile E. Coyote
The Second Valley from the Left
987 65 The Desert
As of today 2007 09 20 you owe "The little library" 300 kr for the books
James Joyces Ulysses, amount due 96:- (book line)
Fyodor Dostoyevsky Crime and Punishment, amount due 134:-
Aldous Huxley Brave New World, amount due 70:-
So I need to store all the book lines of each borrower and then call them once all the borrowed books debts have been assigned.

Implode wrote:
CeciNEstPasUnProgrammeur wrote:
You could have a method that takes the list of books (or even the borrower) and provides you with a String containting all you want to print... then you'd call this method only once and print out what you want.I thought of this, but I would need each book line to be on a separate line?
public void setPrintDetails(String row){
          this.row = row + this.row
Use a StringBuilder/StringBuffer:
private StringBuilder details;
public void setPrintDetails(String row) {
   details.append(row).append("\n");
}You could also use the line.separator property instead.

Similar Messages

  • For Loop not acting correctly...

    Hi everyone,
    I have this For Loop in JavaScript which is not working correctly and I really have no idea why it is acting like so... I don't if anyone has already encountered this issue and I'd like to know if there's a fix for this or what am I doing wrong...
    I have a normal for until the count is done like this -> for (var c = 0; c < frmResourceReq.instanceManager.count; c++){}
    If I put this loop with only a messageBox it will do it right, so if the count is 1, it will do it once, if the count is 2 it will do it twice...
    The loop with the actual code is not acting like so.. if the count is 1, it will do it once, but if the count is 2 it will do it once also...
    At 1 point it was acting weird so I decided to make the condition with  'c <= frmResourceReq.instanceManager.count'
    Now if the count is 1, it is not working because it crashes once it execute it the second time, but if I have a count of 2 or 3 it will execute the right number of times...
    Does anyone have any idea what is creating this issue, seems like I really can't figure it out.
    Thanks for your time.

    Hi,
    to avoid that the loops condition is unnecessarily calculated again for every iteration it's recommended to save the condition in a variable first.
    for (var c = 0, n = _frmResourceReq.count; c < n; c += 1) {
        //code to execute
    As the instance count of iteration frmResourceReq may change already while the loop runs it can end with unexpected results.

  • How to use for loops with Multiple Initializers and Incrementers

    I found that my for loop is printing out wrong, because I am using two for loops. I have searched but all I can find out is you can't use multiple inializers and increments, does anyone know how to get around this? How would I use an array for this?
    Thanks very much for your help.
    import java.util.Random;
    import java.util.Arrays;
    /** Generate numnodes value for random integers in the range 0..499. */
    public final class RandomInteger {
    public static final void main(String... aArgs){
    log("Generating 6 random integers in range 0..499.");
    int numnodes = 6;
    //Randomly generate a number between 0 and 499 for the x and y coordinates for the nodes
    Random randomGenerator = new Random();
    for (int x = 0; x < numnodes; ++x) {
    int randomInt = randomGenerator.nextInt(500);
    Random randomGenerator2 = new Random();
    for (int y = 0;y < numnodes; ++y) {
    int randomInt2 = randomGenerator2.nextInt(500);
    log("Generated : " + randomInt + " " + randomInt2);
    log("Done.");
    }

    Sorry that code works, but I want to use both my x and y coordinates to get a random number from 0 to 499 in both of them, then I want to do some comparisons of the values, then return it to another function. As it stands now, I get the wrong results when I run it, as you can see at the bottom.
    Thanks very much for your help. I have been stumped all mornign on this and have looked everywhere trying to find an example. I don't won't to use math random. I am on a tight deadline to finish and at the rate I am going, I will not complete it.
    /** Generate numnodes value for random integers in
    the range 0..499. */
    public final class RandomInteger {
    public static final void main(String... aArgs){
    log("Generating 6 random integers in range
    0..499.");
    int numnodes = 6;
    //Randomly generate a number between 0 and 499 for
    the x and y coordinates for the nodes
    Random randomGenerator = new Random();
    for (int x = 0; x < numnodes; ++x) {
    int randomInt = randomGenerator.nextInt(500);
    Random randomGenerator2 = new Random();
    for (int y = 0;y < numnodes; ++y) {
    int randomInt2 = randomGenerator2.nextInt(500);
    log("Generated : " + randomInt + " " + randomInt2);
    log("Done.");
    private static void log(String aMessage){
    System.out.println(aMessage);
    Output:
    --------------------Configuration:
    <Default>--------------------
    Generating 6 random integers in range 0..499.
    Generated : 98 254
    Generated : 98 347
    Generated : 98 359
    Generated : 98 25
    Generated : 98 277
    Generated : 98 148
    Generated : 416 401
    Generated : 416 165
    Generated : 416 354
    Generated : 416 169
    Generated : 416 144
    Generated : 416 354
    Generated : 295 158
    Generated : 295 138
    Generated : 295 349
    Generated : 295 324
    Generated : 295 18
    Generated : 295 193
    Generated : 197 451
    Generated : 197 416
    Generated : 197 480
    Generated : 197 33
    Generated : 197 490
    Generated : 197 494
    Generated : 324 412
    Generated : 324 490
    Generated : 324 213
    Generated : 324 386
    Generated : 324 467
    Generated : 324 163
    Generated : 379 180
    Generated : 379 446
    Generated : 379 314
    Generated : 379 52
    Generated : 379 113
    Generated : 379 271
    Done.
    Process completed.

  • Reading a csv file within a for loop

    Hi guys,
    Im trying to read a csv file within a for loop and the while loop only seems to be getting executed once rather than the number of times that is specified.
    for(int i=0; i<paramValues.length;i++)
    String StudentNo = paramValues4;
    out.println("StudentNo="+StudentNo);
    BufferedReader in = new BufferedReader( new InputStreamReader( conn2.getInputStream()));
    String readLine;     // stores a line from the file as a string//used to get rid of the first line which has course name
                                                      readLine = in.readLine();
                                                                     int NumberOfElementsInArray=16;
                                                           String[] data;
                                                                     data = new String[NumberOfElementsInArray];
                                                                     data[0]=> StudentNo
                                                                     data[1]=> Surname
                                                                     data[2]=> Firstname
                                                                     data[3]=> ExamNo
                                                                     data[4]=> YrOfStdy
                                                                     data[5]=> ProgOfStdy
                                                                     data[6]=> Fld1
                                                                     data[7]=> Fld2
                                                                     data[8]=> DegType
                                                                     data[9]=> EnrolStatus
                                                                     data[10]=> StaffAdvNo
                                                                     data[11]=> Tutor
                                                                     data[12]=> Fld3
                                                                     data[13]=> Fld4
                                                                     data[14]=> Fld5
                                                                     data[15]=> Pegged
                                                                     data[16]                                                            
                                                                     //out.println("<table border=\"1\">");
                                                                     int datanumber=0;
                                                                     while( (readLine = in.readLine()) != null )     
                                                                          out.println("ive entered the loop");                                                       
                                                                          StringTokenizer tokens = new StringTokenizer( readLine, ",", true);                    
                                                                          boolean prevTokenComma = true;
                                                                          boolean emptyValue = false;
                                                                          String aValue = null;
                                                                          datanumber=0;                                                                      
                                                                          while( tokens.hasMoreTokens() )          
                                                                               aValue = null;
                                                                               String token = tokens.nextToken();
                                                                               token=token.trim();
                                                                               //if the token does not equal to a comma
                                                                               if( !token.equals(",") )               
                                                                                    aValue = token;                    
                                                                                    prevTokenComma = false;                    
                                                                                    emptyValue = false;     
                                                                               else if( token.equals(",") && prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = true;               
                                                                               else //( token.equals(",") && !prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = false;
                                                                               if(emptyValue)
                                                                                    aValue = "";
                                                                               // Printing values
                                                                               if( aValue == null)
                                                                                    //do nothing
                                                                               else if (aValue.equals("") )
                                                                                    aValue="&nbsp";
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("datanumber="+datanumber);
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    datanumber++;
                                                                               else
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    //out.println(datanumber);
                                                                                    datanumber++;                                                                                
                                                                          out.println("data[0]="+data[0]);
                                                                          //out.println("data[3]="+data[3]);
                                                                          //out.println("ExamNo="+ExamNo);
                                                                     }//end while
                                                                     in.close();
    }//end for loop
    When I print the variable student no at the beginning of the for loop it prints the different studentno's so the for loop is fine, but the while loop gets executed once. Does anyone know why????????/
    Thanks
    Tzaf

    PROBLEM SOLVED....
    Basically the following declarations have been done within the for loop....
    URL url2 = new URL ("http://localhost:8080/FYP/CSVFILES"+Year+"/"+WebCourse2+".csv");
                                                                     URLConnection conn2 = url2.openConnection();
                                                                     HttpURLConnection uc = (HttpURLConnection)conn2;
                                                                     uc.connect();
                                                                     try
                                                                          responseCode = uc.getResponseCode();
                                                                          out.println("Response code1: " + responseCode+"\n");
                                                                     catch(IOException e)
                                                                          responseCode = uc.getResponseCode();
                                                                          //out.println("Response code2: " + responseCode+"\n");
    thanks
    anyway
    tzaf

  • Breaking a single query using for loop to improve performance

    Hi,
    This is a continuation of my previous post which I marked Answered and few things are were left from my side and I was advised to post a new thread...
    [Will it be a good ply|http://forums.oracle.com/forums/thread.jspa?threadID=880922&tstart=0]
    will it be applicable to any query because I took this to simplify the thing to explain my case
    which is actually........... pull the data from some tables using joins and insert into some other tables .....
    I used few procedures for diff conditions one of them use plain' insert into select' and others use bulk collect technique.
    I followed the simple strategy (for DML ) by Tom Kytes ..and Steven Feuerstein
    Use single statement whenever it is possible..
    if not use PL/SQL with bulk collect to avoid for loop.
    Please correct me if I am wrong.
    Thanks and Regards,
    Hesh.

    A simple test can prove the case
    SQL> set serveroutput on
    SQL>
    SQL> create table t
      2  as
      3  select * from all_objects where 1=2
      4  /
    Table created.
    SQL> declare
      2    ltime integer;
      3  begin
      4      ltime := dbms_utility.get_time;
      5      insert into t select * from all_objects;
      6      ltime := dbms_utility.get_time - ltime;
      7
      8      dbms_output.put_line(ltime);
      9  end;
    10  /
    187
    PL/SQL procedure successfully completed.
    SQL> rollback
      2  /
    Rollback complete.
    SQL> declare
      2      ltime integer;
      3      type tbl is table of t%rowtype index by pls_integer;
      4      l_tbl tbl;
      5      cursor c
      6      is
      7      select * from all_objects;
      8  begin
      9      ltime := dbms_utility.get_time;
    10      open c;
    11      loop
    12          fetch c bulk collect into l_tbl limit 500;
    13          exit when c%notfound;
    14
    15          forall i in 1..l_tbl.count
    16            insert into t values l_tbl(i);
    17      end loop;
    18
    19      ltime := dbms_utility.get_time - ltime;
    20
    21      dbms_output.put_line(ltime);
    22  end;
    23  /
    390
    PL/SQL procedure successfully completed.
    SQL> rollback
      2  /
    Rollback complete.

  • Help with printing a tic tac toe board (using a loop to print)

    hey im making the smiple game tic tac toe and im tryin to print out the board after each turn. I have a 2d array called char which is a 3 by 3 array and i dont know how i would make a for loop to print out the x's and o's in their right spot and still have the board look like a normal tic tac toe board. When the board is printing the x's and o's are already in the 2d char array board.So basically what i want to happen is after player 1's turn is up wherever he put the x replace the number on the board with an x and keep the rest the same and whenever player 2's turn is up wherever he put the o replace the number on the board with an o and keep the rest the same. Any help would be awesome thanks alot.
    Here is the code to the program (i know i use if statements to much its a bad habit of mine)
    import java.util.*;
    public class Tictactoe
        private char board [] [] = new board [3] [3];
        private int X;
        private int O;
        private Scanner p1choice;
        private Scanner p2choice;
        Scanner input = new Scanner(System.in);
        public Tictactoe()
            p1choice = new Scanner(System.in);
            p2choice = new Scanner(System.in);
            play();
        public void play()
            printoriginalboard();
        public void printoriginalboard()
            System.out.println("    |    |    ");  
            System.out.println("  3 |  2 |  1 ");
            System.out.println("____|____|____");
            System.out.println("    |    |    ");
            System.out.println("  6 |  5 |  4 ");
            System.out.println("    |    |    ");
            System.out.println("____|____|____");
            System.out.println("    |    |    ");
            System.out.println("  9 |  8 |  7 ");
            System.out.println("    |    |    ");
            System.out.println("This is the classic game of tictactoe simply pick a number 1 through 9 to place an x or an o in that area.");
            player1turn();
        public void player1turn()
            System.out.println("Player 1 pick an area to place an X");
            int p1choice= p1choice.nextInt();
            if(p1choice == 1 && p2choice == 1 || p1choice == 1){
                System.out.println("This spot has already been taken");
                else
                board[0][2] = 'x';
            pintboard();
            if(p1choice == 2 && p2choice == 2 || p1choice == 2){
            System.out.println("This spot has already been taken");
            else
                board[1][2] = 'x';
            pintboard();
            if(p1choice == 3 && p2choice == 3 || p1choice == 3){
            System.out.println("This spot has already been taken");
            else
                board[2][2] = 'x';
            pintboard();
            if(p1choice == 4 && p2choice == 4 || p1choice == 4){
            System.out.println("This spot has already been taken");
                board[0][1] = 'x';
            pintboard();
            if(p1choice == 5 && p2choice == 5 || p1choice == 5){
            System.out.println("This spot has already been taken");
            else
                board[1][1] = 'x';
            pintboard();
            if(p1choice == 6 && p2choice == 6 || p1choice == 6){
            System.out.println("This spot has already been taken");
            else
                board[2][1] = 'x';
            pintboard();
            if(p1choice == 7 && p2choice == 7 || p1choice == 7){
            System.out.println("This spot has already been taken");
            else
                board[0][0] = 'x';
            pintboard();
            if(p1choice ==8 && p2choice == 8 || p1choice == 8){
            System.out.println("This spot has already been taken");
            else
                board[1][0] = 'x';
            pintboard();
            if(p1choice == 9 && p2choice == 9 || p1choice == 9){
            System.out.println("This spot has already been taken");
            else
                board[2][0] = 'x';
            pintboard();
        public void p2turn()
            System.out.println("Pick an area to place an O");
            int p2choice = p2choice.nextInt();
            if(p2choice == 1 && p1choice == 1 || p2choice == 1){
            System.out.println("This spot has already been taken");
            else
                board[0][2] = 'o';
            pintboard();
            if(p2choice == 2 && p1choice == 2 || p2choice == 2){
            System.out.println("This spot has already been taken");
            else
                board[1][2] = 'o';
            pintboard();
            if(p2choice == 3 && p1choice == 3 || p2choice == 3){
            System.out.println("This spot has already been taken");
            else
                board[2][2] = 'o';
            pintboard();
            if(p2choice == 4 && p1choice == 4 || p2choice == 4){
            System.out.println("This spot has already been taken");
            else
                board[0][1] = 'o';
            pintboard();
            if(p2choice == 5 && p1choice == 5 || p2choice == 5){
            System.out.println("This spot has already been taken");
            else
                board[1][1] = 'o';
            pintboard();
            if(p2choice == 6 && p1choice == 6 || p2choice == 6){
            System.out.println("This spot has already been taken");
            else
                board[2][1] = 'o';
            pintboard();
            if(p2choice == 7 && p1choice == 7 || p2choice == 7){
            System.out.println("This spot has already been taken");
            else
                board[0][0] = 'o';
            pintboard();
            if(p2choice == 8 && p1choice == 8 || p2choice == 8){
            System.out.println("This spot has already been taken");
            else
                board[1][0] = 'o';
            pintboard();
            if(p2choice == 9 && p1choice == 9 || p2choice == 9){
            System.out.println("This spot has already been taken");
            else
                board[2][0] = 'o';
            pintboard();
        public void pintboard()
        {

    Anyway the answer is that you are trying to create an array of char as there is no such thing as a board[3][3].
    One of the best tools a programmer can do is learn how to break a big problem into little problems and work on each little problem in isolation, and then when finished combining the solutions together into the final program. You big mistake that I see here is trying to bite off more than you can chew: trying to create a whole functioning interactive program from just one class. Why give yourself a task that would be difficult even for an experienced java programmer? I suggest that you break this down into logical parts and try to solve the smaller problems before worrying about the whole. For instance, if I were doing something like this, I'd create a class called TTTBoard that encapsulated the tic tac toe board and nothing but the board. I'd think of it as an entity. When I wanted the current state of the board, I'd query the board via a method such as getCurrentState. I'd have methods for checking if position is free, for placing an x/o in a spot, for checking for win, etc... Then I'd create a user interface class where I'd give the users a choice and get their responses. I'd probably create a Game class to control it all. While this all seems daunting, you are trying to do essentially the same thing, but all in one huge class. My recommendation: study OOPs and learn to do it the smart way. Good luck.

  • Smartform - Loop issue not printing correctly

    Hi,
    In smartforms -Main Window - I created like this
    1.Loop Statement   - This will loop - ITAB1
    TEXT statement - ITAB1-ADRNR - (prints the address)
    within the loop
      ITEM_DATA (item data) table.  - This will Loop ITAB2 - where ADRNR = ITAB1-ADRNR
    This supposed to put line items which are having ADRNR from ITAB1
    But my program is printing in wrong way..
    it is printing
    ADDRESS1 - ITAB1-ADRNR - correct
    ITEM DATA -  from ITAB2- related to ADRNR  (if it has only 1 record) - correct
    ADDRESS2-ITAB1-ADRNR - correct
    ITEM DATA - from ITAB2 - where ADRNR = ITAB1ADRNR - if this condition satisfies more than 1 record
    supposed to print all the records - but instead it is printing  always the first record   - wrong
    Ex- if 3 records has the same ADRNR of ITAB1 in ITAB2 - it is actually printing 3 times the first satisfying record - Wrong
    Can anyone please tell me what is the issue?
    Thanks for your time.
    Kevin

    Hi,
    I created like this..
    ITAB1 - complete data
    ITAB2 - unique records based on ADRNR
    1. LOOP ITAB2
    Print Address - ITAB2-ADRNR
    ITEM DATA(header and line items)
    I have given table name in DATA loop section
    - loop ITAB1 - where ADRNR = ITAB2-ADRNR
    But in item data it is printing the same line item repetedly .
    Any comments?
    Thanks for ur time.

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • Dbms_output.put_line not printing in inner for loop using a parameter

    I cannot get the inner loop to print output. I can run both loops independent (hardcoding a value for the inner loop) Any help is apprecicated... Listed is the code
    set serveroutput on
    DECLARE
    cursor ACCNO_CUR is
    select accession_number from didb_studies where insert_time > to_date('02-JUN-12');
    cursor PATH_CUR (p1_accno VARCHAR2) is
    select distinct l.FILE_SYSTEM || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),1,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),4,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),7,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),10,3) || '/' ||
    s.STUDY_DB_UID || '/' || i.SERIES_DB_UID || '/'||
    i.RAW_IMAGE_DB_UID || '.img' as FULLY_QUALIFIED_IMAGE_NAME
    , l.image_size
    , i.image_need_backup
    , i.sop_class_uid
    from medistore.didb_studies s
    , medistore.didb_raw_images_table i
    , medistore.didb_image_locations l
    where s.accession_number = 'p1_accno'
    and s.study_db_uid = i.study_db_uid
    and i.raw_image_db_uid = l.raw_image_db_uid
    and l.file_system is not null and INSTR(l.file_system, '.img') = 0
    UNION
    select distinct(l.FILE_SYSTEM) as FULLY_QUALIFIED_IMAGE_NAME
    , l.image_size
    , i.image_need_backup
    , i.sop_class_uid
    from medistore.didb_studies s, medistore.didb_raw_images_table i,
    medistore.didb_image_locations l
    where s.accession_number = 'p1_accno'
    and s.study_db_uid = i.study_db_uid
    and i.raw_image_db_uid = l.raw_image_db_uid
    and l.file_system is not null and INSTR(l.file_system, '.img') > 0
    order by 1;
    BEGIN
    FOR accno_rec in accno_cur LOOP
    DBMS_OUTPUT.put_line('ACCESSION_NUMBER is: '|| accno_rec.accession_number);
    FOR path_rec in path_cur(accno_rec.accession_number) LOOP
    DBMS_OUTPUT.put_line('Inner loop accession_number is :'||accno_rec.accession_number);
    DBMS_OUTPUT.put_line('Full path is : ' || path_rec.FULLY_QUALIFIED_IMAGE_NAME);
    END LOOP;
    END LOOP;
    END;

    Maybe
    DECLARE
      cursor ACCNO_CUR is
        select accession_number
          from didb_studies
         where insert_time > to_date('02-JUN-12');
      cursor PATH_CUR (p1_accno VARCHAR2) is
        select distinct
               l.FILE_SYSTEM || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),1,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),4,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),7,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),10,3) || '/' ||
               s.STUDY_DB_UID || '/' || i.SERIES_DB_UID || '/'||
               i.RAW_IMAGE_DB_UID || '.img' as FULLY_QUALIFIED_IMAGE_NAME,
               l.image_size,
               i.image_need_backup,
               i.sop_class_uid
          from medistore.didb_studies s,
               medistore.didb_raw_images_table i,
               medistore.didb_image_locations l
         where s.accession_number = to_number(p1_accno) /* to_char(s.accession_number) = p1_accno */
           and s.study_db_uid = i.study_db_uid
           and i.raw_image_db_uid = l.raw_image_db_uid
           and l.file_system is not null
           and INSTR(l.file_system, '.img') = 0
        UNION
        select distinct
               l.FILE_SYSTEM as FULLY_QUALIFIED_IMAGE_NAME,
               l.image_size,
               i.image_need_backup,
               i.sop_class_uid
          from medistore.didb_studies s,
               medistore.didb_raw_images_table i,
               medistore.didb_image_locations l
         where s.accession_number = to_number(p1_accno) /* to_char(s.accession_number) = p1_accno */
           and s.study_db_uid = i.study_db_uid
           and i.raw_image_db_uid = l.raw_image_db_uid
           and l.file_system is not null and INSTR(l.file_system, '.img') > 0
         order by 1;
    BEGIN
      FOR accno_rec in accno_cur
      LOOP
        DBMS_OUTPUT.put_line('ACCESSION_NUMBER is: '|| accno_rec.accession_number);
        FOR path_rec in path_cur(accno_rec.accession_number)
        LOOP
          DBMS_OUTPUT.put_line('Inner loop accession_number is :'||accno_rec.accession_number);
          DBMS_OUTPUT.put_line('Full path is : ' || path_rec.FULLY_QUALIFIED_IMAGE_NAME);
        END LOOP;
      END LOOP;
    END;Regards
    Etbin

  • When scaling in page setup, 1st page prints correctly, but subsequent pages do not scale correctly/too large for the paper, parts of the text missing

    When trying to print in Firefox, and when scaling the page size in page setup, the first page prints correctly, but subsequent pages do not scale correctly and are too large for the paper, with parts of the text are being cut off at the top and right. This is not fixed by checking or un-checking the "ignore scaling/shrink to fit page width" in the print window, or by changing the scaling%.
    I am running Firefox 15.0.1, on Mac OS 10.5.8.
    The same problem happens in the print preview and if I save the print as a .pdf
    I have tried all the fixes in the how to's and others in various forums with no improvement.
    This happens every time I try to print a document scaled up or down only in Firefox.

    The 2nd page print scaling error has been an issue with Firefox on the Mac since 2011. People at Mozilla have not considered this a major problem. Try printing anything at less than 100% and you'll quickly see how every page after the first page being scaled wrong gets old real fast. The lack of a solution to this issue forced me long ago into using Safari as my primary browser. Good luck waiting until version 21 for a solution. Current release is 18.0.2.

  • Strange System.out.print behavior inside a for loop

    I'm trying to create a simple ASCII progress bar in the console that would display like this:
    |--------------------------------------------|
    ============================More equal signs would appear as time goes on. At least this is what I want to happen.
    Instead, what happens is, none of the equal signs are printed until the very end, after the for loop in which the System.out.print("=") statement is in, has exited.
    This is my code (probably more than necessary is shown, but the important part is the for loop):
        public void addSomeDiffys(int numOfDiffys, int minInt, int maxInt) {
            Diffy currentDiffy;
            System.out.println("\nCreating Diffys.");
            System.out.println("|--------------------------------------------|");
            for (int i=0; i < numOfDiffys; i++) {
                currentDiffy = new Diffy(minInt, maxInt);
                if ((i/(double)numOfDiffys)*100 % 2 == 0)
                    System.out.print("=");
                diffyList.add(currentDiffy);           
            System.out.println("\n" + diffyList.size() + " Diffys created.\n");
            System.out.println("Sorting according to highest rating...");
            Collections.sort(diffyList,Diffy.HIGHEST_RATING_ORDER);
            System.out.println("Done.\n");
        }I also tried changing the System.out.print("="); to System.out.println("="); This time it works as expected, its just not very pretty...
    I get something like this:
    |--------------------------------------------|
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =So again, when I use println, rather than print, the equal signs are printed over time, slowly, as the progress increases. When using print, Nothing happens for a long time, and then suddenly they all appear after the for loop has terminated, which makes no sense.
    Thanks for any help.

    When using print, Nothing happens
    for a long time, and then suddenly they all appear
    after the for loop has terminated, which makes no
    sense.
    Yes it does make sense! The characters are buffered inside the PrintStream and written when there is a full line to write. You could try a flush() after each = is written but I have no confidence that it will make any difference.

  • Output not printing correctly for BI Publisher report.

    Hi All,
    We have a BI Publisher report which is printing correctly on one printer but not on another printer. The top and right side of the output are getting truncated. Printer type for both the printer is same that is "--PASTA Universal Printer Type" and both are using the same printer driver 'PASTA_PDF' and same style 'PDF Publisher'.
    Please let me know how can I debug the issue.
    Thanks
    Vishalaksha

    Steve- I understand what you are mentioning about the ftp, the XML file looks okay on both server and the client except for the letter 'ü ' and the rest of the German characters prints okay. THe problem is that the BI reprot is printing the same wrong characters.
    --Ravi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Printing "for" loop interations

    Currently I'm stuck. I can't get more than the first interation of the two loops to print out on the same line. I can get the code to print all the interations if I run the loops seperately. But I'm trying to get the output of the two loops to print out side by side.
    public class Project
    public static void main(String[ ] args)
    final double CELSIUS_TABLE_BEGIN = 40.0; // The table's first Celsius temperature
    final double CELSIUS_TABLE_END = 31.0; // The table's final Celsius temperature
    final double CELSIUS_TABLE_STEP = 1.0; // Increment between temperatures in table
    final double FAHRENHEIT_TABLE_BEGIN = 120.0; // The table's first fahrenheit temperature
    final double FAHRENHEIT_TABLE_END = 30.0; // The table's final fahrenheit temperature
    final double FAHRENHEIT_TABLE_STEP = 10.0; // Increment between temperatures in table
    double celsius; // A Celsius temperature
    double fahrenheit; // The equivalent Fahrenheit temperature
    double celsius1; // The equivalent Celsius temperature
    double fahrenheit1; // A fahrenheit temperature
    System.out.println(" TEMPERATURE CONVERSION ");
    System.out.println("---------------------------------------------");
    System.out.println("Celsius Fahrenheit Fahrenheit Celsius");
    for (celsius = CELSIUS_TABLE_BEGIN; celsius <= CELSIUS_TABLE_END; celsius -= CELSIUS_TABLE_STEP)
    for (fahrenheit1 = FAHRENHEIT_TABLE_BEGIN; fahrenheit1 <= FAHRENHEIT_TABLE_END; fahrenheit1 -= FAHRENHEIT_TABLE_STEP)
    fahrenheit = celsiusToFahrenheit(celsius);
    celsius1 = fahrenheitToCelsius(fahrenheit1);
    System.out.printf( "%6.2fC %9.2fF %12.2fF %10.2fC \n", celsius, fahrenheit, fahrenheit1, celsius1);
    System.out.println("---------------------------------------------");
    public static double celsiusToFahrenheit(double c)
    return (9.0/5.0)*c + 32;
    } //end method
    public static double fahrenheitToCelsius(double f1)
    return (5.0/9.0)*(f1 - 32);
    } //end method
    } //end class <Project>

    Heres an example of how to loop in parallel:
    public static void main (String[] args) {
              int j = 5;
              int k = 10;
              for(int m = j, n = k; m > 0 || n > 0; m--, n--) {
                   //Print m and n
                   if(m > 0 && n > 0) {
                        System.out.printf("m := %5d%10sn := %5d", m,"", n);
                   //Print m
                   else if (m > 0) {
                        System.out.printf("m := %5d", m);
                   //Print n
                   else {
                        System.out.printf("%20sn := %5d", "", n);
                   System.out.println();
    }Output:
    m :=     5          n :=    10
    m :=     4          n :=     9
    m :=     3          n :=     8
    m :=     2          n :=     7
    m :=     1          n :=     6
                        n :=     5
                        n :=     4
                        n :=     3
                        n :=     2
                        n :=     1Mel

  • How to convert editable pdf into non-editable version for printing option only without setting up passwards?

    I am using IOS system with pdf preview functions. I try to convert editable pdf file into read only for others to print without access to edit the file.
    The only way I can do now is to convert to jpeg for each page and convert back to pdf then combine all pages together. It takes a lot of time in this case.
    Can anyone tell me how to do the conversion without setting up passwards for protection?
    Thank you very much!

    First of all, don't use all CAPS as it means shouting.
    Second, your question is completely off-topic for this forum which discusses Microsoft Office Outlook.
    Third, this is a peer-to-peer forum, don't count on anyone calling you. If you want dedicated support from Microsoft, contact Microsoft Support directly.
    Anyway, you can insert the picture in to OneNote and then have OneNote convert it into text. This usually isn't very accurate for scans though.
    A better solution would be to use a application which is dedicated to OCR. There are various out there. I suggest you try their demo versions to find out which works best with your handwriting.
    Robert Sparnaaij
    [MVP-Outlook]
    Outlook guides and more: HowTo-Outlook.com
    Outlook Quick Tips: MSOutlook.info

  • Print a value outside the for loop.

    for (int j=0; j< 4; j++)
              String name = "AAAA";
              String add="BBBB";
              LogManager.logStatus("  NAMe.. ............   "+name);
    LogManager.logStatus("  Name ;;;;;;;;;;;   "+name);I want to how to print the "Name ;;;;;;;;;;; ". after the for loop.

    If i declared as
    private static String name;
    then the output is coming null in 2nd log statement.
    But i need the the print of 2nd log should be same as log in 1st .

Maybe you are looking for

  • Automatically setting date and time

    Is there any way to automatically set the date and time on an iPod Touch? I don't think so, but I thought maybe there was a third-party app or some other work around to do this. I don't see why this isn't built into the OS. I know the iPhone can do t

  • ESS Portal Trip/Expense form only prints the first page

    Good morning;     Our users reported that when they display a trip/expense via Portal and then right mouse click in order to print the trip, only the first page prints out.  If they go to the SAP Gui and run the TRIP transaction and display the trip

  • IPad set up

    I bought iPad yesterday. Downloaded latest iTunes. Plugged in the USB to the computer. Plugged in the connection to the iPad. Message popped up on my computer screen: This iPad cannot be used because the Apple Mobile Device service is not started. Wh

  • UDO OBJECT+ PRINT LAY OUT DESIGHNER

    Hi Friends   I created a Sales invoice Udo Form. now i need to create invoice using Print lay out desighner. How can it possible . Any one can help me thanks

  • Pop up buttons in template?

    yeah , ive had a duplicating issue with the template... figured that out, now, i want to add a DW8 pop up menu to my template and it is greyed out, then we tried to make the button and pop up in an html file and copy it.. copy it and it dosent work ?