Reference to HTP.P
Hello,
Where can I find some detailed description of HTP.P ? I looked at "PL/SQL Packages and Types Reference", saw an example using HTP.P but not any details on the function itself.
Thanks,
Arie.
Hello Ravikanth,
Thanks on your reply. Unfortunately, your link is to the entire HTP/HTF packages documentation. I already looked there, but didn't find any specific reference to HTP.P (although I agree this is the natural place to look
)
Any other references out there?
Thanks,
Arie.
Similar Messages
-
Hi,
I have to create HTML table with PLSQL variable as row entry from PLSQL package and send this as email.
Do we have any oracle package to send html email with Html code as Varchar from PLSQL package? Please provide me some example
Thanks
Senthil STwo packages ... HTP and HTF. Both documented and some demos here for HTP.
http://www.morganslibrary.org/reference/pkgs/htp.html -
Can someone tell me reference material for HTP, HTF, OWA packages
Hi,
I am a new developer. Will you please tell me some reference books or online help for Portal Development
niattiYou can find some in:
http://technet.oracle.com/doc/windows/was.21/psqlwtlk.htm -
Question about finding whether a reference number is NOT in the database?
Hello,
I use the following code to test whether the reference number is in the database
<ul><li>CURSOR cur_yellow</li></ul>
<ul><li>IS SELECT</li></ul>
<ul><li>REFERENCE_NO,</li></ul>
<ul><li>COMPANY_NAME</li></ul>
<ul><li>FROM CONSULTANTS;</li></ul>
<ul><li>rec_yellow cur_yellow%ROWTYPE;</li></ul>
<ul><li>BEGIN</li></ul>
<ul><li> OPEN cur_yellow;</li></ul>
<ul><li> LOOP</li></ul>
<ul><li> FETCH cur_yellow INTO rec_yellow;</li></ul>
<ul><li> EXIT WHEN cur_yellow%NOTFOUND;</li></ul>
<ul><li> IF ref_no = rec_yellow.REFERENCE_NO</li></ul>
<ul><li> THEN</li></ul>
HTP.print ('<ul><li><span class="style5">The information concerning the consultant selected has been deleted from the database.</span></li></ul>');
<ul><li> exp := 1; -- used to make code bullet proof</li></ul>
<ul><li> END IF;</li></ul>
<ul><li> END LOOP;</li></ul>
<ul><li> CLOSE cur_yellow;</li></ul>
Do you have any ideas for how to write code to test whether the reference number is NOT in the database.
Thanks
DougHallo,
in general, yes, but I think , it will be better without cursor:
declare
v_dummy number;
BEGIN
EXECUTE IMMEDIATE 'select 1 from dual where
exists (select 1 from user_indexes where index_name = : ind_name) USING ''DOUGLASMYINDEX'
INTO v_1;
-- something
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
Is it necessary to perform it in dynamic SQL ?
declare
v_dummy number;
BEGIN
select 1 into v_1 from dual where
exists (select 1 from user_indexes where index_name = ''DOUGLASMYINDEX''')
INTO v_1;
-- something
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
Regards
Dmytro Dekhtyaryuk -
Hello everybody,
I am working on uploading file from page to another one using HTP package, but whenever I submit the form, it only takes the filename without the full path.
for example :
if i sent 'c:\dir\a.txt' , the other page receives file parameter as 'a.txt'
the code is here
PROCEDURE upload(appno in varchar2,wsct in varchar2) AS
l_real_name VARCHAR2(1000);
BEGIN
HTP.htmlopen;
HTP.headopen;
HTP.title('Test Upload');
HTP.headclose;
HTP.bodyopen;
HTP.header(1, 'Test Upload');
HTP.print('<form action="https://ssltrng.uaeu.ac.ae/trng/document_api.upload1" method="get">');
HTP.print(' File to upload: <input type="file" name="file" >
HTP.print(' <input type="submit" value="Upload">');
HTP.print('</form>');
HTP.bodyclose;
HTP.htmlclose;
END upload;
the other page see it as
file is 'Water lilies.jpg'
Thanks
Edited by: dtabed on Mar 30, 2011 1:02 AMDo not understand the problem.
The code you've posted is a PL/SQL web enabled procedure that produces a dynamic HTML page. This page contains a form. And a full URL reference to the CGI that will process the form's data.
This is unusual - as it seems to be that the form is submitted across domains and web servers.. You usually refer to a local CGI procedure to deal with a form - no need for a fully qualified URL that includes web server and domain name.
If the CGI procedure that receives the form is also a PL/SQL web enabled procedure, that the uploaded file will be placed in the documents table (as defined in the DAD alias) by mod_plsql, prior to the web enabled procedure being called. The documents table will contain the Mime type, file name, file contents and other details. -
Reference images in stored procedures
I wasn't able to find the way to reference images uploaded in HTMLDB repository from a stored procedure (that use htp).
please can anybody help me?
Thanks
Francesco Galanteimages, files, and css's uploaded to the htmldb repository are referenced with the #WORKSPACE_IMAGES# substitution string. images uploaded into your workspace's repository that are associated with a specific app can be referenced with #APP_IMAGES#. we talked a bit about this at...
How do I refer uploaded images or css files in templates?
...and to reference those images in your stored procedures you'd simply use the V() syntax instead of that substitution string one. references like v('APP_IMAGES') and v('WORKSPACE_IMAGES') in commands like...
htp.p('<img src="'||v('WORKSPACE_IMAGES')||'my_image.jpg">');
...would do it.
hope this helps,
raj -
Trouble calling htp in a web service procedure
I have a procedure that I was calling directly within an APEX application that allowed the user to download XML files, as follows:
PROCEDURE download_my_file (
p_resid IN VARCHAR2
, p_filename VARCHAR2
, p_filter_str IN VARCHAR2 DEFAULT NULL
AS
v_mime VARCHAR2 (48) := NULL;
v_length NUMBER;
v_file_name VARCHAR2 (2000);
v_clob CLOB;
v_buf VARCHAR2 (32000);
v_amt NUMBER := 4000;
v_pos NUMBER := 1;
BEGIN
IF p_filter_str IS NULL
THEN
SELECT EXTRACT (VALUE (r), '/*').getclobval ()
, DBMS_LOB.getlength (EXTRACT (VALUE (r), '/*').getclobval ())
INTO v_clob
, v_length
FROM TABLE (XMLSEQUENCE ((SELECT xdburitype (any_path).getxml ()
FROM resource_view
WHERE resid = p_resid))) r;
ELSE
v_clob:= repos_datasets.dyn_dset_licensed_location_xml(p_filter_str=>p_filter_str);
v_length:=DBMS_LOB.getlength (v_clob);
END IF;
-- set up HTTP header
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Content-length: ' || v_length);
HTP.p ('Content-Disposition: attachment; filename="' || NVL(p_filename,'user_query.xml') || '"');
OWA_UTIL.http_header_close;
BEGIN
v_pos := 1;
LOOP
DBMS_LOB.READ (v_clob
, v_amt
, v_pos
, v_buf
v_pos := v_pos + v_amt;
HTP.prn (v_buf);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
END download_my_file;
The procedure works perfectly when a process calls the procedure directly from the database, however, I now have a requirement whereby this download facility needs to be accessed through a web-service: merely creating a web-service for the procedure and running it through a page process returns a 'ORA-06502: PL/SQL: numeric or value error' message. I assumed as APEX is a web environment that the htp package functions would use the session that APEX had started but obviously they are not.
How would I go about manually creating a session (I presume that's what's required) that would support the htp calls and allow the user to download the files exactly as they could with a direct call to the database procedure? I know it involves some initialization using the OWA package but this is alien territory for me, can anyone help at all?Has anyone come across a similar scenario? There are plenty examples of calling web-enabled procedures directly from APEX but I must call such a procedure through a web-service reference. Failing anyone having a similar problem, could someone explain to me how the Common Gateway interface variables are set when an APEX application calls a web enabled procedure?
I've included the code for the procedure I'm trying to run which I have altered to include CGI environment parameters: I'm getting these parameters by calling owa_util.get_cgi_env in the calling APEX application and passing the individual values to the procedure through the web service reference. I chose those variables I thought would tell the procedure where to return the HTML to but I'm just getting a blank page.
Anyone any suggestions? (code below)
PROCEDURE download_my_file (
p_resid IN VARCHAR2
, p_filename VARCHAR2
, p_filter_str IN VARCHAR2 DEFAULT 'sepa_region = ''North'''
,p_SERVER_PORT VARCHAR2
,p_SERVER_NAME VARCHAR2
,p_QUERY_STRING VARCHAR2
,p_HTTP_USER_AGENT VARCHAR2
,p_HTTP_HOST VARCHAR2
,p_HTTP_REFERER VARCHAR2
,p_DAD_NAME VARCHAR2
,p_REQUEST_CHARSET VARCHAR2
,p_HTTP_COOKIE VARCHAR2
AS
v_mime VARCHAR2 (48) := NULL;
v_length NUMBER;
v_file_name VARCHAR2 (2000);
v_clob CLOB;
v_buf VARCHAR2 (32000);
v_amt NUMBER := 4000;
v_pos NUMBER := 1;
namelist OWA.vc_arr;
valuelist OWA.vc_arr;
htpbuffer HTP.htbuf_arr;
bufrows INTEGER := 99999999;
rc INTEGER;
BEGIN
IF p_filter_str IS NULL
THEN
SELECT EXTRACT (VALUE (r), '/*').getclobval ()
, DBMS_LOB.getlength (EXTRACT (VALUE (r), '/*').getclobval ())
INTO v_clob
, v_length
FROM TABLE (XMLSEQUENCE ((SELECT xdburitype (any_path).getxml ()
FROM resource_view
WHERE resid = p_resid))) r;
ELSE
v_clob:= repos_datasets.dyn_dset_licensed_location_xml(p_filter_str=>p_filter_str);
v_length:=DBMS_LOB.getlength (v_clob);
END IF;
namelist (1) := 'SERVER_PORT';
namelist (2) := 'SERVER_NAME';
namelist (3) := 'QUERY_STRING';
namelist (4) := 'HTTP_USER_AGENT';
namelist (5) := 'HTTP_HOST';
namelist (6) := 'HTTP_REFERER';
namelist (7) := 'DAD_NAME';
namelist (8) := 'REQUEST_CHARSET';
namelist (9) := 'HTTP_COOKIE';
valuelist (1) := p_SERVER_PORT;
valuelist (2) := p_SERVER_NAME;
valuelist (3) := p_QUERY_STRING;
valuelist (4) := p_HTTP_USER_AGENT;
valuelist (5) := p_HTTP_HOST;
valuelist (6) := p_HTTP_REFERER;
valuelist (7) := p_DAD_NAME;
valuelist (8) := p_REQUEST_CHARSET;
valuelist (9) := p_HTTP_COOKIE;
-- initiliase OWA and configure a basic CGI environment
DBMS_SESSION.reset_package; reset PL/SQL PGA maintaining package state
rc := OWA.initialize;
OWA.init_cgi_env (9
, namelist
, valuelist
htp.showpage ();
-- set up HTTP header
-- use an NVL around the mime type and
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Content-length: ' || v_length);
HTP.p ('Content-Disposition: attachment; filename="' || NVL(p_filename,'user_query.xml') || '"');
OWA_UTIL.http_header_close;
owa_util.print_cgi_env;
--wpg_docload.download_file( v_clob );
BEGIN
v_pos := 1;
LOOP
DBMS_LOB.READ (v_clob
, v_amt
, v_pos
, v_buf
v_pos := v_pos + v_amt;
HTP.prn (v_buf);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
END;
Message was edited by:
user592383 -
Htp.p ability to find and replace
Is it possible, in a procedure to use htp.p() to write data, and then a few lines later remove it?
For example:
begin
htp.p(‘This is a test. [junk] This is only a test’);
- - - - - do something here so that [junk] would not be pushed to the browser
end;
My purpose for this is to create a <query> tag that I’ll use in psp pages. So I’ll be able to do this in a psp page:
<query name=”q1”>
select col from table where 1 = 1
<% if true then %>
and col = <%= bind(‘number’, 1) %>
<% end if %>
</query>
<%= materialize_query(‘q1’) %>
<table>
<% for z in (select * from q1) loop %>
<tr><td><%= z.col %></td></tr>
<% end loop; %>
</table>
I’m thinking of the mechanics of how to do it. Procedure materialize_query needs to look at the htp buffer and extract out the query string, then execute it. The bind function would store the bind information and return a “:b1”. I’m not sure how to manipulate the htp buffer.
Edited by: brian.mcginity on Feb 20, 2010 7:49 AM
Edited by: brian.mcginity on Feb 20, 2010 7:50 AM
making code readableThis is the direction I'm going here:
CREATE OR REPLACE package custom_tag is
buf clob;
inside boolean := false;
procedure savecontent(s boolean default false, e boolean default false);
procedure getContent;
end;
CREATE OR REPLACE package body custom_tag as
procedure savecontent(s boolean default false, e boolean default false) is
begin
if s then
buf := null;
inside := true;
end if;
if e then
inside := false;
end if;
end;
procedure getContent is
begin
htp.p_clob(buf);
end;
end;
CREATE OR REPLACE package htp is
htbuf_len int;
procedure prn(t varchar);
procedure p(t varchar);
procedure p_clob (z clob);
end;
CREATE OR REPLACE package body htp as
procedure prn(t varchar) is
begin
if custom_tag.inside then
custom_tag.buf := concat(custom_tag.buf, t);
else
sys.htp.prn(t);
end if;
end;
procedure p_clob (z clob) is
v_read_amount integer := 32767;
v_read_offset integer := 1;
v_buffer varchar2(32767);
begin
begin
loop
dbms_lob.read(z,v_read_amount,v_read_offset,v_buffer);
sys.htp.prn(v_buffer);
v_read_offset := v_read_offset + v_read_amount;
v_read_amount := 32767;
end loop;
exception
when no_data_found then
null;
end;
exception
when others then
raise; --null; --showHTMLdoc(p_id);
end;
procedure p(t varchar) is
begin
sys.htp.prn(t);
end;
end;
/Next save this as test.psp:
<%@ page language="PL/SQL"%>
<html>
<head><title>Test</title></head>
<body>
<h1>This is a test</h1>
<% custom_tag.savecontent(s=>true); %>
This content is saved for later use
<% custom_tag.savecontent(e=>true); %>
data..data..data..
<h3><% custom_tag.getcontent; %></h3>
</body>
</html>Now compile test.psp in dos with this:
loadpsp -replace -user scott/tiger@thedb test.psp
Then point your web broswser at test.
This is a the start of what I’m after. I would like to create a handful of tags to help with a few things.
Making a query tag custom tag will be challenging.
I have to figure out a way (if it’s possible) to take a query string and somehow be able to loop through the record set and reference the columns queried. Somehow do this without declaring a type or into variables.
Edited by: brian.mcginity on Feb 23, 2010 9:27 PM
Edited by: brian.mcginity on Feb 23, 2010 9:28 PM
Edited by: brian.mcginity on Feb 23, 2010 9:30 PM
Edited by: brian.mcginity on Feb 23, 2010 9:35 PM .... long day need some sleep :)
Edited by: brian.mcginity on Feb 23, 2010 9:40 PM -
Cascading style sheets with htp procedures and functions
I'm new to style sheets. I currently build dynamic web pages with database procedures using htp/htf. Can someone tell me how to use style sheets with this functionality.
ThanksThis is a good point to start learning about css:
http://www.htmlhelp.com/reference/css/ -
Error in VBA reference for Adobe Photoshop CS4 Object Library
Hello,
I'm using Windows 7 Pro, MS Office 2010 Pro and Creative Suite CS4 (with all updates).
I will automate Photoshop via Visual Basic for Applications in MS Access.
Befor using there the Adobe Photoshop CS4 Object Library I must reference it in VBA.
But when I will du this, I get the message "Error loading DLL".
When I will manually reference to the WIASupport.8LI File, I get the error: "Cannot reference this file"
Can you give a tip, how I can solve this problem?
RegardsI have the same problem! I have photoshop cc2014 (which we own) and the object library shows, but not for cs 5.1 (30 day trial).
Does registering unlock something?
Help please!! -
I am working on a standalone install Sharepoint 2013 (no Active Directory). I found newsfeed feature is not available and checked Distributed Cache service is stopped. When start it “cacheHostInfo is null” is returned.
I checked the Windows service “AppFabric caching service” is stopped because the default identity “Network Service” not work. Then I change the AppFabric service identity to use “.\administrator” (which is also the sp farm administrator) and the service can
be started.
However the “cacheHostInfo is null” when try to start Distributed Cache service in central admin.
I searched on web and found this blog: http://rakatechblog.wordpress.com/2013/02/04/sharepoint-2013-spdistributedcacheserviceinstance-cachehostinfo-is-null/
I tried to run the script but it return error:
Add-SPDistributedCacheServiceInstance : Object reference not set to an
instance of an object.
At C:\root\ps\test.ps1:8 char:13
+ $whatever = Add-SPDistributedCacheServiceInstance
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share…ServiceInstance:
SPCmdletAddDist…ServiceInstance) [Add-SPDistributedCacheServiceInstance]
, NullReferenceException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddDistr
ibutedCacheServiceInstance
I am not sure what went wrong. Please give me some idea? Thank you for any comment!Can you deploy Active Directory as installing without is not a supported installation scenario - http://support.microsoft.com/kb/2764086.
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
Cross Reference Source text options
Creating a Cross Reference linking to a Paragraph. In the paragraph where the cross-reference source is inserted, may the cross-reference link be applied to existing text in that paragraph so that the cross-reference destination text does not appear? Text anchors can be created to accomplish this, but that is an extra step (I can create a cross reference linking to a paragraph all in one dialog box). Thanks in advance for any suggestions.
Hi, Seir:
I agree that it's confusing. Here's how I do it:
To create a text anchor at the insertion point location:
* Open the Hyperlinks/Cross-References panel's menu (also called "flyout menu." It's the small icon at the upper-right of the panel, below the double-arrow (>>) icon that collapses the panel.
* Choose New Hyperlink Destination. THIS SHOULD BE NAMED NEW TEXT ANCHOR!!!
* Choose Type: Text Anchor
* Name the anchor as you like Click OK.
To create a cross-reference to a text anchor:
* Place the insertion point where you want it.
* Click the Create new Cross-Reference button on the bottom of the Hyperlinks/Cross-Reference panel.
* Choose Link To: Text Anchor
* Choose the target document
* Choose the text anchor
* Choose the Cross-Reference format
* Choose Appearance properties
* Click OK
I'm not sure what could cause the straight/curly quotes problem other than perhaps the font doesn't have curly quotes. Have you tried other fonts?
HTH
Regards,
Peter Gold
KnowHow ProServices -
Hi all,
I'm trying to make a package of Vis to easily make Excel reports with Signal Express. I'm working on LabVIEW 8.2.1.
I'm using the report generation toolkit, so I build a .llb from my project which contains all the hierarchy of my steps, but also the hierarchy of dynamic VIs called.
I have made some steps, like "Open Workbook", "Write Data", etc.
My steps run well, excepts one step : "Close Workbook".
If my "Close Workbook" step is firing on "Run" Signal Express event, I have no error, so my reference is properly closed.
But if my "Close Workbook" step is firing on "Stop" Signal Express event, I have an error "1", from "Generate Report Objectrepository.vi".
I feel that I'm trying to use a reference which has been killed in the "Stop" step...
I would like to know what exactly do Signal Express on "Stop" event and why my close function does'nt run well.
Thanks,
CallahanHi Callahan,
SignalExpress (SE for short) does the following on the Stop event:
1. Takes the list of parameters that SE found on your VI's connector pane, and sets the values that the user set from the "Run LabVIEW VI" configuration page, if any.
2. Then tells the VI that SE is running the Stop event by setting the Enum found on your VI's front panel. This in turn should produce some boolean values telling your VI to execute the Stop case.
3. The VI is then run, with those values and states.
4. SE checks to see if any errors where returned.
5. Since this is the Stop event, SE releases the reference to the VI which it possesses.
Questions for you would be, is the reference to your Workbook linked to a control on your connector pane, or held in a uninitialized Shift Register. If it's held in a Shift Register, SE would not be aware of it, and would not be able to affect that reference.
Hope that helps. Feel free to post your LLB if it doesn't.
Phil -
Excel Get ActiveX References​.vi and closing references -- grrr
I'm new to ActiveX stuff, but eager to learn!
The "grrr" in my Subject line is a reference to how I feel about LabVIEW's documentation from time to time. I'm a dinosaur who came from text-based programming, and did a fair amount of C coding, so sometimes with LabVIEW I'm left with this awful feeling in the pit of my stomach like, "Good grief! How much memory must LabVIEW be hogging up in the background when I use this vi?" or "What happens to those variables (wires) in that subVI when it completes but doesn't close? What are their statuses when I come back in the next time?" or "What if I put a lot of elements into that array the first time and then started from element zero the second time and just put in a few? What has happened with the memroy that was allocated when there were a lot of elements?"
Today I'm stewing about this "Excel Get ActiveX References.vi," and what happens to the "ActiveX references" it generates each time I call the subVI in which "Excel Get ActiveX References.vi" lives. I think that at least one of the "ActiveX references" it generates when I call it is of the type Excel._Application. Then there appears to be an Excel._Workbook, and others. You see, I've used "Excel Easy Report.vi" to put some data into an Excel spreadsheet, and I want to tell Excel to do a "Save" on the open spreadsheet. I think ActiveX is the (a) right way to do that, so I'm wading into the ActiveX fray... But this "Excel Get ActiveX References.vi" says in its help file, "Do not close ActiveX references opened with the Excel Get ActiveX References VI. References must remain open until the report is closed. Otherwise the error 3001 will occur." Well, these Excel workbooks that get created by my VI could well stay open until after my LabVIEW VI terminates!
So (finally), here are some of my quesitons:
1) When I go through my subVI once, pointing to one workbook, I'll get one set of references "created" or "opened" or whatever you call it when ActiveX references spring into existance. Now, when I exit the subVI, is it going to automatically try to "close" those ActiveX references? I don't suppose so, since subVI's stay in memory until the calling VI closes.
2) Now, I come back into my subVI a second time. New workbook gets created, so I get new references. Ok, fine. Uh oh! What happened to those old references? I suppose that if I didn't somehow save them off, I've probably lost the ability to get them back (maybe I'm wrong, but I don't need them back), but is LabVIEW going to "close" those old references (from previous times through the subVI) because I can't get to them anymore? Won't that cause the dreaded error 3001? If LabVIEW is not going to "close" them, what in tarnation happens to them (the old C programmer in me creeping back out)?? Now it's some oddball, orphaned reference, floating out there, hogging memory, waiting to make something crash intermittently and be a debugging nightmare?
3) Now, here's the real scary one. I think I might dodge the "error 3001" bullet in questions 1) and 2), but now let's say the user closes my LabVIEW application while Excel is still open. All those workbooks are still open. Presumably, all those ActiveX references I was not supposed to close are still open. I really hope that LabVIEW is decent enough to close/erase/delete/blow-away (whatever the right word is) all those ActiveX references which were opened/created by "Excel Get ActiveX References.vi" when my program terminates. But, oh no! Won't the error 3001 come along then? I suppose I can just dump it in the shutdown error handling.
Well, thanks for reading my novel. I don't know what can be done with LabVIEW documentation to make it more satisfying to folks like me, but perhaps someone can weigh in on all my ActiveX questions here.
Thank you in advance,
Steve Brady
Solved!
Go to Solution.You need to close EVERY ActiveX reference you open. If you don't you'll end up with some Excel processes running even after LabVIEW exits. You can see them in Task Manager.
I, personally, don't like the LabVIEW Report Generation Tool Kit for working with Excel. I don't think it's flexible enough. I have a growing library of VIs that I've written that open, manipulate, and close Excel. Some references I pass from VI to VI and some I close right after I use them. It all depends on what I'm doing. If I want to enter read or write data from/to a certain range I'll get the range reference, read or write the data, then close it right away because I have no use for it any more. On the other hand, when I open Excel or a Workbook I keep the reference until I'm done, which could be later in the program.
1) When I go through my subVI once, pointing to one workbook, I'll get one set of references "created" or "opened" or whatever you call it when ActiveX references spring into existence. Now, when I exit the subVI, is it going to automatically try to "close" those ActiveX references? I don't suppose so, since subVI's stay in memory until the calling VI closes.
2) Now, I come back into my subVI a second time. New workbook gets created, so I get new references. Ok, fine. Uh oh! What happened to those old references? I suppose that if I didn't somehow save them off, I've probably lost the ability to get them back (maybe I'm wrong, but I don't need them back), but is LabVIEW going to "close" those old references (from previous times through the subVI) because I can't get to them anymore? Won't that cause the dreaded error 3001? If LabVIEW is not going to "close" them, what in tarnation happens to them (the old C programmer in me creeping back out)?? Now it's some oddball, orphaned reference, floating out there, hogging memory, waiting to make something crash intermittently and be a debugging nightmare?
3) Now, here's the real scary one. I think I might dodge the "error 3001" bullet in questions 1) and 2), but now let's say the user closes my LabVIEW application while Excel is still open. All those workbooks are still open. Presumably, all those ActiveX references I was not supposed to close are still open. I really hope that LabVIEW is decent enough to close/erase/delete/blow-away (whatever the right word is) all those ActiveX references which were opened/created by "Excel Get ActiveX References.vi" when my program terminates. But, oh no! Won't the error 3001 come along then? I suppose I can just dump it in the shutdown error handling.
1) No, LabVIEW will NOT close those references. You need to make sure that happens.
2) You can save the references in a functional global or use a class but if you're not going to save them close them as soon as you're done with them.
3) Your user should not be able to close your LabVIEW application without it going through the shutdown routine you've created for your program. The ABORT button should never be exposed to the user and you should capture and discard the panel close event so your program ALWAYS shuts down is an orderly fashion. If you don't you will have fragments of Excel hanging around in your operating system and will have to kill those processes using Task Manager. That should only be a problem during development, not once deployed.
I used to program in C and Assembly many moons ago. You should have seen my first LabVIEW code. I go back and look at it just so I can see how far I've come in the last 12 years. I feel your pain.
Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome -
Error 7 occurred at open vi reference in New Report.VI
Hello!
I use the report generation toolkit on LabView 7.0 to create a report in Excel. The program works fine until I make an executable version. I the get the error:
Error 7 occurred at open vi reference in New Report.VI
I use the New Report.VI, Bring Excel to front.VI and Save Report To File.vi
Can you pleace help me!!!Most likely, you did not include the required libraries in your build script. When building an executable in which you use the Report Generation Toolkit, you must include the _Word Dynamic VIs.vi from _wordsub.llb and _Excel Dynamic VIs.vi from _exclsub.llb as dynamic VIs on the Source Files tab.
Check this article for more info.
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/86256a47004e16d186256a84004cb883?OpenDocument
Daniel L. Press
PrimeTest Corp.
www.primetest.com
Maybe you are looking for
-
I already have Photoshop, through my CC account, and now looking into buying Edge Reflow. I just can't figure out how much it costs, or even how to purchase. All the links i follow, to purchase, take me to a plan overview, with products that i don't
-
My iphone 5 is eating all my data on ATT
I bout a new iPhone 5, and it has been eating up all my data. I have all my apps on a manual fetch. I am on wifi all the time My usage history shows huge amounts of data sent from my phone at midnight every day .. like 100 to 200 MB. What should I do
-
Greetings Oracle gurus! Problem: I'm trying to write a query that does some data pivoting. I've done this before in the past on smaller data sets, and they've worked great. However, now I'm doing it against a table that has well over a million record
-
BUG!: JDeveloper 11g Tutorial code is incomplete.
I am attempting the complete the JDeveloper 11g Tutorial from the Fusion Developer's Guide for Oracle Application Development Framework After adding all the latest jars available from the ADF Installer to the StoreFrontModule I am left with 10 errors
-
How to make an HTTP request via SSL
Hi, I´m using an instance of the class CL_HTTP_CLIENT to make an HTTP request to a https server. as long as it requires an SSL authentication, it returns an ICM_HTTP_SSL_ERROR error message. How do I tell my program to ask for user´s certificate, and