1,216
社区成员
发帖
与我相关
我的任务
分享
If Not AdoEoF(sc) Then Exit Sub
' SayStatus "正在处理相关数据,请稍候……", 5
scnum = 0
For i = 0 To sc.Fields.count - 1
If sc.Fields(i).Name = "FZdDate" Then
scnum = i + 1
Exit For
End If
Next i
sc.MoveLast
sc.MoveFirst
menu.Pb.Max = sc.RecordCount + 1
menu.Pb.Value = 0
menu.Pb.Min = 0
With vadisp
.MaxRows = 0
.MaxRows = sc.RecordCount + 1
j = 1
k = 2
str1 = sc.Fields(0)
Do While Not sc.EOF
DoEvents
If FQuitSear Then
MsgBox "中断查询结果显示,现在所显示的只是部分查询结果!", vbExclamation + vbOKOnly, "龙奕提示"
Exit Sub
End If
'Debug.Print sc.Fields(0) & " " & str1 & " " & Str(j)
If str1 = sc.Fields(0) And k = 1 Then
For i = scnum To sc.Fields.count - 1
.Col = i + 1
.Row = j
.Text = sc.Fields(i) & ""
.Lock = True
.ForeColor = FontColor
d.Open "select * from TPrintSetEntry where F_num=" & F_Num & " and FName" & Lang & "='" & sc.Fields(i).Name & "'", Conn
.ColWidth(.Col) = d.Fields("FWidth") * 567
If d.Fields("FType") = "int" Then
.CellType = CellTypeInteger
ElseIf d.Fields("FType") = "dec" Then
.CellType = CellTypeFloat
.TypeFloatDecimalPlaces = d.Fields("FDecWidth")
ElseIf d.Fields("FType") = "bool" Then
.CellType = CellTypeCheckBox
.TypeHAlign = TypeHAlignCenter
If sc.Fields(i) Then
.Value = True
Else
.Value = False
End If
End If
d.Close
Next i
'k = 2
Else
For i = 0 To sc.Fields.count - 1
.Col = i + 1
.Row = j
'.ForeColor = RGB(255, 0, 0)
.Text = sc.Fields(i) & ""
.ForeColor = FontColor
d.Open "select * from TPrintSetEntry where F_num=" & F_Num & " and FName" & Lang & "='" & sc.Fields(i).Name & "'", Conn
.ColWidth(.Col) = d.Fields("FWidth") * 567
If d.Fields("FType") = "int" Then
.CellType = CellTypeInteger
ElseIf d.Fields("FType") = "dec" Then
.CellType = CellTypeFloat
.TypeFloatDecimalPlaces = d.Fields("FDecWidth")
ElseIf d.Fields("FType") = "bool" Then
.CellType = CellTypeCheckBox
.TypeHAlign = TypeHAlignCenter
If Left(sc.Fields(i), 1) = "已" Or sc.Fields(i) Then
.Value = True
Else
.Value = False
End If
End If
d.Close
Next i
k = 1
End If
'End If
str1 = sc.Fields(0)
sc.MoveNext
j = j + 1
menu.Pb.Value = j '''
Loop
.Col = 1
.Row = j
.Text = "合计"
' Debug.Print F_Num
For i = 0 To sc.Fields.count - 1
.Col = i + 1
d.Open "select * from TPrintSetEntry where F_num=" & F_Num & " and FName" & Lang & "='" & sc.Fields(i).Name & "'", Conn
If d.Fields("FTj") Then
.SetRefStyle RefStyleDefault
If d.Fields("FType") = "int" Then
.CellType = CellTypeInteger
ElseIf d.Fields("FType") = "dec" Then
.CellType = CellTypeFloat
.TypeFloatDecimalPlaces = d.Fields("FDecWidth")
End If
.Formula = "sum(" & ColToAbc(i + 1) & "1:" & ColToAbc(i + 1) & Trim(Str(.MaxRows - 1)) & ")" '"Sum(R[-1]C:R[-" & Trim(Str(j)) & "]C)"
End If
d.Close
Next i
If F_Num = 7253 Then
.Col = 8
.CellType = CellTypeFloat
.TypeFloatDecimalPlaces = 4
.SetRefStyle RefStyleR1C1
.Formula = "RC[9]/RC[8]"
End If
End With
sc.MoveFirst