Scott Lamond
asked on
Adding Code to VB HTML Output
We have Scheduled Tasks that run every 15 minutes to update our Intranet reports, giving our employees one-click access to HTML reports.
Using the following VB code in an Access form's Open Event procedure:
DoCmd.OutputTo acOutputReport, "rptOEDailyOrdersTaken", acFormatHTML, "\\bordenfp\intranet\repor ts\qryOEDa ilyOrdersT aken.htm", True
Is it possible to add code such as the following to force this page to auto-refresh?
<meta http-equiv="refresh" content="5">
Using the following VB code in an Access form's Open Event procedure:
DoCmd.OutputTo acOutputReport, "rptOEDailyOrdersTaken", acFormatHTML, "\\bordenfp\intranet\repor
Is it possible to add code such as the following to force this page to auto-refresh?
<meta http-equiv="refresh" content="5">
<meta http-equiv="refresh" content="5"> means every 5 seconds. That could be a lot of network traffic plus that's a pretty short time to view a page.
Not without trying to code access to open the HTML and Add it manually. It may or may not be possible in your environment but I would serve these HTML files via a webserver and server side script like php. It opens up a lot more possibilities as you can read the requested report and embed it in a page that refreshes as often as you need.
Another simple solution would be to use an iframe. Create a "wrapper" page for each report that just has the basic HTML layout with your meta refresh tag but also an iframe in the body of the HTML with its src attribute pointing to the HTML report.
Make sense?
Another simple solution would be to use an iframe. Create a "wrapper" page for each report that just has the basic HTML layout with your meta refresh tag but also an iframe in the body of the HTML with its src attribute pointing to the HTML report.
Make sense?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I suggest using your vb code to dynamically generate the html file http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.filesystem.writeline(v=vs.110).aspx
Now when you use javascript to refresh the page, you are not taxing the db. You just want to keep in mind how often the refresh will happen at one time. Do you have 100 people using this or 1000?
Now when you use javascript to refresh the page, you are not taxing the db. You just want to keep in mind how often the refresh will happen at one time. Do you have 100 people using this or 1000?
slamond,
You said: "We have Scheduled Tasks that run every 15 minutes to update our Intranet reports"
Having a refresh rate must faster than 15 minutes would be a lot of wasted trips to get the same web page. A 5 second refresh means there are 180 refreshes between each 15 minute scheduled task run. I would start with a refresh of 300 second or longer to see if that works.
If it were my project I would go with tagit's suggestion of a wrapper page. Very simple to do.
I would have the wrapper page be named qryOEDailyOrdersTaken.htm. I would update the Access app to output to the file to a new name. Something like: qryOEDailyOrdersTaken_data .htm. Have the wrapper page show this file.
By having the wrapper page use the original file name I would expect all the users to already have a working link. Nothing else to update.
You said: "We have Scheduled Tasks that run every 15 minutes to update our Intranet reports"
Having a refresh rate must faster than 15 minutes would be a lot of wasted trips to get the same web page. A 5 second refresh means there are 180 refreshes between each 15 minute scheduled task run. I would start with a refresh of 300 second or longer to see if that works.
If it were my project I would go with tagit's suggestion of a wrapper page. Very simple to do.
I would have the wrapper page be named qryOEDailyOrdersTaken.htm.
By having the wrapper page use the original file name I would expect all the users to already have a working link. Nothing else to update.
ASKER
I will try tagit's idea ASAP. Just posting a reply so the system doesn't flush my question.
I've requested that this question be deleted for the following reason:
Not enough information to confirm an answer.
Not enough information to confirm an answer.
tagit's (not sure what happened to it since tagit no longer has a post here) suggestion of a wrapper page works. I use the iFrame solution now..
@MartinLiss, There are a lot of old posts that refer to a poster's name that no longer appear. The older post are becoming confusing to follow! Are there data issue with the EE database?
@MartinLiss, There are a lot of old posts that refer to a poster's name that no longer appear. The older post are becoming confusing to follow! Are there data issue with the EE database?
I'm still here but yes very confusing. I second the objection.
I see Rob Jurd (tagit) is back. I swear it only said Rob Jurd earlier without the original user name suffix of (tagit) . Whatever cause the change really helps clear things up.
Its called changing my last name to have the username in brackets. ..
@Rob Jurd (tagit), that is brilliant. Hope everyone else will do the same.
Thanks for the Tip!
Thanks for the Tip!
No prob :) I think a few simple things were overlooked with the profile updates!