gooseriver
IS-IT--Management
the html table consists of File Name, Size and Date/Time. Right now there is no sort in the html table.
I want the table to be sorted by the last column date/time in asc order... I dont want to have any of this
clicking on the headers to sort. Just simply a sort right away. Here is my code:
If (objFSO.FolderExists(strPhysicalPath)) then
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objCollection = objFolder.Files
maxIndex = lCurrentPage * lPageSize
minIndex = (lCurrentPage-1) * lPageSize + 1
filFileName = request("FilFileName")
filDateFrom = request("FilDateFrom")
filDateTo = request("FilDateTo")
intRecord = 0
Index = 0
For Each objItem in objCollection
strName = objItem.Name
dtmDate = CDate(objItem.DateLastModIfied)
strFile = Server.HTMLEncode(strName)
intSizeB = objItem.Size
bDisplayFlag = true
If filFileName <> "" And filFileName <> "*" And NOT ISNULL(filFileName ) then
If Right(filFileName,1) = "*" Then
filFileName = Left(filFileName, Len(filFileName)-1)
End If
If Instr(UCase(strName), UCase(filFileName)) <> 1 Then
bDisplayFlag = false
End If
End If
If filDateFrom <> "" And filDateFrom <> "*" And NOT ISNULL(filDateFrom ) then
If FormatDateTime(filDateFrom,vbShortDate) > FormatDateTime(dtmDate,vbShortDate) Then
bDisplayFlag = false
End If
End If
If filDateTo <> "" And filDateTo <> "*" And NOT ISNULL(filDateTo ) then
If FormatDateTime(filDateTo,vbShortDate) < FormatDateTime(dtmDate,vbShortDate) Then
bDisplayFlag = false
End If
End If
If lBatchReportType="0" Then 'For single select
If Left(strFile,1) <> prxFix Then
bDisplayFlag = false
End If
End If
If bDisplayFlag = true Then
Index = Index + 1
If Index <=maxIndex and Index >=minIndex then
%>
<tr class="Row<%=((intRecord + 1)mod 2) + 1%>" onclick="javascript:if(typeof(GoViewFile)=='function') GoViewFile('<%=intRecord%>','0', '<%=strFile%>');document.frmList.rdo<%=intRecord%>.checked=true;" onmouseout="this.style.color='black'" onmouseover="this.style.color='Red'; this.style.cursor='hand';">
<td><input type="radio" id="rdo<%=intRecord%>" name="chkFiles" value = "<%=strFile%>" onclick="javascript:if(typeof(GoDocSelect)=='function') GoDocSelect('<%=intRecord%>','0', '<%=strFile%>'); event.cancelBubble=true;"></td>
<td align="left"><%=strFile%></td>
<td align="right"><%=FormatNumber(intSizeB,0)%> bytes</td>
<td align="left"><%=FormatDateTime(dtmDate,vbShortDate) & " " & FormatDateTime(dtmDate,vbLongTime)%></td>
</tr>
<%
intRecord = intRecord + 1
End If
End If
Next
End If
I want the table to be sorted by the last column date/time in asc order... I dont want to have any of this
clicking on the headers to sort. Just simply a sort right away. Here is my code:
If (objFSO.FolderExists(strPhysicalPath)) then
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objCollection = objFolder.Files
maxIndex = lCurrentPage * lPageSize
minIndex = (lCurrentPage-1) * lPageSize + 1
filFileName = request("FilFileName")
filDateFrom = request("FilDateFrom")
filDateTo = request("FilDateTo")
intRecord = 0
Index = 0
For Each objItem in objCollection
strName = objItem.Name
dtmDate = CDate(objItem.DateLastModIfied)
strFile = Server.HTMLEncode(strName)
intSizeB = objItem.Size
bDisplayFlag = true
If filFileName <> "" And filFileName <> "*" And NOT ISNULL(filFileName ) then
If Right(filFileName,1) = "*" Then
filFileName = Left(filFileName, Len(filFileName)-1)
End If
If Instr(UCase(strName), UCase(filFileName)) <> 1 Then
bDisplayFlag = false
End If
End If
If filDateFrom <> "" And filDateFrom <> "*" And NOT ISNULL(filDateFrom ) then
If FormatDateTime(filDateFrom,vbShortDate) > FormatDateTime(dtmDate,vbShortDate) Then
bDisplayFlag = false
End If
End If
If filDateTo <> "" And filDateTo <> "*" And NOT ISNULL(filDateTo ) then
If FormatDateTime(filDateTo,vbShortDate) < FormatDateTime(dtmDate,vbShortDate) Then
bDisplayFlag = false
End If
End If
If lBatchReportType="0" Then 'For single select
If Left(strFile,1) <> prxFix Then
bDisplayFlag = false
End If
End If
If bDisplayFlag = true Then
Index = Index + 1
If Index <=maxIndex and Index >=minIndex then
%>
<tr class="Row<%=((intRecord + 1)mod 2) + 1%>" onclick="javascript:if(typeof(GoViewFile)=='function') GoViewFile('<%=intRecord%>','0', '<%=strFile%>');document.frmList.rdo<%=intRecord%>.checked=true;" onmouseout="this.style.color='black'" onmouseover="this.style.color='Red'; this.style.cursor='hand';">
<td><input type="radio" id="rdo<%=intRecord%>" name="chkFiles" value = "<%=strFile%>" onclick="javascript:if(typeof(GoDocSelect)=='function') GoDocSelect('<%=intRecord%>','0', '<%=strFile%>'); event.cancelBubble=true;"></td>
<td align="left"><%=strFile%></td>
<td align="right"><%=FormatNumber(intSizeB,0)%> bytes</td>
<td align="left"><%=FormatDateTime(dtmDate,vbShortDate) & " " & FormatDateTime(dtmDate,vbLongTime)%></td>
</tr>
<%
intRecord = intRecord + 1
End If
End If
Next
End If