Hi all.
I'm creat 1 report, but i have 2 errors, plz help me.
1. I use While, in loop, its show data ok but When When i get the loop out of data, duplicate data (as images 1) and i dont understand why.
ex code:
Quote |
---|
While Lb0.Next() Do Name = TrimAll(Lb0.Name); DongCtbcc = LbCtBcc.Add(); DongCtbcc.NhanVien = Lb0.RefNhanVien; For i = Day(StartDate) TO Day(EndDate) Do LcHinhThucNghi = ""; If Not IsBlankString(LcHinhThucNghi) and (WeekDay(LDayTuNgay) <> 6 and WeekDay(LDayTuNgay) <> 7 ) Then If i = 1 Then N01 = LcHinhThucNghi; DongCtbcc.N01 = LcHinhThucNghi; EndIf; If i = 2 Then N02 = LcHinhThucNghi; DongCtbcc.N02 = LcHinhThucNghi; EndIf; Else If WeekDay(Date(Year(StartDate), Month(StartDate), i)) = 6 OR WeekDay(Date(Year(StartDate), Month(StartDate), i)) = 7 Then ELSE If i = 1 Then N01 = "x"; DongCtbcc.N01 = "x"; EndIf; If i = 2 Then N02 = "x"; DongCtbcc.N02 = "x"; EndIf; EndIf; EndDo; Ngaycong = "Ngày công"; DongCtbcc.Ngaycong = songaylamviec + DongCtbcc.NLD Phep = "Phép"; DongCtbcc.Phep = ?(DongCtbcc.N01 = "P", 1, 0) + ?(DongCtbcc.N02 = "P", 1, 0); NLD = "Ngày làm đêm"; DongCtbcc.NLD = ?(DongCtbcc.N01 = "NLĐ", 1, 0) + ?(DongCtbcc.N02 = "NLĐ", 1, 0); EndDo; LbBangChamCong.Write(); TableHeaderArea.Parameters.BSTT = BSTT; TableHeaderArea.Parameters.BNAME = BNAME; TableHeaderArea.Parameters.BNGAY = BNGAY; TableHeaderArea.Parameters.BCONG = BCONG; TableHeaderArea.Parameters.B1 = B1; TableHeaderArea.Parameters.B2 = B2; Spreadsheet.Put(TableHeaderArea, 1); TmpbCc = Documents.BangChamCong.Select(StartDate, EndDate); While TmpbCc.Next() Do If TmpbCc.Thang = Month(StartDate) AND TmpbCc.Nam = Year(StartDate) AND TmpbCc.PhongBan = Departement Then fOR Each Row In TmpbCc.ChiTietChamCong Do stt=stt+1; DetailRecordArea.Parameters.stt = Row.stt; DetailRecordArea.Parameters.NAME = Row.Name; DetailRecordArea.Parameters.N01 = Row.N01; DetailRecordArea.Parameters.N02 = Row.N02; ENDDO; Spreadsheet.Put(DetailRecordArea, 1); EndDo; |
2. I want to create a circle around cells but i dont know can use function and how to use it. i'm search and see SpreadsheetDocumentDrawingType but i dont understand. (Ex image)
Sorry, my english is not good.
Thanks.