Solved

Adding Code to VB HTML Output

Posted on 2013-12-02
16
578 Views
Last Modified: 2014-01-05
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\reports\qryOEDailyOrdersTaken.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">
0
Comment
Question by:slamond
16 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39691043
<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.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39691045
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?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39691050
you  can open the webpage after the update

DoCmd.OutputTo acOutputReport, "rptOEDailyOrdersTaken", acFormatHTML, "\\bordenfp\intranet\reports\qryOEDailyOrdersTaken.htm", True

'this will open the page
followhyperlink  "\\bordenfp\intranet\reports\qryOEDailyOrdersTaken.htm"

another way is add script to your page to refresh it automatically on timer
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39691070
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?
0
 
LVL 21
ID: 39691753
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.
0
 

Author Comment

by:slamond
ID: 39704330
I will try tagit's idea ASAP. Just posting a reply so the system doesn't flush my question.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39747159
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 21
ID: 39747160
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?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39747459
I'm still here but yes very confusing. I second the objection.
0
 
LVL 21
ID: 39747536
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.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39747543
Its called changing my last name to have the username in brackets. ..
0
 
LVL 21
ID: 39747553
@Rob Jurd (tagit), that is brilliant. Hope everyone else will do the same.

Thanks for the Tip!
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39747559
No prob :) I think a few simple things were overlooked with the profile updates!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question