private ProductionXmlFileTemplate GetHKMAINSSXmlFileContent(Worksheet worksheet)
        {
            ProductionXmlFileTemplate template = new ProductionXmlFileTemplate();
            int lastAddedRicNum = 0;
            // the default id value of the first fid node in each ric node
            int lastStartId = 316;
            // the start row of the range which will be copied from the HKMAINSSExcel file to the HKMAINSSXml file
            int startRow = (configObj.HKMAINSS_CONFIG.START_PAGE - 1) * configObj.HKMAINSS_CONFIG.LINE_NUM + 1;
            // the end row of the range which will be copied from the HKMAINSSExcel file to the HKMAINSSXml file
            int endRow = configObj.HKMAINSS_CONFIG.TOTAL_PAGE_NUM * configObj.HKMAINSS_CONFIG.LINE_NUM;

            //copy the records whose Range is from startRow to endRow in the HKMAINSSExcel file
            for (int i = startRow; i <= endRow; i++)
            {
                if ((i - startRow) % configObj.HKMAINSS_CONFIG.LINE_NUM == 0)
                {
                    lastAddedRicNum = template.rics.rics.Count - 1;

                    Reuters.ProcessQuality.ContentAuto.Lib.Ric ric = new Reuters.ProcessQuality.ContentAuto.Lib.Ric();
                    ric.Name = string.Format("HK/MAINSS{0}", (((i - startRow) / configObj.HKMAINSS_CONFIG.LINE_NUM) + configObj.HKMAINSS_CONFIG.START_PAGE).ToString("D2"));
                    template.rics.rics.Add(ric);

                    if (lastAddedRicNum >= 0)
                    {
                        Fid lastFid = new Fid();
                        lastFid.Id = 339;
                        string continuedPageDescription = "Continued on <" + template.rics.rics[lastAddedRicNum + 1].Name + ">";
                        continuedPageDescription = continuedPageDescription.PadLeft(recordTotalLength);
                        lastFid.Value            = string.Format("\"{0}\"", continuedPageDescription);
                        template.rics.rics[lastAddedRicNum].fids.Add(lastFid);
                    }
                }

                if ((i - startRow) % configObj.HKMAINSS_CONFIG.LINE_NUM == 3)
                {
                    lastStartId = 315;
                    continue;
                }

                Fid fid = new Fid();
                fid.Id = lastStartId + (i - startRow) % configObj.HKMAINSS_CONFIG.LINE_NUM;
                string colValue = GetFormatedValue(i, worksheet);
                fid.Value = string.Format("\"{0}\"", colValue);

                lastAddedRicNum = template.rics.rics.Count - 1;
                template.rics.rics[lastAddedRicNum].fids.Add(fid);

                if ((i - startRow) % configObj.HKMAINSS_CONFIG.LINE_NUM == (configObj.HKMAINSS_CONFIG.LINE_NUM - 1))
                {
                    lastStartId = 316;
                }
            }
            return(template);
        }
        private ProductionXmlFileTemplate GetGemssXmlFileContent(Worksheet gemssWorksheet)
        {
            ProductionXmlFileTemplate template = new ProductionXmlFileTemplate();
            int lastAddedRicNum = 0;

            for (int i = 1; i <= 240; i++)
            {
                if (i % 24 == 1)
                {
                    lastAddedRicNum = template.rics.rics.Count - 1;
                    if (lastAddedRicNum > 0)
                    {
                        Fid lastFid = new Fid();
                        lastFid.Id    = 339;
                        lastFid.Value = string.Format("\"Continued on <{0}>\"", template.rics.rics[lastAddedRicNum].Name);
                    }
                    Reuters.ProcessQuality.ContentAuto.Lib.Ric ric = new Reuters.ProcessQuality.ContentAuto.Lib.Ric();
                    ric.Name = string.Format("HK/GEMSS{0}", (i / 24 + 1).ToString("D2"));
                    template.rics.rics.Add(ric);
                }

                if (i % 24 == 0)
                {
                    continue;
                }

                Fid fid = new Fid();
                fid.Id = 316 + (i - 1) % 24;
                if (ExcelUtil.GetRange(i, 1, gemssWorksheet).Text != null)
                {
                    fid.Value = string.Format("\"{0}\"", ExcelUtil.GetRange(i, 1, gemssWorksheet).Text.ToString());
                    if (fid.Value == "\" \"")
                    {
                        fid.Value = " ".PadLeft(recordTotalLength);
                        fid.Value = "\"" + fid.Value + "\"";
                    }
                }
                else
                {
                    fid.Value = string.Format("\"{0}\"", " ".PadLeft(recordAlignrightLength));
                }

                lastAddedRicNum = template.rics.rics.Count - 1;
                template.rics.rics[lastAddedRicNum].fids.Add(fid);
            }
            return(template);
        }
        private ProductionXmlFileTemplate GetHKMAINXmlFileContent(Worksheet worksheet)
        {
            ProductionXmlFileTemplate template = new ProductionXmlFileTemplate();
            int    lastAddedRicNum             = 0;
            string dateStr     = ExcelUtil.GetRange(1, 1, worksheet).Text.ToString();
            string titleLine   = "RIC         STOCK NAME                          SHARES        TURNOVER ($)";
            string partingLine = "=========   ====================       ===============     ===============";

            for (int i = 4; i <= 503; i++)
            {
                if (i % 20 == 4)
                {
                    Reuters.ProcessQuality.ContentAuto.Lib.Ric ric = new Reuters.ProcessQuality.ContentAuto.Lib.Ric();
                    ric.Name = string.Format("HK/MAINSS{0}", (i / 20 + 1).ToString("D2"));
                    template.rics.rics.Add(ric);
                    Fid fidDate = new Fid();
                    fidDate.Id      = 316;
                    fidDate.Value   = string.Format("\"{0}\"", dateStr);
                    lastAddedRicNum = template.rics.rics.Count - 1;
                    template.rics.rics[lastAddedRicNum].fids.Add(fidDate);

                    Fid fidTitleLine = new Fid();
                    fidTitleLine.Id    = 317;
                    fidTitleLine.Value = string.Format("\"{0}\"", titleLine);
                    template.rics.rics[lastAddedRicNum].fids.Add(fidTitleLine);

                    Fid fidPartingLine = new Fid();
                    fidPartingLine.Id    = 318;
                    fidPartingLine.Value = string.Format("\"{0}\"", partingLine);
                    template.rics.rics[lastAddedRicNum].fids.Add(fidPartingLine);
                }
                Fid fid2 = new Fid();
                fid2.Id    = (i - 4) % 20 + 319;
                fid2.Value = GetFidValue(worksheet, i);

                lastAddedRicNum = template.rics.rics.Count - 1;
                template.rics.rics[lastAddedRicNum].fids.Add(fid2);
            }
            return(template);
        }