Form 6i printing report directly to printer
Hi Professionals,
I am in badly need of help to print my barcode report directly to printer from form, currently it is working fine if i make it preview first and then user has to select network printer to print, but user is not accepting that manual step, and therefore we are unable to launch our material management module.
MY CURRENT CODE WHICH WORKING FINE WITH PREVIEW..................
add_parameter(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PREVIEW');
add_parameter(PL_ID, 'MAXIMIZE', TEXT_PARAMETER, 'YES');
add_parameter(pl_id,'paramform',TEXT_PARAMETER,'NO');
add_parameter(pl_id,'STR',TEXT_PARAMETER,:IM_STR_ISSUE_MASTER.STR_CODE);
add_parameter(pl_id,'BAT',TEXT_PARAMETER,:IM_STR_ISSUE_DETAILS.BAT_ID);
add_parameter(pl_id,'DIV',TEXT_PARAMETER,:IM_STR_ISSUE_DETAILS.GRP_CODE);
add_parameter(pl_id,'GRP',TEXT_PARAMETER,:IM_STR_ISSUE_DETAILS.SUB_GRP_CODE);
add_parameter(pl_id,'ITM',TEXT_PARAMETER,:IM_STR_ISSUE_DETAILS.ITEM_CODE);
add_parameter(pl_id,'COPIES',TEXT_PARAMETER,:IM_STR_ISSUE_DETAILS.QTY);
RUN_PRODUCT(REPORTS,'F:\IMS\REPORTS\STOCK_IN_BARCODE.rep',SYNCHRONOUS,RUNTIME,FILESYSTEM,PL_ID);
IF I CHANGE IT TO THE FOLLOWING FOR DIRECT PRINTING IT IS NOT WORKING
ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, 'SOLABEL');
I appreciate any efforts to resolve this issue.
Thanks
Ahon
Edited by: [email protected] on Oct 4, 2009 11:20 PM
Guide to Implement local printing on client in 10gas/9ias
To archive this goal we have used orarrp(Oracle Reports Remote Printing Utility), which can be downloaded from the OTN website http://otn.oracle.com/sample/products/reports/index.html.
Steps:
1.Add the required ORARRP mime types to the Oracle HTTP Server configuration.
(Note: This will be the Oracle HTTP Server belonging to the Oracle Application Server 10g/9ias middle (BI & Forms) tier)
Do this manually by editing the httpd.conf
or
via the Oracle Application Server 10g AS Console e.g.
Navigate to the Middle Tier Components Page
Click on HTTP_Server -> Administration -> MIME Types
NOTE: MIME types added in httpd.conf are as per requirement mode in which report has to be run e.g. pdf, rt(rtf) and html etc. syntax for manual entry in httpd.conf is given below.
AddType application/x-orarrp-text rrpt
AddType application/x-orarrp-ps rrpp
AddType application/x-orarrp-pdf rrpa
AddType application/x-orarrp-rt rrpr
AddType application/x-orarrp-ini rrpi
AddType application/x-orarrp-html rrph
2. Create an aliasmatch in forms.conf pointing to a physical directory \tmp- for example, directory will be c:\tmp
Do this by manually editing the forms.conf
or
via the Oracle Application Server 10g AS Console e.g.
Navigate to the Middle Tier Components Page
Click on HTTP_Server -> Administration -> Advanced Server Properties -> forms.conf
Add a line like :
# Virtual path for physical directory of temp
AliasMatch ^/tmp/(..*) "C:\tmp/$1"
** IMPORTANT NOTE **
The advantages of making the changes via EM / AS console, rather than editing the files manually, are:
- the EM / AS console will put the mime type entries in the correct place
- the EM / AS console automatically issues a 'dcmctl updateconfig' which synchronizes the file changes with the Infrastructure Metadata Repository
- the EM / AS console will do the required restart of the HTTP Server component
(Only the HTTP Server needs to be stopped and restarted – Oracle AS 10g components can remain up and running)
If the changes are made manually then the following commands must be issued after the changes to httpd.conf and forms.conf have been made.
Run these command at run prompt
DRIVE:\oracle\FRHome_1\dcm\bin\dcmctl.bat updateconfig -ct ohs -v -d
(to synchronize the changes with the Metadata Repository)
DRIVE:\oracle\FRHome_1\dcm\bin\dcmctl.bat stop -ct ohs -v -d
DRIVE:\oracle\FRHome_1\dcm\bin\dcmctl.bat start -ct ohs -v -d
where DRIVE: is the drive where \oracle\frhome_1\ is installed.
3. Copy and run orarrp.exe on client machine in program files\orarrp\ folder.
4. Set value of options '”choose_printer=no” in orarrp.ini created at above folder.
5. Add following lines in your code of run_report procedure.
In declare section
vc_file varchar2(225);
In begin block add
/* Generate a pseudo unique filename */
vcfile:=:global.user_code||to_char(sysdate,'YYYYMMDDHHMISS');
vcfile:=vcfile||'.rrpr';
/* In this example - output will be rtf so adding .rrpr extension */
set_report_object_property(repid, report_filename,store_var);
set_report_object_property(repid, report_server, :global.r_server);
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,'rtf');
set_report_object_property(repid,REPORT_DESNAME,'C:\tmp\'||vcFile);
---- path can be made dynamic by making a database entry in makess.path_entry for tmp folder and
---using proc_path procedure from path lib.
:GLOBAL.PrintOutPut := vcFile;
In Run report section make following change:
vc_reportserverjob := RUN_REPORT_OBJECT(repid,pi_id);
report_job_id:=substr(vc_reportserverjob,length(:global.r_server+2,length(vc_reportserverjob));
v_rep_status:=report_object_status(vc_reportserverjob);
if v_rep_status='FINISHED' then
web.show_document('/tmp/'||:global.printoutput,'_blank');
else
message ('error when running report'||v_rep_status);
end if;
Edited by: amitphynyl on Oct 5, 2009 1:36 AM
Similar Messages
-
Can not print report directly to printer.
Hi,
We are using Crystal Report Server for reporting in our project.
The version we are using is Crystal Report Server XI R2 and Crystal Report Server XI R2 SP 2.
Please kindly advice us on the following issues we faced:
- Can not print report directly to printer.
The print button on the Crystal Report Viewer prints the report to pdf and user have to click "Print" again in the pdf file. This is unusual and not convenient. As we have hundreds of reports to print, is there a way we can print the reporrt directly to printer?
- "Set to Null"
In the default interface of the Crystal Report View, there's is this "set to null" check box that we can not remove. Is there a way to do without it?
Thank you,
Kenny TewMorning Kenny,
The printer settings are in server management console. Additionally see what settings you have setup for the printer for the report in the server. If it is setup to use End User printer then check your End user machine settings and make sure the printer is setup as a default printer on his/her machine.
Please let us know how you get along with the issue.
As far as "Set to Null" I am not sure where it is set up. A screenshot of it might help understanding it better?
Many thanks
Regards
Jehanzeb
Edited by: Jehanzeb Navid on Oct 6, 2008 11:07 AM
Is this issue on all computers or only one computer?
I have just tested this on my colleague machine and it asks for default printer and not pdf however on mine I setup for pdf. -
Print report directly to printer using RUN_PRODUCT in Forms6i
Hi all,
I would like to have information regarding print any .rdf directly to printer from form 6i using RUN_PRODUCT.
I got help from Form Builder Help option and tried following coding in form
DECLARE
PL_ID PARAMLIST;
printername VARCHAR2(50);
BEGIN
PL_ID := GET_PARAMETER_LIST('WEIGHMENT');
IF NOT ID_NULL(PL_ID) THEN
DESTROY_PARAMETER_LIST(PL_ID);
END IF;
PL_ID := CREATE_PARAMETER_LIST('WEIGHMENT');
printername := '"'||'I.T Printer'||'"';
Add_Parameter(pl_id, 'DESTYPE', TEXT_PARAMETER, PRINTER);
Add_Parameter(pl_id, 'DESNAME', TEXT_PARAMETER, printername);
Add_Parameter(pl_id, 'P_EQ_NBR', TEXT_PARAMETER, :weighment.eq_nbr);
Add_Parameter(pl_id, 'P_WT_GKEY', TEXT_PARAMETER, :weighment.gkey);
Run_Product(REPORTS, 'c:\wegt001r', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
EXCEPTION
WHEN OTHERS THEN
MESSAGE(SQLERRM);
END;
END IF;
But report did not printed and following message received in Reports Background Engine
Error submitting report [Thu May 07 18:49:23 2009] ...
REP-0159: Syntax error on command line.
Pls help.
Thanks,
HassanHi Heidi
I have already tried printername := 'I.T Printer'; but result is same.
This is also my default printer and I tried to add / remove the following coding
Add_Parameter(pl_id, 'DESNAME', TEXT_PARAMETER, PRINTER);
but in both cased I received the same error.
I also tried to print thru HOST command as follows
the_username := Get_Application_Property(USERNAME);
the_password := Get_Application_Property(PASSWORD);
the_connect := Get_Application_Property(CONNECT_STRING);
the_command := 'rwrun60 report=c:\wegt001r.rdf userid= '||the_username||'/'||the_password||'@'||the_connect||' DESTYPE=Printer BACKGROUND=NO BATCH=YES ERRFILE=c:\reports\error.log LOGFILE=c:\reports\joblog.log p_eq_nbr='''||'TESTMKI'''||' p_wt_gkey=118306';
Host( the_command );
Host command displays correctly but no printing.
I then change my command as follows
the_command := 'rwrun60 report=c:\wegt001r.rdf userid=test/test@test DESTYPE=Printer BACKGROUND=NO BATCH=YES ERRFILE=c:\reports\error.log LOGFILE=c:\reports\joblog.log p_eq_nbr='''||'TESTMKI'''||' p_wt_gkey=118306'; and now report prints on printer.
But I cannot hard coded the username, password and connect.
Thanks,
Hassan
Edited by: Hassan Raza Khan Lodhi on May 7, 2009 6:55 PM -
Sample for printing report directly to printer
Hi Guys
Does anyone have a report which can print directly to the printer when the radio button option is selected .
I want to print the ALV in excel format.
Printer >>>>.
Screeb >>>>>
Regards
P.EslamHi
I tried with this FM but giving short dump error can anyone explain why pls see the below program for testing.
REPORT Z_ESLP_ZTCODE .
"LINE-SIZE 600 .
TABLES : AGR_TCODES,
AGR_USERS,
TSTCT.
type-pools: slis. "ALV Declarations
CONSTANTS MARK VALUE 'X'.
*Data Declaration
LIFNR, NAME1, STRAS, ORT01, REGIO, PSTLZ, PFACH, LAND1
TYPES: BEGIN OF T_DISP,
AGR_TCODES TYPE AGR_TCODES-TCODE , " Transaction code A
AGR_NAME TYPE AGR_TCODES-AGR_NAME, " Role Name B
AGR_UNAME TYPE AGR_USERS-UNAME, " Short User Name B
TTEXT TYPE TSTCT-TTEXT, " Description Name C
TEXTC TYPE USER_ADDR-NAME_TEXTC, " Long User Name
SPRSL TYPE TSTCT-SPRSL , " Language c
END OF t_disp.
DATA: it_disp TYPE STANDARD TABLE OF t_disp INITIAL SIZE 0,
wa_disp TYPE t_disp.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
DATA:L_PARAMS TYPE PRI_PARAMS,
L_VALID TYPE C.
DATA: w_file TYPE rlgrap-filename VALUE 'it_value'.
SELECTION PARAMETER CRITERIA
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: P_TCODE FOR AGR_TCODES-TCODE , "OBLIGATORY, "no-extension no intervals,
U_NAME FOR AGR_USERS-UNAME,
R_NAME FOR AGR_USERS-AGR_NAME .
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
SELECTION-SCREEN END OF BLOCK BLK2.
SELECTION-SCREEN END OF BLOCK BLK.
SELECTION-SCREEN BEGIN OF BLOCK radio WITH FRAME.
PARAMETERS :scr RADIOBUTTON GROUP rbg1 ,
pr RADIOBUTTON GROUP rbg1 .
SELECTION-SCREEN END OF BLOCK radio.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
fieldcatalog-fieldname = 'AGR_UNAME'.
fieldcatalog-seltext_m = 'User'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TEXTC'.
fieldcatalog-seltext_m = 'Name'.
fieldcatalog-outputlen = 50.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AGR_NAME'.
fieldcatalog-seltext_m = 'Role Name'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AGR_TCODES'.
fieldcatalog-seltext_m = 'Trans Code'.
fieldcatalog-col_pos = 3.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TTEXT'.
fieldcatalog-seltext_m = 'DESCRIPTION'.
fieldcatalog-outputlen = 40.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_disp
exceptions
program_error = 1
others = 2.
if sy-subrc EQ 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form lfa1 table and populate itab it_lfa1
form data_retrieval.
CASE MARK.
WHEN scr.
SELECT AGR_TCODESTCODE AGR_TCODESAGR_NAME AGR_USERSUNAME TSTCTTTEXT USER_ADDR~NAME_TEXTC
INTO TABLE IT_DISP
FROM AGR_TCODES
INNER JOIN AGR_USERS
ON AGR_TCODESAGR_NAME = AGR_USERSAGR_NAME
INNER JOIN USER_ADDR
ON AGR_USERSUNAME = USER_ADDRBNAME
INNER JOIN TSTCT
ON AGR_TCODESTCODE = TSTCTTCODE
where
agr_tcodes~tcode in p_tcode
and
agr_users~uname in u_name
and
agr_tcodes~agr_name in r_name
and
TSTCT~SPRSL EQ 'E'.
WHEN pr.
CALL FUNCTION 'FTBU_START_EXCEL'
EXPORTING
data_name = w_file
data_path_flag = 'T'
*---Start Excel and not Wait
wait = ' '
TABLES
data_tab = it_disp
EXCEPTIONS
no_batch = 1
excel_not_installed = 2
wrong_version = 3
internal_error = 4
invalid_type = 5
cancelled = 6
download_error = 7
OTHERS = 8.
NEW-PAGE PRINT ON PARAMETERS L_PARAMS NO DIALOG.
write : 'print'.
NEW-PAGE PRINT ON.
ENDCASE.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'Transaction codes by User and Role Name ' .
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_disp lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Transaction Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform. -
Print report directly to printer
I am using Crystal Reports XI R2 to generate reports in Powerbuilder. I want to know whether it is possible to print the report directly to a printer without displaying it in the Crystal Report viewer?
Thanks,
AmolI have a very similar problem, not being able to print a report directly to the printer.
But I am calling Crystal Reports v8.5 from VB6. I have tried the suggested code:
report.PrintOut(prompt user, numberofCopy, collated, startpage, endpage)
but get a "type mismatch" compiler error with "PrintOut" highlighted when compiling, eventhough the inline help shows this method and matching arguments.
I wonder if I have the correct DLL referenced.
This report runs fine thru the preview window, but since this is a series of reports about 100 pages, don't really want the user to have to specify print dozens of times.
Thanks,
Gene -
Print report directly to printer without acknowledgement
I'm running reports 9i.
I can successfully print a report directly to a printer but how do I stop a window poping up displaying the "Oracle Reports Job Status"
ThanksI have a very similar problem, not being able to print a report directly to the printer.
But I am calling Crystal Reports v8.5 from VB6. I have tried the suggested code:
report.PrintOut(prompt user, numberofCopy, collated, startpage, endpage)
but get a "type mismatch" compiler error with "PrintOut" highlighted when compiling, eventhough the inline help shows this method and matching arguments.
I wonder if I have the correct DLL referenced.
This report runs fine thru the preview window, but since this is a series of reports about 100 pages, don't really want the user to have to specify print dozens of times.
Thanks,
Gene -
Printing report directly on printer or pnly displaying based on a parameter
Hi All,
I am running a report from Form Builder - 10g and intend to either preview a report or print it based on a parameter.
Have searched through this forum and got to use - CLIENT_WIN_API_ENVIRONMENT.Read_Registry in order to find the default printer at the client side.
This is my code -
PROCEDURE RUN_REPORT_DN (cID_PRINT_TYPE NATURAL,cListName varchar2)
IS
pl_id paramlist;
v_rep_id report_object;
v_rep_job_id varchar2(100);
v_rep_status varchar2(100);
v_server varchar2(100) := hpm_admin.getcontrolvalue('REPORT_SERVER');
vjob_id VARCHAR2(100);
V_PRINTER varchar2(100);
p_printer_name varchar2(100);
BEGIN
-- check whether the paralist name is ok, if not set it right ...
pl_id := get_parameter_list(cListName);
-- pl_id := GET_REPORT_RUNMODE( cID_PRINT_TYPE,cListName );
V_PRINTER := CLIENT_WIN_API_ENVIRONMENT.READ_REGISTRY('HKEY_CURRENT_USER\software\Microsoft\Windows NT\CurrentVersion\Windows','Device',TRUE);
p_printer_name := (substr(V_PRINTER, 1, instr(V_PRINTER, ',' , 1)-1 ));
-- run the report ...
if not id_null(pl_id) then
v_rep_id := find_report_object('REPORT126');
if cID_PRINT_TYPE = 0 then ---- parameter to decide preview or print
set_report_object_property(v_rep_id,REPORT_DESTYPE,cache);
set_report_object_property(v_rep_id,REPORT_COMM_MODE,ASYNCHRONOUS);
Else
set_report_object_property(v_rep_id,REPORT_DESTYPE,PRINTER);
set_report_object_property(v_rep_id,REPORT_DESNAME,p_printer_name); set_report_object_property(v_rep_id,REPORT_COMM_MODE,SYNCHRONOUS);
end if;
set_report_object_property(v_rep_id,REPORT_DESFORMAT,'PDF');
set_report_object_property(v_rep_id,REPORT_SERVER,v_server);
v_rep_job_id := RUN_REPORT_OBJECT(v_rep_id,pl_id);
message('v_rep_job_id - '||v_rep_job_id);pause;
vjob_id := substr(v_rep_job_id, length(v_server)+2 , length(v_rep_job_id));
message('vjob_id - '||vjob_id);pause;
v_rep_status := REPORT_OBJECT_STATUS(v_rep_job_id);
if v_rep_status in ('FINISHED', 'RUNNING','OPENING_REPORT','ENQUEUED') then
web.show_document ('/reports/rwservlet/getjobid'||vjob_id ||'?server='|| v_server,'_blank');
else
message ('Report failed with error message '||v_rep_status,acknowledge);
end if;
end if;
END;
But I am getting the error - CLIENT_WIN_API_ENVIRONMENT.Read_Registry must be declared.
Wat setup/syntax is missing.
Can someone advise plz...Welcome to Oracle Forums!
Please acquaint yourself with the forum FAQ and etiquette if you have not already done so.
The use of CLIENT_XYZ API requires WEBUTIL to be configured. Have you done that?
Cheers. -
Printing report directly from printer
Hi,
I need a small information.if any one of our guys can give me some info that would be great.
I am writing a ABAP report now. lets say when we write 'hello world' in code and F8 program o/p will show 'hello world' right. I need to print this through user default printer automatically...might be pop-up for confirmation would help.
Thanks in advance...
RajHi Rich,
Calling program is
REPORT ZTESTRAJ1 .
parameters:p_date like sy-datum.
DATA: SELTAB TYPE TABLE OF RSPARAMS,
SELTAB_WA LIKE LINE OF SELTAB.
start-of-selection.
CLEAR SELTAB_WA.
MOVE: 'p_date' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
sy-datum TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
CLEAR SELTAB_WA.
MOVE: 'p_matnr' TO SELTAB_WA-SELNAME,
'P' TO SELTAB_WA-KIND, " PARAMETER
'1233344' TO SELTAB_WA-LOW.
APPEND SELTAB_WA TO SELTAB.
SUBMIT Ztestraj with p_date eq sy-datum
with p_uname eq sy-uname
with p_matnr eq '122333' and return.
if sy-subrc = 0.
write 'Printed'.
endif.
Here is the program Ztestraj
parameters:
p_matnr like mara-matnr,
p_date like sy-datum,
p_uname like sy-uname.
data: l_matnr like mcha-matnr.
start-of-selection.
l_matnr = p_matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = l_matnr
IMPORTING
OUTPUT = l_matnr
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE: L_MATNR.
DATA: PARAMS LIKE PRI_PARAMS,
DAYS(1) TYPE N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION = 'LOCL'
COPIES = COUNT
LIST_NAME = 'ZTESTRAJ'
LIST_TEXT = 'SUBMITTO SAP-SPOOL'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 80
LINE_COUNT = 120
LAYOUT = 'X_44_120'
SAP_COVER_PAGE = 'X'
COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
NO_DIALOG = 'X'
IMPORTING OUT_PARAMETERS = PARAMS
VALID = VALID.
IF VALID <> SPACE.
SUBMIT ztestraj TO SAP-SPOOL
SPOOL PARAMETERS PARAMS
WITHOUT SPOOL DYNPRO and return.
if sy-subrc = 0.
endif.
ENDIF. -
Printing Reports directly from to a printer via 10g forms (Linux)
Hi all,
I need to be able to print Reports directly from a form to a printer (bypassing the form output) on Linux (RHEL 5). The trick here is this is Linux, not windows so, wasn't sure how to deal with printers in this case.
I have the option working where I can run a report and set the options to "Cache" and PDF and it displays my outputted report directly in a new browser window w.
I use the SET_REPORT_OBJECT_PROPERTY, RUN_REPORT_OBJECT, and WEB.SHOW_DOCUMENT properly for the PDF in a window.
a.) I want to send them directly to a printer, preferably to a user's default printer on their PC, bypassing the output screen. How can I accomplish this?
b.) I also would like the ability to generate a PDF (bypassing the output on a browser window) and put the form in a specified directory on a client's PC (which is what I used in 6i Client/Server). I believe I need to utilitize the WebUtil to allow this to happen. Otherwise, I'm thinking I just build a queue for the user on the Linux server and build a screen that shows all the reports they've generated for the past X amount of days and let them open them up and print from there.
Any help (particulary for Part A) would be very beneficial.
Chris1)
if your app server is on a Linux server, for direct printing to work, the printer must be setup and accessible under Linux server using system-config-printer command, for PDF printout you probably want a postscript option checked
if you print to screen (PDF) and then use print option then your windows client machine must have access to the printer
2)
you must pass this printer name as part of the report parameters.
set_report_object_property(oRptObj, report_destype, Printer);
and
hidden_action := hidden_action ||'&report='|| cRptSrcFile; -- source of report program to call
hidden_action := hidden_action ||'&destype='|| cDesType;
hope this helps -
Error - Printing a report directly to printer
Hi,
i'm using oracle forms 9i and i'm trying to print a report directly to printer. I using the code above:
SET_REPORT_OBJECT_PROPERTY(ReportId,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(ReportId,REPORT_SERVER,GetReportTnsName);
IF ReportDesType = 'CACHE' THEN
SET_REPORT_OBJECT_PROPERTY(ReportId,REPORT_DESTYPE,CACHE);
ReportServerJob:=RUN_REPORT_OBJECT(ReportId, PList);
rep_status := report_object_status(ReportServerJob);
IF rep_status=âFINISHEDâ THEN
JobId := substr(ReportServerJob,length(GetReportTnsName)+2,length(ReportServerJob));
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'||JobId||'?server='||GetReportTnsName,'_blank');
ELSE
message ('Errorâ);
END IF;
-- logic for sending report directly to printer
ELSIF ReportDesType = 'PRINTER' then
SET_REPORT_OBJECT_PROPERTY(ReportId,REPORT_DESTYPE,PRINTER);
SET_REPORT_OBJECT_PROPERTY(ReportId,REPORT_DESNAME,:parameter.p_print);
ReportServerJob:=RUN_REPORT_OBJECT(ReportId, PList);
rep_status := report_object_status(ReportServerJob);
IF rep_status=âFINISHEDâ THEN
message ('Report sent to printer successfully');
ELSE
--handle errors
message ('Errorâ);
END IF;
end if ;
i get this error :
REP-50157: Erro no envio do ficheiro para a impressora lp65. Sair com o código de erro 64
NEED HELP !!
Regards,The printer has to be known on the server where the Reports service runs.
Also, the user who runs the Reports service has to have access to that printer. If you are running on Windows, Reports Service runs as Local system by default. Change that to a real (domain) user, who has access to the printer. -
How to print a report directly on printer
Hi,
anyone, plz help me in finding out, why my report i.e. i m sending directly to printer is getting printed like html codes?
Plz help asap.
Br,
Divya Alokplease check out the following link.
Print report directly
just mention the printer name i hope it helps u.
sarah
Edited by: QGIRCO on Apr 1, 2010 3:01 AM -
Print Report Direct from current PC
Hi
I want to print pre printed reports direct to dot matrix Printer without Concurrent Manager in requested PC ( Print from PC not from Server ) .
So , can i do that or not ?
Thanks,
Mohamed BadrIn general you have 2 options for printing.
1) print via the server printing queue
2) download/open the report and click the print button on your workstation
there is a 2 B option. If we are talking about a HTML based report you can modify the reports in such a way that you send a java script with it that starts the printing. However this is (A) not advisable and (B) somewhat experimental and not supported ;-)
If you want to know more about printing via javascript check this page: http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm
Regards,
Johan Louwers. -
Print report to client printer from forms
Hi,
I need to print a report directly to a client printer.
There is a utility called ORARRP - Oracle Reports Remote Printing Utility.
But the document I saw was from Oct 2001 - so is this still the only and best option ?
I'm using RUN_REPORT_OBJECT in forms to launch the report.
This works fine when the DESTYPE is FILE and DESNAME = PDF
The PDF-outputt is then successfully shown with WEB.SHOW_DOCUMENT
When changing DESTYPE to PRINTER and DESNAME to clients printername then report won't run. "Report filed with error message TERMINATED_WITH_ ERROR".
Is it possible to print directly to a client printer using RUN_REPORT_OBJECT ?
(Our client printers are not networkprinters)
Environment:
Forms [32 Bit] version 9.0.4.0.19
Report Builder 9.0.4.0.33
Reportsserver on linux
Thanks !
Sam(Our client printers are not networkprinters)This means you cannot print from the server directly on the client printer with destype=printer, since the server cannot see the printer.
So, a manual print command by the user from the browser or the orarrp utility are your options. -
Print reports directly in a local printer
Hello buddies,
Well, i wanna know if exists some way to print a reports directly in a local printer when using forms 9i ...
the procedure built-in "PRINT", open a dialog box to choose the printer to send the printscreen... maybe exists a way to make it for the reports...
thx a lot.
Regards,
PradoThis will work for you.
DECLARE
pl_id ParamList ;
Repid Report_Object ;
Rep_Status Varchar2(20) ;
Tag Varchar2(20) ;
BEGIN
:Global.Printer := '\\Pc Name\Printer Name';
-- printer_name is the name of the printer on your local machine
-- The printer should be a whole name like 'HPCOLOR6L'
-- The printer should be shared, and should not have blanks or other special chars
Pl_Id := Get_Parameter_List (Tag) ;
IF NOT Id_Null (Pl_Id) THEN
Destroy_Parameter_List (Pl_Id) ;
END IF ;
Pl_Id := Create_Parameter_List (tag) ;
add_parameter (Pl_Id , 'paramform' , Text_Parameter , 'NO') ;
Repid := Find_Report_Object('rep010_bpass') ; -- name of the report where it should be definded in the report section of the Oracle forms builder
Set_Report_Object_Property(Repid,REPORT_FILENAME,'Report path with report name') ;
Set_Report_Object_Property(Repid,REPORT_EXECUTION_MODE,RUNTIME) ;
Set_Report_Object_Property(Repid,REPORT_COMM_MODE,SYNCHRONOUS) ;
Set_Report_Object_Property(Repid,REPORT_DESTYPE,Printer) ;
Set_Report_Object_Property(Repid,REPORT_DESNAME,Global.Printer ) ;
Set_Report_Object_Property(Repid,REPORT_SERVER,'Report server name') ;
IF Rep_Status = 'FINISHED' THEN
NULL ;
ELSE
MESSAGE ('Error Running report ...') ;
MESSAGE ('Error Running report ...') ;
END IF ;
END ; -
Hello all:
In developer 6i i created a form with two buttons , one to run reports on the screen (P_RunReport('report_name','SCREEN'); )the other is to run reports directly to the printer (P_RunReport('report_name','printer');),
Now when i convert this form in developer 10g both buttons run reports on the screen,So how can i direct reports to printer within the same form?.
Thanks alot.I believe you'll be using Set_report_object somewhere in your code.
Shall you check exactly which value is going into that?
If you are sure that the value is going in is "SCREEN' or 'PRINTER', could you debug into the reports trace file?
That might help you.
Warm Regards,
Raja.
Maybe you are looking for
-
Computer not responding to video invitation
I have just purchased an iSight, am on a wireless broadband connection, and the camera works fine for preview on iChat. However when I am invited or invite another iChat user with iSight for video or audio chat, my screen says it is "starting" the vi
-
11g Cube not showing any data with no Rejected records
Hi David , Strangely one of my 11g Cube is not showing data from today as it is showing all records rejected . However when I lookup Rejected records table I didn't find any records .Not sure what is happening . When I want to peep out the AWM querie
-
Restrict on a "Date" type (key-figure)
Hello, all 1. I need to define a query, to compare the planed-date and the current-date(today), if planed-date>today, then in the new column, the firstday of the month will be listed (e.g. 1-12-2005). could you give me some suggestion, how can I foun
-
Function modules for logging in
anybody knows the function modules that are called when a user logs onto the abap engine ??? thanks
-
The function AirDrop on my Mac BookAir seems not to work, not detect my iPad. How to fix this?