OLE2: Calling Microsoft Word from Forms
I am writing an Forms application which requires me to be able to open a Word template file; then replace the bookmarks in the template with data from an oracle database; then to save and print the Word document.
I know I can do this using the OLE2 package, but I don't know how to. Does anyone know where I can find a good source of information showing actually how to do it, the standard Oracle documentation is syntax only, I could do with some example code, etc.
Thanks
Nik
Hi there,
You can take a look at the samples-forms. When you install Forms you can install demos too. One of those demo-forms shows how to use Forms and Word through OLE2. For ths source you can take a look within the FMB file.
Similar Messages
-
Invoking Microsoft Word from Java code
I want to invoke Microsoft word from Java code. How can i do this plz ............... Help
do something along these lines.... here is an example with notepad
create a .bat file with the commmand in to run notepad for example
notpad c:\test.txtthis command calls notepad and passes it the argument C:\test.txt which is the file and it's location, that I want to open.
The Java program
import java.util.*;
import java.io.*;
public class Run
public static void main(String args[])
try
//the name of the batch file with your commands in
String command ="runprog.bat";
//get the runtime
Runtime rt = Runtime.getRuntime();
//run the bat file
Process proc = rt.exec(command);
//wait for the program to exit i.e notepad then get the return code
int exitVal = proc.waitFor();
//print out the exit value
System.out.println(2THe Process exit value is: " + exitVal);
catch(Throwable t)
t.printStackTrace();
}have a look at this
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
and this
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html -
Hi,
I want to call a report from Form 6i at run time. And I write the following code in When Buttton Press trigger . when I press the button it will gives no response.
declare
x report_object;
y varchar2(100);
begin
x:=find_report_object('billform');
y:=run_report_object(x);
end;
for more information , path of my report is: C:\REP\billform.rdf
please send me the solution of this problem
E_mail: [email protected]
Shahzadhi,
now i am using the following code in when button press trigger. if u give me ur e_mail address i will send u FMB and RDF files used for Scott/tiger EMP table for the sample.
declare
repo_Para ParamList;
BEGIN
repo_Para:=Get_Parameter_List('Report_para');
IF not Id_null(repo_Para) THEN
destroy_parameter_list(repo_para);
end if;
repo_Para:=Create_Parameter_List('Report_para');
Add_Parameter(Repo_para,'PARAMFORM',TEXT_PARAMETER,'No');
Add_Parameter(Repo_para,'MAXIMIZE',TEXT_PARAMETER,'Yes');
Add_Parameter(Repo_para,'BDATE',TEXT_PARAMETER,:BLOCK3.a_dptno);
Add_Parameter(Repo_para,'EDATE',TEXT_PARAMETER,:BLOCK3.b_dptno);
RUN_PRODUCT(REPORTS,'c:\apu\DDATE.rep', SYNCHRONOUS,
runtime, FILESYSTEM,Repo_para,NULL);
end;
BDATE & EDATE are two user parameters created in report.
when i press the button in form pass parameters the report will be called but no data will be display but when i directly run reprot from report buider and pass same values of BDATE & EDATE it will show data.
please give me ur e mail address or help me for this problem
best regards,
shahzad -
I want to share Microsoft word from my desktop mac to my laptop but every timeIi try and do it, it says that it can't open because it is not supported by the software. I have tried several times and updated it on the mac but its still not working. Any ideas?
You need to install Office on the computer from the installer DVD or disc image you purchased.
-
CALLING A REPORT FROM FORMS (PROBLEM)
MY PROBLEM IS THE NEXT:
I CREATED A MASTER-DETAIL REPORT CALLING 'ASUNTOS'WITH THE NEXT QUERY:
SELECT ABOGADOS.APELLIDO_P,ABOGADOS.APELLIDO_M,ABOGADOS.NOMBRES,
ASUNTOS.EXP_INT,ASUNTOS.MATERIA,ASUNTOS.GERENCIA,
ASUNTOS.EMPRESA,ASUNTOS.RECLAMA,ASUNTOS.PESOS,
ASUNTOS.DOLARES
FROM ABOGADOS,ASUNTOS
WHERE ABOGADOS.FICHA = ASUNTOS.F_ABOG
AND ASUNTOS.F_ABOG = :ABOGADO ;
-- ABOGADO = PARAMETER.
THIS REPORT WORKS FINE THE PROBLEM IS WHEN I TRY CALL THIS REPORT FROM FORM I'VE USE A BUTTON(WHEN_BUTTON_PRESSED) WITH THE NEXT CODE:
DECLARE
LISTA PARAMLIST := GET_PARAMETER_LIST('ABOG');
BEGIN
IF ID_NULL(LISTA) THEN
LISTA := CREATE_PARAMETER_LIST('ABOG');
ADD_PARAMETER(LISTA,'DESTYPE',TEXT_PARAMETER,'PRINTER');
ADD_PARAMETER(LISTA,'DESNAME',TEXT_PARAMETER,'LPT2');
ADD_PARAMETER(LISTA,'ABOGADO',TEXT_PARAMETER,TO_CHAR(:ASUNTOS.F_ABOG));
-- ADD_PARAMETER(LISTA,'PARAMFORM',TEXT_PARAMETER,'YES');
END IF;
RUN_PRODUCT(REPORTS,'ASUNTOS',SYNCHRONOUS,RUNTIME,FILESYSTEM,LISTA,NULL);
END;
BUT THE REPORT NOTHING DISPLAY.
THERE ARE SOMETHING WRONG WITH THE CODE IN THE BUTTONRoberto,
Does your report work when it is not called from Forms?
try the following:
[TOOLS_HOME]\BIN\RWRUN60 module=ASUNTOS destype=screen userid=<username>/<password>@<tns> ABOGADO=<some_valid_code>
where TOOLS_HOME is the directory where Reports is installed.
I can see nothing wrong with your code.
Maybe some error in the query?
Also, I would check for the existence of multiple ASUNTOS report definitions. Maybe Forms is calling an older one.
Hope this helps,
Pedro das Neves
([email protected]) -
Calling a report from forms with a paramter form
Hello,
How do you call a report from forms and get it to display the parameter form. Where you can then call the report using this parameter form. I have been using paramform=yes. but it simply runs the form.
I saw on a a thread ages ago that this was a sample of this available for download. Is this true?
thanksHere is my code sorry about posting twice. Please note that the parameter list has been created as described.
report_id := find_report_object('MENU_REPORT_NODE');
Tool_Env.Getvar('ReportsServer', reports_server);
Tool_Env.Getvar('ReportsFolder', reports_folder);
dest_file := reports_folder || :global.username || '\' || rep_name || '.pdf';
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_FILENAME, rep_name);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_SERVER, reports_server);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_COMM_MODE, SYNCHRONOUS); -- wait for the report to finish
-- SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESNAME, dest_file);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESTYPE, cache);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESFORMAT, 'PDF');
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_OTHER, 'paramform=yes' || ' ' || 'mode=bitmap');
report_job := run_report_object(report_id); -
Calling SQL*Loader from Forms
Hi,
I was wondering if anyone has called SQL*Loader from Forms?
What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
Any ideas or guidance will be much appreciated.
Thanks,
Scott.Scott,
In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
What you have to do is :
1. Bult up the string exacltly in the fashion which you will run in o/s
2. Call the HOST Built-in and pass in the string
Here's a example :
Declare
lOsCmd Varchar2(1000) := Null;
Begin
lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
|| ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
|| ' bad = c:\temp\abc.log';
Host (lOsCmd, No_Screen);
End;
-- Shailender Mehta -- -
How to call a URL from forms ?
Dear All,
I would like to invoke / call a URL from forms. I know we can make a call Using Web.show_document. But this will execute in a browser.
What i need to do is, i have to send a request to by calling an URL, that should not visible to any body.
This is my requirement, please help if you know.
Thanks
Balajihi,
here is a quick example : (data from url returns as a clob. you need to write it at db. and call from forms.)
FUNCTION Get_DataFromUrl(pUrl IN VARCHAR2,pProxy IN VARCHAR2,pData IN OUT CLOB) RETURN NUMBER IS
vRcv UTL_HTTP.HTML_PIECES;
vData CLOB;
eNoDataReceived EXCEPTION;
BEGIN
UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(TRUE);
-- Get data pieces from Url
vRcv := UTL_HTTP.REQUEST_PIECES(pUrl,Proxy => pProxy);
IF vRcv.COUNT < 1 THEN
RAISE eNoDataReceived;
ELSE
-- Append varchar2 table data into clob variable
DBMS_LOB.CreateTemporary(vData,FALSE,DBMS_LOB.CALL);
FOR i IN 1..vRcv.COUNT LOOP
DBMS_LOB.WriteAppend(vData,LENGTH(vRcv(i)),vRcv(i));
END LOOP;
-- Copy local data into return variable
DBMS_LOB.Copy(pData,vData,DBMS_LOB.GetLength(vData));
DBMS_LOB.FreeTemporary(vData);
END IF;
RETURN SUCCESS;
EXCEPTION
WHEN eNoDataReceived THEN
RETURN FAILURE;
WHEN UTL_HTTP.INIT_FAILED THEN
RETURN FAILURE;
WHEN UTL_HTTP.Request_Failed THEN
RETURN FAILURE;
WHEN OTHERS THEN
RETURN FAILURE;
END Get_DataFromUrl;
hope this helps.
Engin. -
Calling Oracle graphics from forms
Dear friends,
My problem is that whenever i called a graph from forms
5.0 it give me error message that "PL/SQL evnivornment cannot
created"
Thanx
Faisal
nullHi friends,
I got the same problem and when I discussed with some one, he told me that it is a bug of forms 5.0 So when I used same code in forms 6.0 beta, it worked !
Nadeem -
Calling an EXE from Forms 4.5
How do i call a windows Exe from forms. Whats the exact syntax to do that? Code sample would help.
Thanks!Client/server mode calling an EXE from Forms 4.5
The following is a Foreign Function Interface that I employed to launch an outside program in its own asynchronous window. It was a great alternative to the HOST command.
The disadvantage to the HOST command was that the launched program would have to be closed before you could return to the form. With this method the the launched program
could be minimized etc. and you could switch back and forth between forms and it.
===============================================================
PACKAGE fp_winexec IS
FUNCTION run(p_cmd IN OUT VARCHAR2)
RETURN BOOLEAN;
END;
PACKAGE BODY fp_winexec IS
dll_handle ORA_FFI.LIBHANDLETYPE;
winexec_handle ORA_FFI.FUNCHANDLETYPE;
FUNCTION RunICD(
handle IN ORA_FFI.FUNCHANDLETYPE;
cmd IN OUT VARCHAR2;
disp_mode IN PLS_INTEGER)
RETURN PLS_INTEGER;
PRAGMA INTERFACE(C, RunICD, 11265);
FUNCTION run(p_cmd IN OUT VARCHAR2)
RETURN BOOLEAN IS
v_tmp PLS_INTEGER;
v_cmd VARCHAR2(2000) := p_cmd;
v_retval BOOLEAN := TRUE;
BEGIN
v_tmp := RunICD(winexec_handle, v_cmd, 1);
IF v_tmp = 2
THEN
MESSAGE('Cannot find '||v_cmd||' or one of its components);
v_retval := FALSE;
END IF;
return(v_retval);
END run;
BEGIN
dll_handle := ORA_FFI.REGISTER_LIBRARY
(NULL, 'krn386.exe');
winexec_handle := ORA_FFI.REGISTER_FUNCTION(dll_handle, 'WinExec', ORA_FFI.PASCAL_STD);
ORA_FFI.REGISTER_RETURN(winexec_handle, ORA_FFI.C_INT);
ORA_FFI.REGISTER_PARAMETER(winexec_handle, ORA_FFI.C_CHAR_PTR);
ORA_FFI_REGISTER_PARAMETER(winexec_handle, ORA_FFI.C_INT);
END;
====================================================================
-- To call the program from forms
DECLARE
v_retval BOOLEAN;
BEGIN
v_retval := fp_winexec.run(:control_block.program_to_run);
END; -
Calling MS Excel from Forms 6.0
Can somebody tell me in detail how to call MS Excel from Oracle Forms. I would like to create a button on a form and when the user clicks the button, MS Excel should open and I need to populate all the relevant data into Excel spreadsheet.
ThanksYou will probably have to use the OLE2 package. Take a look at the demo oleexcel.fmb which comes with Developer 6.0 for some ideas on how to start. You might also want to look at the documentation Oracle produced on this topic for Forms 4.5. It may be old, but I believe it is still relevant. See:
http://technet.oracle.com/products/developer/pdf/oleexcel.pdf
Good Luck!
Chris -
Call Oracle Reports from Forms ver 9i or 10g
Hi,
Can somebody guide me, how to call Oracle Reports from the Oracle form 9i,
Run_product is no more available into 9i & 10g, Run_report_object is not working with out put type "Screen" or "preview".
What is the best way to call the reports from the form ??? pls help...
Thanks in avdance.
Jitesh ([email protected])You can use RUN_REPORT_OBJECT with CACHE type, and WEB.SHOW_DOCUMENT to view the document on the screen.
In the Forms help you should find examples.
If you have access to Metalink, have a look at Note:207396.1. -
Calling a report from forms - FRM-40735 when-button-pressed raised unhandle
Hi,
I created a form to generate a pdf report.
its not going too well, so i need some help.
my form only has one button , when pressed I want it to generate a report in pdf format.
i created a when-button-pressed trigger and the following code is below:
I also create a web service proxy jar file,
the jar file is in the FORMS_BUILDER_CLASSPATH, and the jar file is imported from forms builder without any issues.
As of now I am hard coding everything in the code below to see if it works.
The error I am getting FRM-40735 when-button-pressed raised unhandled exception ORA-105100 i dont know why ?
This error is occurring at this line of code, please help, this is my first time doing something like this.
obj := publicreportserviceclient.new(); DECLARE
param_name varchar2(200);
un varchar2(200);
pw varchar2(200);
out_file varchar2(200);
obj ORA_JAVA.JOBJECT;
BEGIN
obj := publicreportserviceclient.new();
param_name := 'EMP';
un := 'Administrator';
pw := 'Oracle123';
out_file := 'D:\DevSuiteHome_1\j2ee\home\default-web-app'||'output';
publicreportserviceclient.callRunReport(obj,'/~administrator/Learn/Test1/Test1.xdo','EMP','141414',un,
pw,'pdf','New_Template',out_file);
web.show_document('http://jmenge-de.de.oracle.com:8889/j2ee/' || 'output');
exception
--check for ORA-105101
when ORA_JAVA.EXCEPTION_THROWN then
message('Java Exception : '
|| Exception_.toString(ORA_JAVA.LAST_EXCEPTION));
ORA_JAVA.CLEAR_EXCEPTION;
return;
--check for ORA-105100
when ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
return;
END;This is my java function
public void callRunReport (String reportPath, String paramName, String paramValue, String
username, String password, String format, String template, String outFile) {
try {
bip_webservice.proxy.PublicReportServiceClient myPort = new bip_webservice.proxy.PublicReportServiceClient();
// Calling runReport
ReportRequest repRequest = new ReportRequest();
repRequest.setReportAbsolutePath(reportPath);
repRequest.setAttributeTemplate(template);
repRequest.setAttributeFormat(format);
repRequest.setAttributeLocale("en-US");
repRequest.setSizeOfDataChunkDownload(-1);
ParamNameValue[] paramNameValue = new ParamNameValue[1];
paramNameValue[0] = new ParamNameValue();
paramNameValue[0].setName(paramName);
String[] values = new String[1];
values[0] = paramValue;
paramNameValue[0].setValues(values);
repRequest.setParameterNameValues(paramNameValue);
ReportResponse repResponse = new ReportResponse();
repResponse = myPort.runReport(repRequest,username,password);
byte[] baReport = repResponse.getReportBytes();
FileOutputStream fio = new FileOutputStream(outFile);
fio.write(baReport);
fio.close();
} catch (Exception ex) {
ex.printStackTrace();
}Thanks - please helpIf there is a way to make it work with Bi publisher, Please let me know.
I need to something to make it work with BI publisher.
thanks,
Edited by: Rooney on May 27, 2010 1:27 PM -
Calling a Report from Form in 10g
Hi all,
I am very new to Oracle Form builder, I wana to call a report from a Form.
we are using Oracle 10g Developer suit.
Can any body please help me regarding on this?
Regards
Tanmaya Pradhan(Tam)..or
Take a look at
Re: Run Report10g Through form 10g -
Hello
i have a problem with calling a report from a form.
i use the following statement in the when-button-pressed trigger:
Run_Product(REPORTS, report.rdf',ASYNCHRONOUS, RUNTIME,FILESYSTEM, '', null);
in the reports background engine i get the error
REP-0110: Unable to open file 'report.rdf'.
REP-1070: Error while opening or saving a document.
REP-0110: Unable to open file 'report.rdf'.
End report report [Mon Nov 25 12:30:40 2002].
the file report.rdf is in the same folder as the form calling it
where is the problem
thanks
MarjanHi Marjan,
The problem seems to be that the report is not in a directory
listed in the reports60_path. Add the directory into your reports60_path
and check if it solves the problem.
Best Regards
Chandra Mohan
Maybe you are looking for
-
Configure Logging VI start and stop without losing or dropping data
Hi there, I am currently using a M-series PCI-6280 and a counter card PCI-6601 to do measurements on Labview 2010. I have 3 tasks set up, 2 linear encoder counter tasks on the 6601 and 1 analog input task with 4 x inputs on my 6280. These are all t
-
BAPI_GOODSMVT_CREATE using A10 Place in Storage
Hello experts, I want to do MIGO using A10 Place in storage, and i put this parameters: goodsmvt_code = '04' ITENS t_saida-matnr TO t_bapiitem-material, t_saida-werks TO t_bapiitem-plant, t_saida-lgort TO t_bapiitem-stge_loc, t_saida_move_type
-
Knowing and Manipulating Blinking Caret Position inside a cell in Datagrid in AS3?
Hi, i've made a datagrid and wish to know position of blinking caret within a edited text cell in datagrid in AS3. I know there are some TextField properties available which allow manipulating/highlighting text based on user input. However, i'm unabl
-
AS 3 project swf compiled in flash builder(on mac) does not run on windows 7 machine
Hey there!! I have a as3 project that I'm building using flash builder 4.5. When I run or debug in FB it's fine, but when I move it to the windows 7 machine its going to live on nothing shows up. Not even the first function or any traces. I have trie
-
LR 4.2 will not send D600 NEF files to CS5 or CS6
LR 4.2 will not send D600 NEF files to CS5 or CS6 whenever I right click on the image and chose "Edit In"...is this a glitch that is to be fixed in the upcoming LR upgrade or is this something I can fix now? Converting to a jpeg or dng before I can e