示例#1
0
        public string GetChartTextData(string Separator, bool ShowHeader)
        {
            FormulaPackage formulaDataArray = new FormulaPackage();

            foreach (FormulaArea area in this.Areas)
            {
                formulaDataArray.AddRange(area.FormulaDataArray);
            }
            return(this.GetTextData(formulaDataArray, Separator, ShowHeader));
        }
示例#2
0
        private string GetTextData(FormulaPackage FormulaDataArray, string Separator, bool ShowHeader)
        {
            FormulaData data = this.DataProvider["DATE"];

            data.Name = "Date";
            ArrayList list = new ArrayList();

            list.Add(data);
            list.AddRange(FormulaDataArray);
            StringBuilder builder = new StringBuilder();

            if (list.Count > 0)
            {
                for (int i = -(ShowHeader ? 1 : 0); i < data.Length; i++)
                {
                    for (int j = 0; j < list.Count; j++)
                    {
                        FormulaData data2 = (FormulaData)list[j];
                        if (ShowHeader && (i < 0))
                        {
                            builder.Append(data2.Name);
                        }
                        if (i >= 0)
                        {
                            if (j == 0)
                            {
                                builder.Append(DateTime.FromOADate(data2[i]).ToString("dd-MMM-yy", DateTimeFormatInfo.InvariantInfo));
                            }
                            else
                            {
                                builder.Append(data2[i].ToString("f2", NumberFormatInfo.InvariantInfo));
                            }
                        }
                        if (j < (FormulaDataArray.Count - 1))
                        {
                            builder.Append(Separator);
                        }
                    }
                    builder.Append("\r\n");
                }
            }
            return(builder.ToString());
        }
 public virtual void Add(FormulaPackage fp)
 {
     base.List.Add(fp);
 }