Home » Developer & Programmer » Forms » Oracle Forms 12c : Print Report Directly (Oracle Forms 12c)
Oracle Forms 12c : Print Report Directly [message #655015] Thu, 18 August 2016 23:44 Go to next message
swap19
Messages: 11
Registered: October 2010
Location: India
Junior Member
Oracle Forms 12c & Oracle Reports 12c
Database : Oracle 12c

Question : How to print directly from oracle forms 12c without opening reports.
Re: Oracle Forms 12c : Print Report Directly [message #655021 is a reply to message #655015] Fri, 19 August 2016 01:42 Go to previous messageGo to next message
Littlefoot
Messages: 21612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Whoa, I didn't do that for ages; it was Forms 3.0 on OpenVMS so I'm pretty much sure you won't be able to use this code "as is", but it might give you an idea.

That form was used to (directly) print confirmation of payment, using matrix printer (Compuprint or Epson, in our case).

Form's trigger utilized the HOST built-in which called operating system's COM script (on Windows, that would be a .BAT script) which used printer's escape sequences in order to print directly to a printer.

This is the HOST command - it passes 6 parameters (form items or variables) to COM script (whose name is "izvedi_blagajna_compuprint"):
host('@izvedi_blagajna_compuprint ' ||
       to_char(:unos.rb_uplata, '990') || ' ' ||
       :unos.sifra_kupca || ' ' ||
       translate(to_char(:unos.iznos, '99,990.00'), ',.', '.,') 
       || ' ' ||
       poslovnica || ' ' ||
       to_char(:unos.datum, 'dd.mm.yyyy.') || ' ' ||
       operater,
       no_screen
    );

The COM script (I changed its extension to TXT) is attached to this message so that it preserves escape sequence characters (which are lost if I post it inline, in the message body). Just as an illustration, it looks like this:

/forum/fa/13234/0/

These are not literally written "ESC" letters but escape character. You'd have to read printer's specification & documentation in order to find correct escape sequences, as they differ from one printer to another.

"write sys$output" is "echo" on Windows; prints something on default system output device (screen in this case, on OpenVMS).

The script accepts 6 parameters (P1, P2, ..., P6) and prints them as specified.

Well, that's all I know about it. As you use Forms 12c (I don't use that version), things have probably changed much since version 3.0 so the final solution might (and probably does) differ from the above. However, that might be a starting point for you.
Re: Oracle Forms 12c : Print Report Directly [message #655026 is a reply to message #655021] Fri, 19 August 2016 02:14 Go to previous messageGo to next message
swap19
Messages: 11
Registered: October 2010
Location: India
Junior Member
Thanks for the reply Littlefoot.
@Experts,any other solution.
Re: Oracle Forms 12c : Print Report Directly [message #655142 is a reply to message #655026] Tue, 23 August 2016 01:38 Go to previous message
swap19
Messages: 11
Registered: October 2010
Location: India
Junior Member
Please suggest.
Previous Topic: Entering Error Log Into a Table
Next Topic: lov values shown again after clear_form
Goto Forum:
  


Current Time: Tue Oct 27 02:17:41 CDT 2020