Ejemplo n.º 1
0
        private void BindDGistogramm()
        {
            GraphicImage dgist = new GraphicImage();

            if (Request["PrjRep_Finance"] != null)
                PrjRep_Finance(dgist);

            System.IO.MemoryStream tmpStream = new System.IO.MemoryStream();
            dgist.Render(tmpStream, System.Drawing.Imaging.ImageFormat.Png);
            byte[] tmpBuffer = tmpStream.GetBuffer();
            this.Response.OutputStream.Write(tmpBuffer, 0, tmpBuffer.Length);
        }
Ejemplo n.º 2
0
        private void PrjRep_Finance(GraphicImage dgist)
        {
            LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Projects.Resources.strProjectReports", typeof(ChartImage).Assembly);
            int ProjId = int.Parse(Request["ProjectId"].ToString());
            DataTable dt = Finance.GetListTopLevelAccountsDataTable(ProjId);

            dgist.ImageWidth = 250;
            dgist.ImageHeight = 250;
            dgist.ChartItemsLName = LocRM.GetString("tTargetBudget");
            dgist.ChartItemsRName = LocRM.GetString("tActualBudget");

            string[] titles = new string[dt.Rows.Count + 1];
            double[] values1 = new double[dt.Rows.Count + 1];
            double[] values2 = new double[dt.Rows.Count + 1];
            titles[0] = "";
            values1[0] = 0;
            values2[0] = 0;
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if ((int)dt.Rows[i]["OutlineLevel"] == 1)
                    titles[i + 1] = LocRM.GetString("tOther");
                else
                    titles[i + 1] = dt.Rows[i]["Title"].ToString();
                values1[i + 1] = Convert.ToDouble(dt.Rows[i]["Target"]);
                values2[i + 1] = Convert.ToDouble(dt.Rows[i]["Actual"]);
            }
            dgist.CollectDataPoints(titles, values1, values2);
        }