private ArrayList constructItems()
        {
            CTaxFormPageRv1Kor            page  = null;
            CTaxFormGroupByEmployeeRv1Kor group = null;
            ArrayList pages = new ArrayList();

            while (true)
            {
                MVTaxFormPRV1 m = fetchData();
                if (m == null)
                {
                    break;
                }

                if ((page == null) || (page.GroupCount >= 8))
                {
                    page = new CTaxFormPageRv1Kor();
                    pages.Add(page);
                }

                group = new CTaxFormGroupByEmployeeRv1Kor(m);
                page.AddGroup(group);

                group.AddWhItem(m);
                suppliers[m.SupplierName] = m.SupplierName;
            }

            if (pages.Count > 0)
            {
                int lastIdx = pages.Count - 1;

                CTaxFormPageRv1Kor lastPage = (CTaxFormPageRv1Kor)pages[lastIdx];
                if (lastPage.GroupCount == 0)
                {
                    //Blank page
                    pages.RemoveAt(lastIdx);
                }
            }

            return(pages);
        }
        private void populateDetailFormValue(AcroFields pdfFormFields, int category, int pageNo, int pageCount, CTaxFormPageRv1Kor page)
        {
            String fldName = getFormFieldName(-1, -1, "CompanyTaxID");

            pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatTaxIDField(company.TaxID));

            fldName = getFormFieldName(-1, -1, "SheetNo");
            pdfFormFields.SetField(fldName, pageNo.ToString());

            fldName = getFormFieldName(-1, -1, "TotalSheet");
            pdfFormFields.SetField(fldName, pageCount.ToString());

            fldName = getFormFieldName(-1, -1, "TotalExpenseAmount");
            pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(actualView.ExpenseAmount));

            fldName = getFormFieldName(-1, -1, "TotalWhAmount");
            pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(actualView.WhAmount));

            fldName = getFormFieldName(-1, -1, "Condition");
            pdfFormFields.SetField(fldName, "0");

            int grpNo = 0;

            foreach (CTaxFormGroupByEmployeeRv1Kor grp in page.Groups)
            {
                currSeq++;

                fldName = getFormFieldName(grpNo, 0, "SupplierTaxID");
                pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatTaxIDField(grp.TaxID));

                String[] s = CTaxDocumentUtil.GetNameLastname(grp.Name);
                fldName = getFormFieldName(grpNo, 0, "SupplierName");
                pdfFormFields.SetField(fldName, s[0]);

                fldName = getFormFieldName(grpNo, 0, "SupplierLastName");
                pdfFormFields.SetField(fldName, s[1]);

                fldName = getFormFieldName(grpNo, 0, "SeqNo");
                pdfFormFields.SetField(fldName, currSeq.ToString());

                int j = 0;
                foreach (MVTaxFormPRV1 row in grp.WhItems)
                {
                    whAmt      = whAmt + CUtil.StringToDouble(row.WhAmount);
                    expenseAmt = expenseAmt + CUtil.StringToDouble(row.ExpenseAmt);

                    fldName = getFormFieldName(grpNo, j, "PayrollDate");
                    pdfFormFields.SetField(fldName, "  " + row.DocumentDateFmt);

                    fldName = getFormFieldName(grpNo, j, "WhAmount");
                    pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(row.WhAmount));

                    fldName = getFormFieldName(grpNo, j, "ExpenseAmt");
                    pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(row.ExpenseAmt));

                    fldName = getFormFieldName(grpNo, j, "Condition");
                    pdfFormFields.SetField(fldName, "  1");

                    j++;
                }

                grpNo++;
            }

            fldName = getFormFieldName(-1, -1, "TotalExpenseAmount");
            pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(expenseAmt.ToString()));

            fldName = getFormFieldName(-1, -1, "TotalWhAmount");
            pdfFormFields.SetField(fldName, CTaxDocumentUtil.FormatNumberField(whAmt.ToString()));
        }