Output format wrong

Hello
Most of this app is how I need it to be except the far right column needs to be as a row on the bottom and the tally of each column not row. I am working with a 2-d array. Thanks much for any help!!
Hal
import java.awt.*;
import javax.swing.*;
public class a extends JApplet{
     int receipt[][] = {{ 150,225,300,450 },
          { 350,600,275,325 },
          { 550,324,500,525 },
          { 325,400,350,575 }};
     int SPeople, products;
     JTextArea outputArea;
     String output;
     public void init(){
          SPeople = receipt.length;
          products = receipt[ 0 ].length;
          outputArea = new JTextArea();
          Container container = getContentPane();
          container.add( outputArea );
          output = " Patty Kim Terri Rene total prod sales\n"; //output names
          // output total prod     
          for( int counter = 0; counter < SPeople; counter++ ){
               buildString( counter );
               output += totalProd( receipt[ counter ]);
          output += totalClient( receipt[ counter ]);}
          output += "\n\n\t\t\ttotal client sales";
          outputArea.setText( output ); //output names and total prod
     }// end init method
     public void buildString( int rowNumber ){
          output += "\nprod[" + rowNumber + " ] ";
          for( int column = 0; column < products; column++ )
               output += receipt[ rowNumber ][ column ] + " ";// space between numbers
     }// end buildstring method
     public double totalProd( int TProd[] ){
          int PTotal = 0;
          for( int count = 0; count < TProd.length; count++ )
          PTotal += TProd[ count ];
          return PTotal;
     }// end method totalProd
     public double totalClient( int TClient[] ){
          int CTotal = 0;
          for( int count = 0; count < TClient.length; count++ )
          CTotal += TClient[ count ];
          return CTotal;
     }// end method totalClient
}// end class sales

Hello
Hopefully this is more readable. As far as encapsulation I'm somewhat familar
with the concept but we haven't reached that point in class.
please help with the output of this thing.
Hal
import java.awt.*;
import javax.swing.*;
public class a extends JApplet{
     int receipt[][] = {{ 150,225,300,450 },
                      { 350,600,275,325 },
                      { 550,324,500,525 },
                      { 325,400,350,575 }};
     int SPeople, products;
     JTextArea outputArea;
     String output;
     public void init(){
          SPeople = receipt.length;
          products = receipt[ 0 ].length;
          outputArea = new JTextArea();
          Container container = getContentPane();
          container.add( outputArea );
          output =  "               Patty    Kim    Terri     Rene      total prod sales\n";  //output names
          // output total prod     
          for( int counter = 0; counter < SPeople; counter++ ){
               buildString( counter );
               output +=  totalProd( receipt[ counter ]);
          output +=  totalClient( receipt[ counter ]);}
          output += "\n\n\t\t\ttotal client sales";
          outputArea.setText( output );   //output names and total prod
     }// end init method
     public void buildString( int rowNumber ){
          output += "\nprod[" + rowNumber + " ]  ";
          for( int column = 0; column < products; column++ )
               output +=  receipt[ rowNumber ][ column ] + "      ";// space between numbers
     }// end buildstring method
     public double totalProd( int TProd[] ){
          int PTotal = 0;
          for( int count = 0; count < TProd.length; count++ )
          PTotal += TProd[ count ];
          return PTotal;
     }// end method totalProd
     public double totalClient( int TClient[] ){
          int CTotal = 0;
          for( int count = 0; count < TClient.length; count++ )
          CTotal += TClient[ count ];
          return CTotal;
     }// end method totalClient
}// end class sales

