Problem with printing a formatted text

Hi,I make a program, which creates tests and examines users. At the end of examination I need to print an exam record. Which way is the best to do this, if I need to print a lot of things (time, user records, right answers, wrong answers..........) at fixed position by different fonts?
I have placed JLabels to one JPanel and I have printed it, but it was not printed correctly. Some JLabels were missing and some were shortened.
Can someone help me? How is it made in a professional aplications?
Thank you
Frantisek Marousek
[email protected]

Hi,I make a program, which creates tests and examines users. At the end of examination I need to print an exam record. Which way is the best to do this, if I need to print a lot of things (time, user records, right answers, wrong answers..........) at fixed position by different fonts?
I have placed JLabels to one JPanel and I have printed it, but it was not printed correctly. Some JLabels were missing and some were shortened.
Can someone help me? How is it made in a professional aplications?
Thank you
Frantisek Marousek
[email protected]

Similar Messages

  • Problem with printing to a text document

    Well to start off...here is my code.
    import java.io.*;
    import java.util.*;
    // Mike Hatch
    public class project12
    static Scanner console = new Scanner(System.in);
         Scanner inFile = new Scanner(new FileReader("f:\\JAVA\\projects\\receipts.txt"));     
         public static void main(String[] args)
    int movies;
              double price;
              price=2.00;
    double change, cash, tax, total;
    System.out.println("Enter how many movies you are renting.");
    movies = console.nextInt();
              System.out.println("movies = " + movies);
              price = movies * 2.00;
              System.out.println("The movie price is " price ".");
              tax = price * .08;
              System.out.println("Tax: " +tax);
              total = price + tax;
              System.out.println("The Total with Tax is " total ".");
              System.out.println("Cash Tendered: ");
              cash = console.nextDouble();
              change = (cash - total);
              System.out.printf("Your change is %.2f", change);
              if (change < 5)
                   {System.out.println("Thank You For Doing Buisness With US.");}
                   else if (change >=5)
                   {System.out.println("Thank You");}
              else if (change >5);
                   {System.out.println("We Value Your Buisness Here At The Movie Shop");}
                   inFile.close();
    This is the error i am recieving:
    project12.java:53: non-static variable inFile cannot be referenced from a static context
                   inFile.close();
                   ^
    1 error
    does anyone have an idea on how to fix this. i have been trying for quite a while not to no avail.
    if anyone can help it would be much appreciated.
    -silence-

    now im getting the project12.java:71: reached end of file while parsing
    ^
    1 error
    i added more code to this though, here is the updated code:
    import java.io.*;
    import java.util.*;
    // Mike Hatch
    public class project12
    static Scanner console = new Scanner(System.in);
         public static void main(String[] args) throws FileNotFoundException
    Scanner inFile = new Scanner(new FileReader("f:\\JAVA\\projects\\receipts.txt"));
    int movies;
              double price;
              price=2.00;
    double change, cash, tax, total;
    System.out.println("Enter how many movies you are renting.");
    movies = console.nextInt();
              System.out.println("movies = " + movies);
              price = movies * 2.00;
              System.out.println("The movie price is " price ".");
              tax = price * .08;
              System.out.println("Tax: " +tax);
              total = price + tax;
              System.out.println("The Total with Tax is " total ".");
              System.out.println("Cash Tendered: ");
              cash = console.nextDouble();
              change = (cash - total);
              System.out.printf("Your change is %.2f", change);
              if (change < 5)
                   {System.out.println("Thank You For Doing Buisness With US.");}
                   else if (change >=5)
                   {System.out.println("Thank You");}
              else if (change >5);
                   {System.out.println("We Value Your Buisness Here At The Movie Shop");}
    movies = inFile.nextInt();
              price =     inFile.nextDouble();
              change = inFile.nextDouble();
              cash = inFile.nextDouble();
              tax = inFile.nextDouble();
              total = inFile.nextDouble();
                   inFile.close();
    }

  • Many problems with the 'Export to Text' (.txt) in CR Xi

    Hi,
    I have listed many problems with the 'Export to Text' (.txt) function of CR Xi.
    These problems are related to this export format only (meaning everything works fine in the Viewer or in the 'Export to PDF')...
    - Multi-columns layout do not export as Multi-column (export only a one column);
    - Numeric values with parenthesis for negative values or with a fix currency sign at the leftmost position are not exported correctly;
    - Fields having a Suppress formula which is "WhilePrintingRecords" do not appears when exported;
    - Fields with 'Suppress double value' checked are not always suppressed when exported to Text.
    - 'Keep Group Together' flag is not working.
    - 'Reset Page Number After' simply does not works when exported to text;
    - 'Keep object together' on TextBox/Section is not working.
    - Whenever a group is ending on the last line of a page, the the following page as the same Group header as the previous group with no records until the page is filled, then the PageBreak and PageHeader is missing but the records of the following group appears.
    I would like to know what is the status of the 'Export to Text' function (is it a deprecated function not supported anymore???).
    If still supported, when will these bugs be fixed???
    Thanks

    Hi Rene
    Export to Text is supported till date. Crystal Reports 2008 also supports this with Keep together working however when I tried with format with multiple columns, it didnot show up in the exported text file.
    Regards
    Sourashree

  • 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

  • Problem with printing a PDF

    Hi All,
    I'm developing a web application written in J2EE that uses Java Reporting Component (JRC) to display crystal reports from some filters recovered from a jsp and passed to a report .rpt previously designed and invoked just at runtime.
    I have a problem with printing a PDF:
    I want, after entering the filters in a jsp, to print a report in PDF format (WORD) without opening it
    with Adobe Reader (Microsoft Word). The class of API JRC used for export is ReportExportControl.
    Can anyone help me?
    I wish a great day to You all.

    Hi Ted Ueda,
    sorry for the delay of my answer.
    I understand very well the problems related to security.
    With the following code that I used to produce a report (PDF) at runtime,
    is the PDF created on the server and then sent to the client, or is it directly created on the client as PDF
    from RTF previously realized?
    ReportExportControl exportControl = new ReportExportControl();
    String report = report path;
    ReportClientDocument reportClientDoc = new ReportClientDocument();
    reportClientDoc.open(report, OpenReportOptions._openAsReadOnly);
    Object reportSource = null;
    reportSource = reportClientDoc.getReportSource();
    //The method setConnectionProperties() stores all the connection parameters in the collection
    //ConnectioInfos
    ConnectionInfos connInfos = setConnectionProperties(request, reportClientDoc);
    exportControl.setEnableLogonPrompt(false);
    exportControl.setEnableParameterPrompt(false);
    exportControl.setReportSource(reportSource);
    exportControl.setDatabaseLogonInfos(connInfos);
    //Single method to pass parameters to Crystal Reports. Using classes ParameterFieldController and
    //ParameterFieldDiscreteValue
    setReportParametersValue(reportClientDoc, reportParameters, subReportParameters);
    ExportOptions exportOptions = new ExportOptions();
    //Set the export format (PDF)
    exportOptions.setExportFormatType(ReportExportFormat.PDF);
    PDFExportFormatOptions PDFExpOpts = new PDFExportFormatOptions();
    exportOptions.setFormatOptions(PDFExpOpts);
    exportControl.setExportOptions(exportOptions);
    exportControl.setExportAsAttachment(true);
    try {
          exportControl.getHtmlContent(request, response, getServletConfig().getServletContext());
    } catch (ReportSDKExceptionBase e) {
    throw new ApplicationException("error code", ": error message"); }               
    As, however, I predicted in my previous message about the direct printing on the client,
    I read about ActiveX, but I don't know how to use them.
    I read this information in the 'Crystal Reports for Eclipse Developer Guide' about "printMode" attribute:
    "In ActiveX print mode, an ActiveX control is downloaded to the client machine and the report is send directly to the printer...."
    The ActiveX alternative is a java applet that runs on the client and takes the pdf from the server and prints directly onto the clients through the commands that I used in the DOS command line:
    1)     AcroRd32.exe /p /h FILENAME
    where
    /p = print
    /h = hide window
    to print the report and
    2)     tkill AcroRd32
    to close Adobe Reader, because it doesn't end automatically after printing and the command  /h  is used just to minimize the process.
    I hope you can give me advice because I need to print directly on the client. Thank you

  • Problem with printing ALV lists

    Hey Guys,
    I have a problem with printing ALV lists ,
    I created a report with several ALV lists (not grids) on the same screen but when i attempt to print the report
    it prints each alv list on a different page..so if i have 3 alv lists in the same report it will print the report on 3 pages
    How can i print  them all in one page?
    Thanks in advance
    Noha Salah.

    Hey Max,
    I tried setting the Layout-list_append  before my block_list_append function call
    And setting the is_print-NO_NEW_PAGE , it printed the 3 lists on one page the only problem i have
    is that the lists are truncated and the list formats has totally been messed up..how can i restore them back
    to their original format?

  • I had a problem with print preview of billing document.

    HI all,
    I had a problem with print preview of billing document which contains two output types ZR1 ZR2..
    For the footer text of billing document I maintained the font size as 7,5 pts, But when i go for print preview from output type ZR1 the font size of footer text is very small and looks good for output type ZR2.
    If i change the print options-->logical destination of output type ZR1 same as Output type ZR2, the footer text looks good.
    I think there is some issue with logical destination in print options for the output type ZR1, how can i resolve  it.

    hi,
    for both the output types , r u using same sapscript or smartform?
    if yes then, u can control it in output options of smartform and also in sapscript , you can control through if condition.
    and if differect sapscript or smartform then you should not get such problem.
    you can check the sapscript or smartfrom in TNAPR table.

  • Problem with printing from Acrobat Reader XI

    SInce I installed Acrobat Reader XI I have got problems with printing out pages. The text starts a bit down (2 cm) on the paper, resulting that the last part of the text on the page will be missing. And the missing part does not follow on page 2, it just don´t comes out!
    It doesn´t matter what settings i click in on the print setting page in Acrobat Reader, it always gets the same result.
    Does anyone know what can be the problem?

    No files appeared in C:\Users\Pavilion\AppData\Roaming\Adobe\Adobe PDF\Settings but they did appear in Distiller.
    I tried to copied them from C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Settings, but found they were already there.  I copied them by adding -COPY before .joboptions in the name.  Now they appeared in  Printing Preferences with the -COPY added.
    I tested a print from Word (using File / Print), but was not prompted for the filename or location.  I checked my entire system and couldn't find the PDF file anywhere.  I tried changing the Port to Desktop\*.pdf using Printer Properties, but that didn't work either.
    I was able to successfully use the Acrobat menu item in Word & Excel to create a PDF but it automatically created the file on the Desktop without an option to change the filename.
    After several days and hours, I gave up and installed Acrobat X on the W7 computer.  I can still use Acrobat XI on the W8 computer.  So be it!
    Thanks anyway for your attempts to help.

  • Problem with print photo 13x18

    hi i have a problem with print photo (13x18) size it cut in the end of photo i use hp photo creations but if choose 100%size or full screen  same result  please what can i do;  i am disapoint to buy this printer if photo print so

    Cornelia-I, I used "single/image contact sheet" and there is a Lightroom
    Template for 2x2 cells.  I modified this a little to make the cells smaller
    to provide room for the captions and margins for hole punching and binding
    the sheets.
    No, I surely did not type in each caption.  The captions were Title plus
    Caption taken from the metadata plus a comma and # sign preceding the
    filename which was a date/sequence number.  I was printing four different
    images on each page and 36 images total so there were nine pages of the
    booklet.
    I didn't try the idea of switching the Photo Info option off and back on to
    the custom package because I had already created a custom preset and as soon
    as I discovered that all it needed was to have a period added or removed at
    the end of the line each time, it was easy to simply switch back and forth
    between the two text presets which was doing the same thing you recommended.
    Whole job was simple once I discovered that the problem was simply that I
    needed a new version of the text string every time I printed and couldn't
    simply keep using the same one over and over.  The time wasted was lost
    trying to figure out what was causing the lines to suddenly become truncated
    when previously they had been there.  Which is why I wrote it up so others
    need not waste that time if they want to do this.

  • HP Officejet Pro 8600 "Problem with Printer or Ink System'

    A gander at this forum suggests I am one ofa multitude of people perplexed by this issue. There is a notation beside one enquiry which says 'Problem Solved'.... well it isn't for me. My printer (typical!) is one month out of warranty. I had to replace the black cartridge and, when I did, it came up with this error prompt. I then replaced all the other cartridges. HP suggests removing the printhead and following that they say place it 'upside down on a clean sheet of paper'... NO instructions for cleaning it!! When it is replaced in the printer they suggest you 'rock the printhead left and right to make sure that the printhead fully seats in the carriage' and if THIS doesn't fix things 'try reseating the printhead up to 3 times'... This in itself is an admission of an 'issue' with this product. It doesn't sound like a very scientific engineering 'fix' to me!
    A new printhead costs almost what we paid for the printer a year ago. I hate consigning anything to landfill that I can avoid... unfortunately it looks like that is where this unit belongs...

    Hi @Robin_Perth,
    Welcome to the HP Forums!
    I am sorry to hear about you getting the problem with printer or ink system error, with your HP Officejet 8600, but I am happy to look into this for you!
    I am assuming you have already been through this guide, A 'Problem with Ink System' Error Message Displays on the Control Panel or Computer During Setup.
    If this guide does not resolve the issue, please call our technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region. Country-language selector.
    This guide, Limited Warranty for HP Ink Cartridges and Customer-Replaceable Printheads for HP Inkjet Supplies, will help you to determine if your printhead is still in warranty or not.
    Hope this helps!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • HP 4622 All in One Printer: Problem with Printer or Ink System

    Problem with Printer or Ink System Error OXC19a0027.

    charleshia wrote:
    Thanks so much for replying to my post. I tried the fist suggestions and they did not work. So, I attempted to move on Dow to the cleaning of my printer. I am the the first to admit that I'm not the genius when it come to electronics buys, my printer do not seem to have what is described in the photos. I'd like to upload a photo of my ink cartage but do not know how.
    Charleshia, you can upload a photo here to reply. Click Reply, then on the window you'll see the image below..
    click the one which has the red box, it's where you insert the photo
    Going back on your issue.. the basic step would be.. take out the inks then close the door... what error message you  got? If it's saying "Missing Ink Cartridge" just hit OK. Unplug the power cable at back of the printer, plug it back in.. Clean the copper contacts on the ink cartridges using a lint free cloth then reinstall them. Let me know if it resolved it or not.. I can only give basic troubleshooting here

  • Problem with printing pdf file

    hello,
    lately i have problem with printing pdf file:
    i click on the print button and the respod is very slow
    it takes more than a minute till the print window apears.
    i tryied to install version X but it's the same, the problem exist only when printing via adobe reader,
    other programs i'd working much faster.
    please advice,
    thank you

    No, it is not set to overprint. Also, I have to add that the printing results were not consistent. Sometimes it covered and sometimes it did not.

  • Problem with printing files created by tcpdf class

    Hello,
    I have problem with printing pdf files created with tcpdf php class which contain embedded fonts
    http://www.tecnick.com/pagefiles/tcpdf/example_008.pdf
    Could someone try to print that example file at his Reader (printing to file .ps will be fine).
    I'm trying to determinate if problem is in my system (Ubuntu 8,04) in Reader or in class.
    Thanks in advance

    No problem with Adobe Reader 8 or 9 .

  • Problems with printer and network connectivity

    So I've been using an HP B110a photosmart wireless e-all-in-one printer that I got with my macbook pro and at the start, everything worked perfectly in terms of wireless printing, ePrint, and AirPrint. But recently, when I try to print wirelessly, it says the printer is not connected and I also can't find it on the list of nearby printers on the 'add printer' window. I also had problems with printing via ePrint but those have cleared up (I don't know what was wrong but it's fine now). Printing with AirPrint on my iPod touch has stopped working as well because the printer doesn't show up when I search for nearby printers.
    Here's what I've checked/tried so far:
    All the wireless services are enabled on my printer and my mac
    I've reset the printing system on my mac, printer settings to factory defaults
    Restarted mac/printer/iPod
    Restarted router
    Reinstalled HP printing software that came with the printer
    All software is up to date
    Wireless printing on another windows computer does work
    Setting up wireless printing using the HP install disc doesn't work
    Trying to add a new printer using the HP software disc that came with the printer is unsuccessful in locating the printer as well.
    Printing over USB is problem-free
    When I tried restarting the printer/router, I could see the printer for just a few minutes in the 'add printer' list but then it would disappear from the list and the printer would be 'not connected' so I can't print wirelessly.
    More info
    MacBook Pro (13 inch, early 2011)
    Mac OS X Lion (10.7.2)
    HP Photosmart e-All-in-One B110a
    Router is a Huawei HG556a that I got from Vodafone NZ
    Thanks in advance!

    http://support.apple.com/kb/DL907

  • Problem with printing graphics in SAP Script

    Hi,
    I am facing problem with printing of graphics in SAP Script. I uploaded a bitmap file from pc to se78. Then I inserted it in SAP script.
    I am able to view it in the printpreview as well as in the spool number. But it is not getting printed.
    Plese tell me the solution.
    Thanks,
    Srinivas

    You need to check your printer settings.Might be drivers are missing.

Maybe you are looking for

  • MM PO user exit

    I am trying to write a code in the enhancement MM06E005 - to check a field in the PO when saving and issue a warning message. I am using the function module EXIT_SAPMM06E_012 to do this.  It does not work.  But when I try to make it as an error messa

  • Stored Procedure issue

    I have this stored procedure to check if someone ordered a Cancellation date on the line before cancelling it but when i try to add another condition where it should also check for cancellation code it fails. It works if they are individually used. A

  • Connection reset by peer (jdk/jre 1.5.0_06, oracle 10.2.0.2)

    I keep getting the "Oracle says: Io exception: Connection reset by peer: socket write error" to my jdbc thin client connection. I have talked to our dba's and they don't see anything wrong on the oracle side. Network people say the network is good. W

  • 11g node manager reachable but server does not start from admin console

    I have a issue with node manager is reachable from admin console and from command prompt it is not connected and could not able to start the managed server. If i change /config/nodemanager/nm_password.properties plain text and restart it is not reach

  • No sound Dxdiag shows Error 19 (User verification of Softwa

    Just installed card after a Reformating and it doesnt work, worked perfectly fine before, now dxdiag shows an error msg, need some help