Calling a Macro from APEX
Hi all,
after seeking on the forum and internet, I'm writing you my goal to see if you can guide/help me.
I'm using APEX 3.2 for uploading some excel sheets. After looking for info, we figured out that xls cannot be uploaded, so we asumed we need to upload the files in CSV format. The problem is that the user does not want to go every time they want to upload a file to "Save as...CSV", so we decided to do a macro in Excel that will change the format for him.
So, my goal is to run this macro from the APEX app right before the user uploads the file, the most invisible way for the user as possible.
The flow would be something like this:
Load the page of the application.
Run the macro from javascript maybe??
Change the format in local drive of the user, from XLS to CSV.
The user will use the file browser in the app and choose the CSV format from his local drive and upload it.
Has anyone have any ideas on how to do this? I have tried calling a batch from apex that creates a file, but I get a permission error, I guess because of security issues.
Thanks a lot!
You can NOT call an Excel macro directly from APEX.. Reason being the browser PROTECTS you from malicious code that COULD be run on your local machine this way..
Here is a Windows command script that your user can run, or you can setup to run every night for them.. Change the getfolder call with the proper directory..
Dim oFSO
Dim oShell, oExcel, oFile, oSheet
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
Set oExcel = CreateObject("Excel.Application")
oExcel.DisplayAlerts = False
For Each oFile In oFSO.GetFolder("C:\").Files
If LCase(oFSO.GetExtensionName(oFile)) = "xls" Then
With oExcel.Workbooks.Open(oFile, 0, True, , , , True, , , , False, , False)
For Each oSheet In .Worksheets
oSheet.SaveAs ".\" & oFile.Name & "." & oSheet.Name, 6
Next
.Close False, , False
End With
End If
Next
oExcel.Quit
oShell.Popup "Conversion complete", 10Thank you,
Tony Miller
Dallas, TX
Similar Messages
-
Regarding tutorial of how to call Oracle Reports from APEX
Hi,
I'm trying to call Oracle Reports from APEX using this tutorial.
http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
But in the step of 'Create the Oracle HTML DB Application', 'OE' doesn't appear in the LOV of Existing Schema, even though the sample schema exists in the schema and they are unlocked. And when I type 'OE' directly without using LOV, and press Next, the message 'Schema is reserved or restricted' appears.
How can I create the workspace based on OE schema?Hello Shohei,
I know your following the tutorial, but if you want to call oracle reports from apex it is quite easy though if your working with oracle reports 9i or higher. Just create an html region and put in the source the html code for referencing an url like to_report
Or reference the same url from a button placed on the HTML region
(you can create a package that would create the whole URL and returns it as a string, easier for scalability)
Hope this can help you to (tutorial is good but try and learn from scratch is also good ;-) )
Erwin -
How to call Oracle Reports from APEX
Dear All,
I am new to APEX. My first job assignment is "calling oracle reports from apex".
Can any one help me on this? Is there any online examples / tutorials from OTN site?
TIA.Hi Joe,
the how-to is still valid for APEX 3.0. Calling an Oracle Report from APEX is still the same, it's basically the URL you build for the report call and Oracle Reports hasn't changed that format.
Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/ -
Calling shell script from apex application
Please let me know if anyone has tried Calling shell script from apex application, it would be nice enough if you can share how you did it? Thanks
Hi,
Requirements
* CREATE JOB (10g Rel.1)
* CREATE EXTERNAL JOB (10g Rel.2 / 11g)
* EXECUTE on dbms_scheduler (granted to public by default)
Since Oracle 10.2.0.2 the commands are executed as user nobody.
Code:
--Create a Program for dbms_scheduler
exec DBMS_SCHEDULER.create_program('RDS2008','EXECUTABLE','c:\ WINDOWS\system32\cmd.exe /c echo 0wned >> c:\rds3.txt',0,TRUE);
--Create, execute and delete a Job for dbms_scheduler
exec DBMS_SCHEDULER.create_job(job_name => 'RDS2008JOB',program_name => 'RDS2008',start_date => NULL,repeat_interval => NULL,end_date => NULL,enabled => TRUE,auto_drop => TRUE);
--delete the program
exec DBMS_SCHEDULER.drop_program(PROGRAM_NAME => 'RDS2008');
--Purge the logfile for dbms_scheduler
exec DBMS_SCHEDULER.PURGE_LOG;
This is one way as suggested by Trent.
We can also achieve as follows.
http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm
Calling OS Commands from Plsql
I think the above solutions may useful to you.
Let me know if you are facing any problem.
Thanks and Regards
Maheswara -
Calling ASP script from APEX button passing Bind variable
I am looking for some examples or best form for calling asp script from apex button that will pass apex bind variable to asp script to process.
Thanks,s
BobI am surprised by the degree of no replies. I have solved this by using asp redirects such as:
Response.Redirect("test.aspx?UserName="&user)
My formulated solution contains a page with a manually built interactive report. I have a number of bind variables at the top of the reoprt where users can query the information they want based on desginated database columns for this particular report. Once they have the "manual" interactive report displaying what they want, they click a button where a asp script is called with parameters passed that calls a Java based Crystal Reports plugin with the called correspnding report displayed with passed parameters.
Works like a charm!
This solves our reporting needs without having to resort to Bi Publisher (much too expensive) and other third party applications that kinda indicate it can work with apex but provide limited help or best form for doing so.
Bob -
Calling Multi Template From Apex
I have a report in BI which has 2 templates (one for English, one for German).
I would like to call this report from 2 different buttons in Apex, one button for each template.
Any ideas please
GusYou can NOT call an Excel macro directly from APEX.. Reason being the browser PROTECTS you from malicious code that COULD be run on your local machine this way..
Here is a Windows command script that your user can run, or you can setup to run every night for them.. Change the getfolder call with the proper directory..
Dim oFSO
Dim oShell, oExcel, oFile, oSheet
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
Set oExcel = CreateObject("Excel.Application")
oExcel.DisplayAlerts = False
For Each oFile In oFSO.GetFolder("C:\").Files
If LCase(oFSO.GetExtensionName(oFile)) = "xls" Then
With oExcel.Workbooks.Open(oFile, 0, True, , , , True, , , , False, , False)
For Each oSheet In .Worksheets
oSheet.SaveAs ".\" & oFile.Name & "." & oSheet.Name, 6
Next
.Close False, , False
End With
End If
Next
oExcel.Quit
oShell.Popup "Conversion complete", 10Thank you,
Tony Miller
Dallas, TX -
I have posted this on the application express forum as well, not sure who will come up with the answer, so here is my question anyway.
I am trying to call the portal.wwsec_api from within an apex application. The application is parsed using the portal schema so has all the correct grants by default.
The code I am using is:
declare
l_person_rec wwsec_person%rowtype;
begin
l_person_rec := wwsec_api.person_info
p_user_name => 'PORTAL'
:P3_USER_INFO:=l_person_rec.user_name || l_person_rec.first_name;
exception
when others then
:p3_user_info:=sqlerrm;
end;
This code (minus the item references) runs fine in sqlplus, but errors when I run it in apex. I have narrowed it down to the api that is erroring as I can access the table direct.
Can anyone help with this?
ThanksI have now solved this problem. If you want to access portal apis from apex you need to set a portal context like this:
portal.wwctx_api_private.set_context( p_user_name => 'portal'
, p_password => 'portal');
This shouldn't impact security as the value of p_password does not have to be your schema password it can be set to anything. -
Calling existing pages from Apex
Hi,
I am working on Apex as a part of my in-house applications upgrade. At present, the intranet is written on javascript and html.
Is there a way that I can call the existing forms/reports / pages from Apex. I want to achieve that I need not re-write all the logics written, but embed already existing login into Apex screens.
Any help will be much appreciated.
Cheers,
JasSo, you effectively want to embed existing (presumably custom-made) reports within the apex environment - sort of like wrapping your existing intranet in an APEX front-end?
Well, for the relevant page/report, you could create an HTML region and maybe call your existing reports via ajax methods - it would require a bit of custom javascript to achieve though. Namely it would involve invoking your remote HTML page, return the resulting HTML output into your request object, then replacing the relevant elements in the DOM with this output.
I suppose if your particular reports were too fiendishly complicated to entirely re-implement in APEX, this would be the way to go, but I have a feeling that it will require a bit of work to get going properly, indeed you could also potentially lose out on some of the benefits of using APEX (or at least, you'd be stuck with this halfway house implementation forever).
Sorry to be quite general and high-level about this, but there isn't enough detail to work with. -
Hi,
I am working with apex 3.2 and I want to call web services from a page in application in apex.
and I do not have any idea about this topic,
any body can help me in this ??
Thanks and best regards.
Mohd.Hi,
I have for example this web service
(https://www.eclaimexpress.com/KEHClinics/TestCodingAlerts.asp?CMD=CROSSCODING&TYPE=CPT&TERM=icd9v1&CODE=13100), this link will return me xml as following
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <links>
<link href="/ws/codetype/icd9v1/172.5">172.5</link>
<link href="/ws/codetype/icd9v1/173.5">173.5</link>
<link href="/ws/codetype/icd9v1/198.2">198.2</link>
<link href="/ws/codetype/icd9v1/209.35">209.35</link>
<link href="/ws/codetype/icd9v1/209.75">209.75</link>
<link href="/ws/codetype/icd9v1/214.1">214.1</link>
<link href="/ws/codetype/icd9v1/216.5">216.5</link>
<link href="/ws/codetype/icd9v1/228.01">228.01</link>
<link href="/ws/codetype/icd9v1/232.5">232.5</link>
<link href="/ws/codetype/icd9v1/238.2">238.2</link>
<link href="/ws/codetype/icd9v1/448.1">448.1</link>
<link href="/ws/codetype/icd9v1/686.1">686.1</link>
<link href="/ws/codetype/icd9v1/701.1">701.1</link>
<link href="/ws/codetype/icd9v1/701.4">701.4</link>
<link href="/ws/codetype/icd9v1/701.5">701.5</link>
<link href="/ws/codetype/icd9v1/702.11">702.11</link>
<link href="/ws/codetype/icd9v1/702.19">702.19</link>
<link href="/ws/codetype/icd9v1/706.2">706.2</link>
<link href="/ws/codetype/icd9v1/709.1">709.1</link>
<link href="/ws/codetype/icd9v1/709.2">709.2</link>
<link href="/ws/codetype/icd9v1/709.4">709.4</link>
<link href="/ws/codetype/icd9v1/757.32">757.32</link>
<link href="/ws/codetype/icd9v1/875.0">875.0</link>
<link href="/ws/codetype/icd9v1/875.1">875.1</link>
<link href="/ws/codetype/icd9v1/877.0">877.0</link>
<link href="/ws/codetype/icd9v1/877.1">877.1</link>
<link href="/ws/codetype/icd9v1/879.0">879.0</link>
<link href="/ws/codetype/icd9v1/879.1">879.1</link>
<link href="/ws/codetype/icd9v1/879.2">879.2</link>
<link href="/ws/codetype/icd9v1/879.3">879.3</link>
<link href="/ws/codetype/icd9v1/879.4">879.4</link>
<link href="/ws/codetype/icd9v1/879.5">879.5</link>
<link href="/ws/codetype/icd9v1/879.6">879.6</link>
<link href="/ws/codetype/icd9v1/879.7">879.7</link>
<link href="/ws/codetype/icd9v1/879.8">879.8</link>
<link href="/ws/codetype/icd9v1/879.9">879.9</link>
<link href="/ws/codetype/icd9v1/880.00">880.00</link>
<link href="/ws/codetype/icd9v1/880.01">880.01</link>
<link href="/ws/codetype/icd9v1/880.09">880.09</link>
<link href="/ws/codetype/icd9v1/880.10">880.10</link>
<link href="/ws/codetype/icd9v1/880.11">880.11</link>
<link href="/ws/codetype/icd9v1/880.19">880.19</link>
<link href="/ws/codetype/icd9v1/906.0">906.0</link>
</links>
So now how can I call it in apex , and how can I return the results in report.??
Regards.
Mohd. -
Calling stored procedure from Apex
I am a total newbie at Apex so any help would be appreciated. My situation:
I created Apex app with few forms and reports. Since I want to implement security for some tables, example:
Table Employee has columns email and credit_card_num. These 2 columns are encrypted using DBMS_CRYPTO.
My Oracle Database version in Oracle XE 11g Release 2.
So I have stored procedure and package for encryption and decryption using dbms_crypto.
When I add new employee in APEX form email and credit card number are passed as plain text and saved on that way in database.
1. How can I make it to be saved as encrypted value using package and procedures I've created in the database (to parse the inserted value to function)?
2. Since I am a total dummy and newbie at Apex can anyone explain me how does Apex really work? Is the inserted data sent in plain text or encrypted over network?
Thank you84e45717-06df-499e-a789-5312b7434a74 wrote:
1. How can I make it to be saved as encrypted value using package and procedures I've created in the database (to parse the inserted value to function)?
You have a few options. You can create a Process (after submit process) that calls your code.
For example, if your form is on Page 2 and you're saving the EMP table your process could look like this:
begin
app_util.emp_save_secure(p_EMPNO => :P2_EMPNO
, p_ename => :P2_ENAME
, p_deptno => :P2_DEPTNO);
end;
Here of course app_util is your own package (with any name you want) and emp_save_secure is the procedure that will receive the params to save.
You could also use the APEX wizard to create a form on the Procedure then edit the code as you need. It would be almost the same result, but probably less typing and less typos.
2. Since I am a total dummy and newbie at Apex can anyone explain me how does Apex really work? Is the inserted data sent in plain text or encrypted over network?
Thank you
Like any web page, if your connection is done with HTTPS then the data from the browser to the webserver will be encrypted and that's all completely transparent to you. If your call is HTTP then it will be done in clear text.
To setup an SSL connection that uses HTTPS you'll need to create a certificate on the server and configure HTTPS. This is better done by a DBA that knows what they are doing.
Thanks
-Jorge
http://rimblas.com/blog/ -
Calling BI Publisher From Apex
Does anybody have an example of an URL that calls a pdf report in BI Publisher from an Apex button.
One parameter needs to be passed in the URL, which is a page item in Apex
Cheers
GusGus,
Please also take a look at our master-detail how-to document:
http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#PDF
This explains how to set session state prior to downloading the PDF, which is what you need if you want to "pass a parameter". So rather than actually passing a parameter in the URL, you would submit a form, set session state and then download the PDF - which to the end user would look and feel just like passing a parameter.
Regards,
Marc -
Calling SAP interface from APEX
Hi,
Our application is in APEX.(APEX & ORACLE 10G )
We have a requirement, where we need to fetch and update the data in SAP.
How can I do the above using APEX.
Thanks in advance...
Regards,
SreekanthSreekanth,
While I don't know the specifics, you should be able to call the SAP BAPIs from PL/SQL - in APEX, you can use a PL/SQL process to achieve this.
Thanks,
- Scott - -
Calling calc.exe from APEX
Hi,
I am wondering if there is any functionality(OS commands) which can be used to call local machine executables (like calc.exe for calculator, charmap.exe for character map, notepad.exe for notepad etc) from an APEX page.
Regards,
RakeshHello Rakesh ,
>> like calc.exe for calculator, charmap.exe for character map, notepad.exe for notepad etc
I don’t have direct answer to your question (although if you search this forum you’ll probably find one) however all the features you mentioned in your post can be implemented using built-in APEX items, e.g. ‘text field with calculator popup’ item or ‘HTML editor standard’ textarea item.
Regards,
Arie. -
Call iexplore.exe from apex page
I have a requirement to have a link from my main application apex page to invoke a client windows os command 'iexplore.exe -noframemerging' (I think this ie option used to be -nomerge). The idea is, this will fire up a separate IE8 session in a separate browser session, thus partitioning it from any other IE sessions. I know in IE8 there is a 'New Session' menu option but we need a link that is more obvious/integrated within our application. Our idea is to "persuade" users to click this link in preference to 'New Tab' or 'New Window' option.
Now, my quandary is how to do this. Should I be calling a Java Applet from the page (via Javascript) but is this "sand boxed" and thus will not let me call an executable for security reasons ?
Obviously I would also like to cater for users running Firefox (which I presume could detect in javascript and pass the browser type into the applet).
Is this sane, Is there any other way ?
Any advice would be appreciated or has someone already been down this road and could give me some pointers or an example.
Thanks in anticipation.Our corporate application already has calls to similar executables (ie MS Word, Excel) to do letter merges, document transfers etc using signed Java libs on the backend server. I suppose this requirement is different as I'm wanting to run an executable on the client pc. So, are we saying it is not possible to run an 'iexplore.exe' on the client PC (using a signed Java applet) ?
Edited by: theArrow on Apr 11, 2011 1:20 AM
Edited by: theArrow on Apr 11, 2011 4:52 AM -
How to call exe files from APEX
Hi all,
How to invoke or call some exe files like word or yahoo messenger from oracle apex ?
Apex 4.2.2
DB 11g
Thanks956320 wrote:
How to invoke or call some exe files like word or yahoo messenger from oracle apex ?
Apex 4.2.2
DB 11g
Apex is a set of PL/SQL suite of packages and procedures, with tables and so on. This code is called from a web server (e.g. Apache runing mod_plsql) via standard Oracle client-server. The code executes INSIDE the database. The codes creates a HTML buffer. This buffer is read by the web server component that made the call. And send to the web (browser) client.
That is first and foremost fundamental to understand about Apex.
Within this context - where is this executable file to be loaded, with which parameters, by whom, and where, to do what exactly?
Maybe you are looking for
-
Old Photos in my Collection can no longer be seen on My iPhone
I am using an iPhone 5S 32GB running on iOS 8 (latest update).When I am checking my collection of photos and I go to my oldest files these appear as black boxes and I cannot access them. I migrated on May to this iPhone and used iCloud for the backup
-
Hi, I want to create a visual webpart which will read data from excel sheet and import it in to sql server database.(using sharepoint development) I want to do it using visual webpart. Please help to solve the issue. Thanks in advance! Regards Rajni
-
I cant convert my itunes to mp3 so that i can have them on my laptop?
ive ttried converting to mp3 using the ways ive read about and nothing works. I just want to have them as an mp3 file so i can put them on my android tablet and on to a usb if i want to?
-
How can I reduce the size of some of the key apps likeTwitt Facebook, whatsup etc..I have a iphone 4s 7 GB?
-
Queue status no send or waitupda in SMQ1
Hi,all: Now our BW system can not do delta upload usually.I find some queue status nosend or waitupda in SMQ1 in source system(CRM). How to make them work usually? Can you give me some advices? Regaards&Thanks! zagory