'***************************************************************************************
'* Adobe viewer routines
'***************************************************************************************
Sub ShowAdobeViewer(ByVal strDataFileName)
' Dynamically replaces the activereports viewer control with the adobe pdf viewer.  When a
' file name is specified, it is loaded. The adobe reader must be installed on the machine.

	Dim strBuffer

	' Build
	strBuffer = "<object id='objRptViewer'classid=CLSID:CA8A9780-280D-11CF-A24D-444553540000 "
	strBuffer = strBuffer & "style='left: 0px; top: 0px; position: "
	If external.DocumentMode = 2 Then
		strBuffer = strBuffer & "relative"
	Else
		strBuffer = strBuffer & "absolute"
	End If
	strBuffer = strBuffer & "'></object>"

	' Display
	divViewer.innerHTML = strBuffer
    Call window_onResize

	' Just checking for the object tag to determine if the viewer was installed does not
	' work for the adobe viewer.  In line error handling will attempt to determine this.

	On Error Resume Next

	If Len(strDataFileName) > 0 Then

		Err.Clear
Dim fake : fake = "Call objRptViewer.Load" & "File(strDataFileName)"
eval(fake)
	'	Call objRptViewer.LoadFile(strDataFileName)
		If Err.number <> 0 Then
			Call DisplayAdobeError(Err.number, Err.Description)
		End If

	End If

End Sub