-
Help AutoScrolling an XML page in a Frame
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.
-
-
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.
-
-
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.
-
-
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.
-
-
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
ffice:access">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"/>
<base target="_self">
</HEAD>
<BODY ONLOAD="ApplyTransform()">
</BODY>
<SCRIPT LANGUAGE="VBScript">
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>
</HTML>
--------------------------------------------------------------------------
<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(){
startit()
}
function scrollwindow(){
if (document.all)
temp=document.body.scrollTop
else
temp=window.pageYOffset
if (alt==0)
alt=2
else
alt=1
if (alt==0)
curpos1=temp
else
curpos2=temp
if (curpos1!=curpos2){
if (document.all)
currentpos=document.body.scrollTop+speed
else
currentpos=window.pageYOffset+speed
window.scroll(0,currentpos)
}
else{
currentpos=0
window.scroll(0,currentpos)
}
}
function startit(){
setInterval("scrollwindow()",50)
}
window.onload=initialize
</SCRIPT>
-
-
This is hideous. You say Frontpage generated this?
Try changing
Code:
window.onload=initialize
to , 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.
-
-
the code was actually generated by MS Access using the export report as XML option
-
-
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.
-
-
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 
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.
Last edited by Twey; 08-24-2005 at 07:39 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!
Last edited by rogstepper; 08-24-2005 at 07:50 PM.
Reason: Adding info
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks