Output on Printer

I want to a smallest java code which prints "Hello" on printer
please help me.

how small? 5-10 lines of code???
just take a look on the Printable, PrinterJob,, API and how about using it on a headless machines... the shortest way to do that is using the Runtime :) .
I dont require tutorial
I only require the smallest possible code.

Similar Messages

  • Error when sending report output to printer from Forms 10g

    Hi,
    I have a simple report that I am running from a form using run_report_object built-in. I can successfully send the report output to a file but when I send the report output to a printer my report is
    terminated with report status of 'TERMINATED_WITH_ERROR'. I am using the default forms service and reports server that comes with the forms builder. How do I specify the reports server to user my default network printer ?Following is the code that runs my report.
    Thanks,
    Anna
    PROCEDURE SEND_TO_PRINTER IS
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(50);
    rep_server system_variables.reports_server%type;
    alldone          exception;
    BEGIN
         select reports_server
         into rep_server
         from system_variables;
         if rep_server is null then
              msg_alert('Error getting the reports server name', 'I', FALSE);                
              raise alldone;
         end if;
         :ctrl.run_report_errors := 'N';                    
         repid := find_report_object('REP_OBJ1');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,rep_server);
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
         IF :ctrl.rg_print = 'P' THEN
              --Send the output to printer.
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,PRINTER);
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'dflt');
         ELSIF :ctrl.rg_print = 'R' THEN
              --Rich Text Format
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,FILE);
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'rtf');
              SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,:ctrl.filename);
         END IF;
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := REPORT_OBJECT_STATUS(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
         LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' THEN
              null;
         ELSE
              :ctrl.run_report_errors := 'Y';
              msg_alert('Error when running report.' || rep_status, 'I', FALSE);           
         END IF;
    EXCEPTION
         when no_data_found then
              msg_alert('Error getting the reports server name', 'I', FALSE);      
         when alldone then
              null;     
    END;

    If you use Windows the user that runs the reports server is usually LocalSystem. Check this in the Windows Services panel.
    LocalSystem has no printer access. To be able to print, you have to use a real domain user that has access to the printer. So, change the Log on properties in the Services panel.

  • Help reqd to display the form output  without print preview

    Hi all,
    I did one gate pass form and i want to view the form in my selection screen or output screen(just in monitor) as a display by giving one t-code.
    i.e, we can view the form thru Print preview...the same preview, i want to display after i give my parameter in the selection screen.
    For example.ZGPOUT if i enter as a t-code.
    it should ask my Gate Pass number in the Selection screen...if its right then my Form will come out to the display screen. (instead of going by Print method).,
    Pls post ur comment and reply me with examples,if possible.
    thanks & regards
    sankar.

    Hi Sankar,
    Simply put a parameter statement .
    for example.
    parameters : vbeln type vbrk-vbeln .
    when u ll execute.U ll get the selection screen asking u for the perticular parameter,U input that and execute.U ll get the output as print preview.In the above  query i ll input vbeln and ll get the o/p.Similarly u enter Ur getpass no and u ll get the printpreiview as o/p.
    Reward if useful.
    Regards
    Rudra

  • Output Type - Print Preview issue

    Dear Friends,
    I have an Output Type which when seen in the output preview / printing of billing doc shows the PO No. along with the other data.
    The Output Type picks up the Sales Order no. from the table VBFA based on the billing doc no. and collects the preceding doc no. This preceding doc i.e. the Sales Order doc no. is then passed in the VBKD table along with the line item no. of the billing doc. and then the PO No. maintained at the item level is picked up from the field BSTKD by matching it with the line item no. of the Sales Order Doc No.
    Now, I am facing a problem where when the PO No at the header level and the PO No of all the Item levels are same at the Sales Order doc, the output preview does not display the PO No. in the Output preview / print. This happens with only those sales order doc where the header level PO No. and Item level PO No. are the same. For rest other docs, things are running smooth.
    Kindly suggest me with some solution.
    Regards
    Vineet Jain

    When business data is the same on header and items, VBKD does not contain any lines for the items - it only contains a single line for the header where the item number is initial.  This fails your logic of looking up VBKD by line numbers.
    Edited by: Keerthi Hiremath on May 29, 2008 9:00 AM

  • Is it available crystal output through printer in peoplesoft(web/PIA).

    Post Author: rajaumareddy
    CA Forum: Crystal Reports
    Crystal output(through printer) to a Window when running via PIA (Web). Is it available in peoplesoft.

    Addendum: later versions of Premiere Elements now have the SmartSound Sonicfire Pro Express Tracks version (not the Scoring Edition) included, rather than the older QuickTracks module. This allows one to use the newer SmartSound Multi-Track discs, where the older QuickTracks module will only work with some of the older Multi-Track discs. The version of SmartSound Sonicfire Pro Express Tracks included is limited, vs the Scoring Edition (available for purchase), but allows for a lot of editing of SmartSound material. The installation is separate from the installation of the Premiere Elements installation, and involves a download of the Sonicfire Pro Express Tracks installer. It is also necessary to then apply the update to the Sonicfire Pro Express Tracks program.
    I feel, however, that the Sonicfire Pro Scoring Edition, when used with the Multi-Track discs, is so very useful, that I recommend anyone, who is serious about creating custom soundtracks for their Videos, look closely at it, and also that they see the SmartSound tutorials (on the SmartSound Web site), to discover the power that it provides - it is like having a million variations for each Multi-Track song.
    Hunt

  • Cannot cancel release stratigy after output is printed

    Dear Expert,
    I has been configuration output for PO ( print auto after release stratigy)
    After I release stratigy there is a scenario that user need to cancel release stratigy
    But the system is error not allow to cancel release stratigy after output is printed
    What's I miss? thank you very much.
    I release stratigy using ME29N and cancel using ME29N and ME28 also.
    Best regards,
    @tom _

    HI,
    In ME9F itself try to repeat the output.
    Thanks & Regards,
    Kiran

  • Cannot find PDL type for output device '(Printer name)'

    Hi,
    After seeing the statutory reports (PF, ESI etc) in standard format, we try to print form. We get the below error:
    Cannot find PDL type for output device '(Printer name)'
    Message no. FPRUNX113
    Diagnosis
    No PDL type has been found for the specified output device.
    System Response
    Error message
    Procedure
    Contact your system administrator.
    Procedure for System Administration
    For more information, see SAP Note 685571.
    Any input will be off great help...
    Regards
    Pooja

    Hello
    It looks like that you had not installed the ADS(Adobe Document server) for the PDF type reports. Please check with your basis team if you want to configure ADS.
    If you need the output as a sapscript then please do the sollowing steps:
    (1) Execute transaction SM30
    (2) Enter 'Table/View' as V_T5F99OCFT
    (3) Select 'Maintain' option.
    (4) Select 'New Entries' option from the Application Too
    (5) Enter following entries:
         Logical Form Name    = HR_IN_EPF12A_99M
         Form Variant         = (Leave this field blank)
         End Date             = 31.12.9999
         Start Date           = 01.01.1990
         Form Type            = SAP Script (SSC)
         Def. Type            = (This field should be checke
         PDF Form Name        = HR_IN_EPF12A_99M
         SAP Script Form Name = HR_IN_EPF12A_99M
         Smart Form Name      = (Leave this field blank)
    (6) Save the entries
    The above example I have given you is only for the form 12A.
    You have to make entries for all the reports sapscript in this table.
    Please goto SE71 -> F4 -> Payroll -> Payroll India here you will find
    all the sapscripts you require.
    Regards
    Ramana

  • Output problem: printer commands are printed

    Hi ,
    I have created a new page format ( 300 mm * 330 mm ) and i have assigned to a new format in the device type .But what command need to be changed in the printer initialization?
    At present when i print my sap script output it prints out the printer commands.
    Thanks and Regards,
    C.Abhinay

    closing

  • Output type print

    Dear All
    I select particular output type DC print . In that particular output type printing slowly 1 hr what is the reason
    Thanks and Regards
    Suresh

    hi,
    in the messages->further data under dispatch time give it as send immediately.
    \[removed by moderator\]
    siri
    Edited by: Jan Stallkamp on Jul 24, 2008 12:43 PM

  • Output to Printer or PDF File Comes Out Small, Like Zoomed Out

    I'm trying to print a 60 page family cookbook with text and pictures (17 mb, using the blank template). Everything looks fine on the screen as measured by the rulers, except for a large suspicious grey strip outside of the horizontally ruled area, along the left side of each page, inbetween the page and the left ruler (in 2-up view, there is a grey strip on the right side of the right hand page as well). In any files with these strips, the output to Print Preview, or the printer, or to PDF files is zoomed out so that the print area is about 70% of the original. I have some early versions of the files that look normal on the screen and which Pages outputs fine. In other words, there appears to be something wrong with these particular files. What?
    I thought that since I had originally placed some objects that stuck outside of the margins that may have caused this change, but everything now seems to be within the page margins. The scale is set to 100%. I can't duplicate the problem, and I can't fix it.
    Will the recipes get out on time?
    iMac G4   Mac OS X (10.3.9)   256 mg ram

    Welcome to the forums ShawnM. This problem is fortunately very easy to solve -- somehow Show Comments got turned on for your document. Go to the View menu and select Hide Comments, and that should do the trick.

  • Use desformat=spreadsheet output Excel,print percent setting not 100%,why?

    In version 10.1.2
    use desformat=spreadsheet output excel,
    Open the excel file,and print view,the print percent lower 100%,
    how to set report file,make output excel print view 100%?
    thanks for any help!
    lind

    Be sure you put the heading the same size as your column because otherwise it will not insert the diffent columns in seperate columns in excell

  • Smartforms output problem: printer commands are printed on paper

    Hi ,
    I have created a new page format ( 300 mm * 330 mm ) and i have assigned to a new format in the device type .But what command need to be changed in the printer initialization?
    At present when i print my sap script output it prints out the printer commands.
    Thanks and Regards,
    C.Abhinay

    closing

  • Send the output to printer on click of a button...

    I have tried several ways to do it, but have not receieved any success...
    requirement - create a button on read only oaf page, that would send the output to the assigned printer.
    Output should be like this : print only the filled fields and discard the fields with null values....
    Steps I took :
    - created rtf template, and registered in xml publisher , handled the code in CO to open it in pdf and then user can print it from there...
    it works for a few iterations but after 4-5 attempts it gives error pdf corrupt....
    - I also add seeded printable page button, but that errors out too because I have many VOs that need bind variables..
    what can I do to send the customized output to printer...
    one another way i can think of is create concurrent program and call the report from oaf page... but again i am not sure that after i spend so much time coding, that it would work and be a viable solution....
    I have been struggling with it for a long time now...any ideas please ...

    I have tried several ways to do it, but have not receieved any success...
    requirement - create a button on read only oaf page, that would send the output to the assigned printer.
    Output should be like this : print only the filled fields and discard the fields with null values....
    Steps I took :
    - created rtf template, and registered in xml publisher , handled the code in CO to open it in pdf and then user can print it from there...
    it works for a few iterations but after 4-5 attempts it gives error pdf corrupt....
    - I also add seeded printable page button, but that errors out too because I have many VOs that need bind variables..
    what can I do to send the customized output to printer...
    one another way i can think of is create concurrent program and call the report from oaf page... but again i am not sure that after i spend so much time coding, that it would work and be a viable solution....
    I have been struggling with it for a long time now...any ideas please ...

  • I want to dispaly the output through printer or fax or email

    i want to dispaly the output through printer or fax or email.
    the selection screen are
    SELECT-OPTIONS: S_MATNR FOR EKPO-MATNR OBLIGATORY.
    PARAMETERS:     P_RQNAME TYPE CHAR40,
                    P_LAND1 TYPE T005-LAND1 MEMORY ID LND MODIF ID LDS,
                    P_BUKRS TYPE T001-BUKRS MEMORY ID BUK OBLIGATORY,
                    P_SPRAS TYPE T002-SPRAS OBLIGATORY,
                    P_PRT_RB RADIOBUTTON GROUP GR1 DEFAULT 'X',
                    P_PRT_TX TYPE NAST-LDEST,
                    P_FAX_RB RADIOBUTTON GROUP GR1,
                    P_FAX_TX TYPE AD_FXNMBR1,
                    P_EML_RB RADIOBUTTON GROUP GR1,
                    P_EML_TX TYPE AD_SMTPADR.
    how can i write the logic

    For Printer Call FM GET_PRINT_PARAMETER.
    For EMAIL & FAX call FM SO_OBJECT_SEND.
    FM to send Email and FAX
    Regards,
    Amit

  • Report output to PRINTER

    I posted this in Application server forums. I didn't get any resolution for this.
    We migrated forms 6i application to 10g. Our apllication has three options for the report output.
    1. Output to preview
    2. Output directly to printer
    3. Output to file.
    I have couple of questions regarding the output to printer and file.
    1. Right now the application server uses the unix printer commands in /usr/bin to print. We need to print the report output from the application server with the printer commands in /opt/cups/bin instead of /usr/bin.
    How to do this?
    2. If the report output destination is set to FILE. Then the server generates and store the ouput in the default directory /exports/../.../../. How do I change the default destination location.
    Thanks,
    Vijay.

    Hello,
    1) Since, 9.0.2, Reports uses the script rwlpr.sh (OH/bin) to send the ouput to a printer when DESTYPE=PRINTER. If you want to change the executable used to print, modify this script
    2) When DESTYPE=FILE, it is possible to specify a "full path name " in DESNAME
    Regards

  • Unable to send report output to printer when using RUN_REPORT_OBJECT in 10g

    Hello All,
    When I try to send my report output to a file from my form(10g), I get 'FRM-41213: Unable to connect to report server'. I can sucessfully send my report to printer when I set the REPORT_DESTYPE to 'PRINTER'.Here is the code from my when-button-pressed trigger.
    Am I missing something?
    declare
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN                
    repid := find_report_object('PWRR_CTRL_TYP_MAINT');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_ipkcaf7vm');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,FILE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'DFLT');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,'C:\TEST1.doc');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
         LOOP
         rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
              msg_alert('Report print successfully', 'I', FALSE);
    ELSE
         msg_alert('Error when running report', 'I', FALSE);
    END IF;
    END;
    Thanks,
    Anna

    Hi,
    its because
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,'C:\TEST1.doc');
    references the report rdf pr rep file to run, not the output file. The Reports output file is always specified with DESNAME
    Frank

Maybe you are looking for

  • How do you make drop caps in Pages?

    Word has a drop down in the Format column that give you an ap to make drop caps... like at the beginning of a chapter. How do you do it in Pages?

  • Language services in Visual Studio-based application (isolated mode)

    Hello everybody, I'm developing a Visual Studio-based application in isolated mode (VS 2013). So far everything has gone smoothly, I have programmed some VSPackages, they manage their windows with their items, doing their things. The problem arising

  • Problem: scrollbar textarea

    Hi! I have the following problem: I want to add text to JTextArea box and I had created a scrollpane with vertical scroll bar. Also, I have a combobox. When I select one option of combo, it adds a brief explication about this option. When it adds thi

  • Canon 5D Mark 2  Raw Files wont import.

    My Friend has a Canon 5d Mark 2 and the files will not import. it says it's an unrecognized format. now when I shoot with my Canon rebel Xti in raw it will import them. does anybody know if apple will support the canon 5d mark 2 raw files in iPhoto?

  • FOR MTO & MTS scenario when the Production order shows the Sysy status DLV?

    Hi ALL, In the MTO & MTS  scenario when the Production order system status become DLV ? Regards Satish