Similar Messages

  • Concurrent generating wrong output format with TEXT as output type

    Hi,
    I have create a custom rdf and set TEXT as its output type.
    I want the text output to be specific format but the concurrent is not generating the exact expected output.
    Expected Output:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE labels SYSTEM "label.dtd">
    <labels FORMAT="E:WIPMATX.ZPL" _QUANTITY="1" _PRINTERNAME="Printer
    1" _JOBNAME="LBL101">
    <label>
    <variable name="$$WIP_ENTITY_NAME$$">BLFTOP</variable>
    <variable name="$$WIP_ENTITY_NAME$$">BLFTOP14</variable>
    <variable name="COM">19AWG</variable>
    <variable name="LOT_NUMBER"></variable>
    <variable name="ASSEMBLY">A05A0084-1</variable>
    <variable name="QUANTITY_ISSUED">0</variable>
    </label>
    </labels>
    *Wrong Output:*
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE labels SYSTEM "label.dtd">
    <labels _FORMAT="E:WIPMAT_X.ZPL" _QUANTITY="1" _PRINTERNAME="Printer
    1" _JOBNAME="LBL101">
    <label>
    <variable name="$$WIP_ENTITY_NAME$$"> BLFTOP </vari
    </variable>
    <variable name="$$WIP_ENTITY_NAME$$"> BLFTOP
    BLFTOP14</variable>
    <variable name="COM">19AWG</variable>
    <variable name="LOT_NUMBER"></variable>
    <variable name="ASSEMBLY">A05A0084-1</variable>
    <variable name="QUANTITY_ISSUED">0</variable>
    </label>
    </labels>
    And Actually i am trying to generate this output format type because , wer are using Zebra Printer to print lable and it is a XML enabled bprinter and understand this specifice XML DTD type. We found when set Output type to XML, it was not generating XML in accordance with DTD which Zebra printer understand Hence we are tring to use TEXT output.
    Please suggest.
    Edited by: user5499188 on Oct 3, 2011 12:12 AM
    Edited by: user5499188 on Oct 3, 2011 12:13 AM
    Edited by: user5499188 on Oct 3, 2011 12:14 AM
    Edited by: user5499188 on Oct 3, 2011 12:23 AM

    I get the solution for this issue.
    The solution is to use XML Publisher etext temaplate.
    Etext is used to get text output in any format.
    Regards, :)

  • QM-How to add a New "Output Format" in Certificate Profile?

    Hello QM Functional Experts,
    Can any of you tell me how we can add a custom "Output Format" in the Certificate Profile (QC01/2/3). I tried the Configuration approach via QM-Quality Certificates-Certificate Profile-Define Data Origin. I do not see an option here to add a New Output Format.
    If this is posted in a wrong forum, I apologize. I am not able to find the correct forum for QM. Please redirect me and I will be glad to post it in the right forum.
    Thanks,
    Nagesh

    Hi,
    You can use the FM ..RV_MESSAGE_UPDATE..
    Thanks
    Naren

  • Output format in html

    Hai..
    In Classical Report , i'm getting the correct output format. While spooling in sm37, the report  sent through mail in html format. In html format ,the output alignment is coming wrong. Plz hrlp to resovle this.
    Regards,
    P.Rajalakshmi.

    thanks

  • Problem with Excel output format

    Hi Guys,
    I am creating a report in XML Publisher (not standalone). I am facing some problems could anyone please help me to figure out the issues.
    Is it possible to have all three output format (PDF, HTML & EXCEL) exact (same aligned) only by creating a single RTF Template? I am facing the problem with Excel output format the output format of excel is taking excels cell formatting.
    Example Numeric fields --> Right Aligned, text fields --> Left Aligned
    One more issue with excel is -ve(negative) values are getting displayed in red and in brackets like ($13) (with red color).
    Our client want excel output on priority.
    Is there any limitation for excel output format of reports?
    It is very urgent for us please help.
    Any help would be highly appreciated.
    Thanks,
    Pragati
    Edited by: user11237443 on Aug 27, 2009 1:22 AM

    Hi Mahi,
    Thanks for your response. But i could not understand how can we write wrapper program could you please give some light on this or provide some link it would be helpful for me:-)
    I have read that blog for excel limitations but i have more question?
    1) What about the negative values?
    if any field is displaying negative amount then excel not displaying right value for that:(
    2)How can we align header or data?
    Do XMLP with EBS provide any solution for formatting in excel?
    3) If for the alignment of numeric value we concatenate them with any special character then how can we perform calculation that field?
    Here are so many formatting issues do we need to write any code in xml for that?
    Please help.
    Many Thanks,
    Pragati

  • Changing Oracle Report Output Format at runtime

    Dear All,
    I've custom Oracle Report in Oracle Apps., and would like to give the users an option to select the output format (XML, TEXT, PDF, etc.) whilst submitting the request.
    As a SYSADMIN, we can modify the Output Format value of the concurrent program(Oracle Report in this case) to one we like.
    But I would like the user to select this output format option at runtime, rather then hard coding at SYSADMIN level. For that I've to create a Value Set with the desired report output format options, and attach this to the concurrent program.
    My question is, how we can make the desired output format to work at runtime?
    If any one can help?
    Thanks,
    Sandeep

    Hi Steve,
    I couldn't get it...???
    I'm running an Oracle Report in Oracle Apps. release 11.5.9
    The default output format of this report is TEXT, which is defined in its concurrent program.
    This report is submitted using standard request submission screen, and after successful completion we can view the output by pressing "View Output" button on "Requests" screen. This will open an another window and we can view the output page by page. Using "Tools>Copy File..." menu option, we can view the same output in IE window.
    Now, how does your resolution fits here and how can I view the same report in XML format?
    Many Thanks,
    Sandeep

  • Output format in background is not same as Foreground

    Dear All,
    I am running a report in Background but output is not coming in desired format. Suppose output contains 35 columns ( while running the report in Foreground) but in doesn't show all the columns in background. Is there any SAP Standard settings by which we can set the output format as per our requirement while running the job in background.

    Thanx Sourabh for your reply,
    I have check the variant , it is correct. It's a common problem that end users are facing in my organization.
    What I want that if standard output has width of 35 columns ( in foreground ), it must show all the columns in background also.

  • What output formats are supported by SAPConnect in SAP CRM 7.0

    Is MHT document format and .doc format the only filetypes that are supported in SAP CRM 7.0? Could anyone please answer what are all the other output formats supported by SAP CRM 7.0.

    Hi,
    For interactive CRM report, please try link
    http://help.sap.com/bp_crm70/BBLibrary/Documentation/C41_BB_ConfigGuide_EN_DE.doc
    On page of
    http://help.sap.com/bp_crm70/CRM_DE/HTML/index.htm
    you may find some other info related to BW analytics, maybe there is info for dashboard? I am not so sure.
    Hongyan

  • How to align output formatted and output text in the same line?

    Hi All,
    I want an output formatted label and a text on the same line,. I've surrounded these components wth a panel form layout and they automatically align one below the other. how do I kepe them in the same line?
    Thanks.

    Try as per the code snippet below:
    <af:document title="TestPage.jspx" id="d1">
    <af:messages id="m1" inline="true"/>
    <af:form id="f1">
    *<af:panelGroupLayout id="pgl1" layout="horizontal">*
    *<af:outputFormatted value="outputFormatted1" id="of1"/>*
    *<h:outputText value="outputText1" id="ot1"/>*
    *</af:panelGroupLayout>*
    </af:form>
    </af:document>
    Thanks,
    Navaneeth

  • Want text input containing HTML tags to appear as HTML in output format

    Hi,
    We have a table in Oracle database that has a column named detail,one of its values is like this: <bold><italics>Good Morning</italics></bold>. What our client wants is that the output format should show: <b><i>Good Morning</b></i>. That is,Bi Publisher should be able to parse the HTML tags and provide the desired output. Please tell me how to achieve this. Any help is much appreciated.
    Thanks and regards,
    Debarati,
    [email protected]

    Hi,
    have a look here (http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html) to get an idea.
    regards
    Rainer

  • Tutorials in SWF output format prompted "Do you trust this content to connect to the Internet?" when opening another SWF file

    Please help.
    I have a tutorial with in the output format of SWF and HTM. I have click boxes that On Success will open another tutorial (SWF file). When I click on the click box, I get prompted “Do you trust this content to connect to the Internet?” by the Adobe Flash Player. I can click “Yes” and continue, however I don’t want the user to get prompted for every click box with this action (there is one for every tutorial and navigation buttons to each tutorial). I also think that SCORM can't handle the prompt, because when I run the tutorial from the LMS the click boxes do not work at all.
    I have tried selecting “Always allow” in the Global Security Settings panel as per the instruction on this website: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l.
    Any ideas?

    Hi,
    I wanted to add on a question to this posting.... I believe Rod's instructions must be followed on a per-PC basis, correct? Is there any way to disable this globally when/after I publish the files rather than telling 1000 users across the globe that they have to change their security settings? I don't think so from the article (very thorough) but just hoping there's something I can do?!
    Thank you!
    Michele

  • Microsoft Word docs are formatted wrong when opened in pages

    Hi,
    I‘ve been using pages from the very beginning and I am very happy with it (still waiting for "auto-save", though), but I do have one problem:
    often when I open word .docs in pages they are formatted wrongly.
    This happens especially with tables and pictures in tables.
    If the pictures are in one line in MS Word, they often jump to the next line in pages.
    Or the margins are wrong or both.
    If I open it in Open Office, for example, they are fine.
    Is there anything I can do about it?
    Will it be better in pages 09?
    Frank

    Hi, I have a similar problem with Word (.doc) files containing a Table converted to Pages. Having read that Pages can convert from Word, I bought iWork instead of Office for Mac. I need to work on Word documents sent to me as attachments and find that Tables do not survive the conversion to Pages properly. Often the text within a Table is shown but, if a lengthy text (i.e. more than a page), the Table does not continue to the next page and the text becomes hidden below the visible Table. If I cut out some text from the middle of the Table, the missing text is revealed, progressively from the bottom of the Table. In other words, the text is there in the document but cannot be seen if it is more than can be fitted on one page. Any ideas on how to sort this? I am not encouraged that iWork 09 does not appear to help in a similar problem to mine.

  • (Input and) output formats from Photoshop Elements 6 for Mac

    I noticed that (until midnight PT, anyway) Amazon has Photoshop Elements for the Mac at a lower price than usual.  This brings up a question for me: What output formats can Photoshop Elements 6 produce?  In particular, can it produce PNG?  Also, can it accept PNG as input?

    I think that all the formats like .bmp, camera RAW, EPS,PICT, TIFF, Filmstripn, IFF, JPEG, Photoshop pdf, Photoshop RAW,PNG etc are supported for both input and output.

  • Different resolution in preview and output format

    Hi Folks
    I need your help. We already captured a lot of e-learning material but come to a problem.
    The output format quality is less good than the preview quality.
    Win7 /Captivate 6
    Capture resolution for software simulation is 1024x768.
    Producing the material in swf and html. No compressing, set to best quality.
    Open the preview: quality is nearly the same as the original source.
    Open the swf directly or the html --> output looks cloudy, diffuse.
    Test with an without scalable html. In case of scalable html it is hard to find the right resolution (1024x768) on a 1280x1024 resolution monitor, but you can find it and the the output is clear as the preview.
    The output format resolution within the project is set to 1024x768. We measured the "true" output resolution on different produced output formats, and they are all a little bit higher than 1024x768, about 4% more heigh and width.
    Of course, I was able to change the html-script which sets the start-format for an swf to open, if I change it to 1024x768 and save it, the quality of the swf is like the preview and sharp and ok. But in case of scalable html I cannot set the format. However, why the swf -even when i start/opeen it directly- didn't start with the right resolution set in the settings within the project?
    Also our target group should not "search" for the sharp resolution by scaling the output window.
    Why does captivate change the resolution? why is the preview ok and the produced swf not? I didn't understand that fact.
    Also we like to produce with TOC, so the widht for TOC is 250. If I change the html script in that case to 1024+250=1274x768 the swf is also unshapr/cloudy and I havee no change to fit it to the right resolution (1024+TOC).
    Regards
    Rob

    Vamsi mailed me offline and I have suggested looking at Using RH7 on my site where this problem is covered.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • Problem with output format

    Hi ,
    Whle submitting AP prepayment balance report able to get the output in XML format.
    But, if for the same report when the output format is changed to PDF or Text not able to get the report.
    Anybody pls suggest any changes to be done in setup to resolve the problem.
    Thank you in advance.
    Raj

    Are there any errors recorded in the log file of the concurrent request ?
    HTH
    Srini

Maybe you are looking for