View Full Version : Help AutoScrolling an XML page in a Frame

08-24-2005, 04:20 PM
:confused: I am publishing a MS Access report as an XML document so that the report is one long page. I need to be able to link to the HTM display of this report in a Frame, and have the page in the frame scroll vertically from top to bottom automatically. I have tried every permutation of scrolling scripts I can find, but to no avail.

If I output the report as an HTML I can scroll the first page of the 32 page report, but cannot automatically go to the subseuent pages. this is why I an outputing an XML. But if I try to insert the scrolling script in the code for the XML page in the same fashion as I did for the HTML multi page The Page displayed in my browser is blank. It appears correctly if I do not try to insert the scroll code.

Can someone help me get this working.

08-24-2005, 04:22 PM
You cannot execute the code in an XML page.
My advice would be to add a link to the next page on your report. You also will need to insert the script manually.

08-24-2005, 04:35 PM
I may not have made my first post clear. I am trying to insert the scrolling code in the HTM file generated when I export the report as an XML. The HTM is a display of the XML data.

08-24-2005, 05:39 PM
Edit the resulting .htm file and insert the script there. If it doesn't work, post the content of the file here, in [code] tags.

08-24-2005, 06:03 PM
Here is the code for the HTM file as copied straight from FrontPage, I also posted the code for the scroller that I am trying to use after the HTM code Let me know if I should post the XML, XSD and XSL:

<HTML xmlns:signature="urn:schemas-microsoft-com:office:access">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"/>
<base target="_self">
<BODY ONLOAD="ApplyTransform()">
Option Explicit

Function ApplyTransform()
Dim objData, objStyle

Set objData = CreateDOM
LoadDOM objData, "Test%20Report%20for%20Format1.xml"

Set objStyle = CreateDOM
LoadDOM objStyle, "Test%20Report%20for%20Format1.xsl"

Document.Open "text/html","replace"
Document.Write objData.TransformNode(objStyle)
End Function

Function CreateDOM()
On Error Resume Next
Dim tmpDOM

Set tmpDOM = Nothing
Set tmpDOM = CreateObject("MSXML2.DOMDocument.5.0")
If tmpDOM Is Nothing Then
Set tmpDOM = CreateObject("MSXML2.DOMDocument.4.0")
End If
If tmpDOM Is Nothing Then
Set tmpDOM = CreateObject("MSXML.DOMDocument")
End If

Set CreateDOM = tmpDOM
End Function

Function LoadDOM(objDOM, strXMLFile)
objDOM.Async = False
objDOM.Load strXMLFile
If (objDOM.ParseError.ErrorCode <> 0) Then
MsgBox objDOM.ParseError.Reason
End If
End Function



<SCRIPT language=JavaScript1.2>

//change 1 to another integer to alter the scroll speed. Greater is faster
var speed=1
var currentpos=0,alt=1,curpos1=0,curpos2=-1
function initialize(){
function scrollwindow(){
if (document.all)
if (alt==0)
if (alt==0)
if (curpos1!=curpos2){
if (document.all)
function startit(){

08-24-2005, 06:34 PM
This is hideous. You say Frontpage generated this?

Try changing
window.onload=initialize to
initialize(), and putting the script in the head. Do not load it back into Frontpage after doing so, as it will immediately stab the script in the ear with a blunt spoon.

P.S. If this doesn't work, I won't be surprised. The code generated here is a masterpiece in bad webdev style - don't expect it to work in anything except IE. If it doesn't, post your XML stuff. I won't be able to make head or tail of it, but Mike probably will.

08-24-2005, 06:45 PM
the code was actually generated by MS Access using the export report as XML option

08-24-2005, 07:25 PM
Thanks for your persistance on this with me. This has really been kicking my tail. The last suggestion did not work, so as you suggested I am sending all of my code (XML, XSD and XSL), less the two that I included in the previous post. Hopefully Mike can help. I will have to e-mail the codes to you, I copied them into Word docs and they are each too big for the forum attatchment function.

08-24-2005, 07:34 PM
Please don't use Word documents. Paste them into a .txt using Notepad instead. You can also compress them using the algorithm of your choice - anyone who knows enough to help you should be able to extract them :p
Distributing Word documents is a bad idea. While sometimes necessary, it should be avoided where possible. .doc is a proprietary format, and as such, may be unreadable by some people (and most Microsoft-haters won't read it even if they can). It also adds useless formatting junk that increases the filesize considerably.

08-24-2005, 07:46 PM
Sorry I am a noobie at this forum, and I did not see the tags edit until I posted all of that mess.I can try and attatch as .txt if you would prefer. If that works I can delete the mess above!

08-24-2005, 08:25 PM
That will do nicely. If it's still too big, compress it.

08-24-2005, 08:29 PM
Here are the three Files I will delete the mess created above. thanks again and sorry for the mess.

08-24-2005, 08:40 PM
Thank you :)

08-29-2005, 02:19 PM
I just found found a software product that will generate a single page HTML file just like I need that I can then be able to use JavaScript to automatically scroll the page in my Frame. Just tried it out and it works perfectly! the price was not too bad either ($49.00) If anybody else is interested here is the link.