<% ' Execute report related codes Dim sExecuteText If Not IsObject(Language) Then sExecuteText = LoadFile("ewrexecute.asp") Execute sExecuteText End If ' Load file content (both ASCII and UTF-8) Function LoadFile(FileName) On Error Resume Next Dim fso, FilePath LoadFile = "" Set fso = Server.CreateObject("Scripting.FileSystemObject") If Trim(FileName) <> "" Then If fso.FileExists(FileName) Then FilePath = FileName Else FilePath = Server.MapPath(FileName) End If If fso.FileExists(FilePath) Then If GetFileCharset(FilePath) = "UTF-8" Then LoadFile = LoadUTF8File(FilePath) Else Dim iFile, iData Set iFile = fso.GetFile(FilePath) Set iData = iFile.OpenAsTextStream LoadFile = iData.ReadAll iData.Close Set iData = Nothing Set iFile = Nothing End If End If End If Set fso = Nothing End Function ' Get file charset (UTF-8 and UNICODE) Function GetFileCharset(FilePath) On Error Resume Next Dim objStream, LoadBytes Set objStream = Server.CreateObject("ADODB.Stream") With objStream .Type = 1 .Mode = 3 .Open .LoadFromFile FilePath LoadBytes = .Read(3) ' Get first 3 bytes as BOM .Close End With Set objStream = Nothing Dim FileCharset, strFileHead ' Get hex values strFileHead = BinToHex(LoadBytes) ' UTF-8 If strFileHead = "EFBBBF" Then GetFileCharset = "UTF-8" ' UTF-8 Else GetFileCharset = "" ' Non UTF-8 End If End Function ' Get hex values Function BinToHex(vStream) Dim reVal, i reVal = 0 For i = 1 To LenB(vStream) reVal = reVal * 256 + AscB(MidB(vStream, i, 1)) Next BinToHex = Hex(reVal) End Function ' Open UTF8 file Function LoadUTF8File(FilePath) On Error Resume Next Dim objStream Set objStream = Server.CreateObject("ADODB.Stream") With objStream .Type = 2 .Mode = 3 .Open .CharSet = "UTF-8" .LoadFromFile FilePath LoadUTF8File = .ReadText .Close End With End Function %> <%= Language.ProjectPhrase("BodyTitle") %> <% If gsExport = "" Or gsExport = "print" Then %> <% End If %> <% If gsExport = "" Or gsExport = "print" Then %> <% End If %> "> "> <% If gsExport = "" Then %>
 

<% Server.Execute("ewmenu.asp") %> <% End If %>