Ejemplo n.º 1
0
        private void RelGrafIndividualNotaComponente_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            Palette paletaCores = RelatoriosDevUtil.CarregarPaletaCoresRelaorio((int)ReportNameGestaoAcademica.GraficoIndividualNotaComponente);

            if (paletaCores.Count > 0)
            {
                xrChartNotaBim.PaletteRepository.Add("Gestao", paletaCores);
                xrChartNotaBim.PaletteName = "Gestao";
            }
        }
Ejemplo n.º 2
0
        private void SubRelGrafIndividualNotas_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            Palette paletaCores = RelatoriosDevUtil.CarregarPaletaCoresRelaorio((int)ReportNameGestaoAcademica.GraficoIndividualNotas);

            if (paletaCores.Count > 0)
            {
                xrChart1.PaletteRepository.Add("Gestao", paletaCores);
                xrChart1.PaletteName = "Gestao";
            }

            lblAluno.Visible = xrChart1.Visible = dsGestaoEscolar1.NEW_Relatorio_GrafIndividualNotas.Count > 0;
        }
Ejemplo n.º 3
0
        private void xrAtividadeAvaliativaEfetivacao_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            TUR_Turma tur = new TUR_Turma
            {
                tur_id = Convert.ToInt64(TURID.Value)
            };

            TUR_TurmaBO.GetEntity(tur);

            ACA_FormatoAvaliacao fav = new ACA_FormatoAvaliacao
            {
                fav_id = tur.fav_id
            };

            ACA_FormatoAvaliacaoBO.GetEntity(fav);

            ACA_EscalaAvaliacao esa = new ACA_EscalaAvaliacao
            {
                esa_id = fav.esa_idPorDisciplina
            };

            ACA_EscalaAvaliacaoBO.GetEntity(esa);

            xrBarra.Visible = (esa.esa_tipo == Convert.ToByte(1));
            xrPizza.Visible = (esa.esa_tipo == Convert.ToByte(2));

            List <string> lstCoresRelatorio = new List <string>();

            //Carrega as faixas da turma com as cores
            var lstFaixas = (from dadosGeral in dsGestaoEscolar2.NEW_RelatorioAvaliacao_Efetivacao_Grafico.AsEnumerable()
                             group dadosGeral by new
            {
                far_ordenar = dadosGeral.Field <object>("far_ordenar") != null
                                               ? dadosGeral.Field <object>("far_ordenar").ToString() : "",
                far_cor = dadosGeral.Field <object>("far_cor") != null
                                           ? dadosGeral.Field <object>("far_cor").ToString() : ""
            } into faixas
                             orderby faixas.Key.far_ordenar
                             select faixas.Key);

            //Se todas as faixas tiverem cores então vai usar as cores das faixas
            if (!lstFaixas.Any(p => string.IsNullOrEmpty(p.far_cor)))
            {
                lstCoresRelatorio = lstFaixas.Select(p => p.far_cor).ToList();
            }

            //Se não carregou nenhuma cor das faixas então usa as cores configuradas para o relatório
            if (lstCoresRelatorio.Count == 0)
            {
                lstCoresRelatorio = RelatoriosDevUtil.SelecionaCoresRelatorio((int)ReportNameGestaoAcademicaDocumentosDocente.DocDctGraficoAtividadeAvaliativa).Select(p => p.cor_corPaleta).ToList();
            }

            Palette paletaCores = RelatoriosDevUtil.CarregarPaletaCoresRelatorio(lstCoresRelatorio);

            if (paletaCores.Count > 0)
            {
                if (xrPizza.Visible)
                {
                    xrPizza.PaletteRepository.Add("Gestao", paletaCores);
                    xrPizza.PaletteName = "Gestao";
                }

                if (xrBarra.Visible)
                {
                    xrBarra.PaletteRepository.Add("Gestao", paletaCores);
                    xrBarra.PaletteName = "Gestao";
                }
            }
        }
        private void GroupHeader3_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            GroupHeader3.Visible = RegistrosEncontrados;

            if (RegistrosEncontrados &&
                !string.IsNullOrEmpty(this.GetCurrentColumnValue("esc_id").ToString()) &&
                !string.IsNullOrEmpty(this.GetCurrentColumnValue("uni_id").ToString()) &&
                !string.IsNullOrEmpty(this.GetCurrentColumnValue("tur_id").ToString()) &&
                !string.IsNullOrEmpty(this.GetCurrentColumnValue("tds_id").ToString()) &&
                !string.IsNullOrEmpty(this.GetCurrentColumnValue("tpc_id").ToString()))
            {
                xrChart1.Series[0].DataSource = (from dadosGeral in dsGestaoEscolar1.NEW_Relatorio_GrafConsAtivAvaliada_AlunosTurma.AsEnumerable()
                                                 where Convert.ToInt32(dadosGeral.Field <object>("esc_id")) == Convert.ToInt32(this.GetCurrentColumnValue("esc_id").ToString()) &&
                                                 Convert.ToInt32(dadosGeral.Field <object>("uni_id")) == Convert.ToInt32(this.GetCurrentColumnValue("uni_id").ToString()) &&
                                                 Convert.ToInt64(dadosGeral.Field <object>("tur_id")) == Convert.ToInt64(this.GetCurrentColumnValue("tur_id").ToString()) &&
                                                 Convert.ToInt32(dadosGeral.Field <object>("tds_id")) == Convert.ToInt32(this.GetCurrentColumnValue("tds_id").ToString()) &&
                                                 Convert.ToInt32(dadosGeral.Field <object>("tpc_id")) == Convert.ToInt32(this.GetCurrentColumnValue("tpc_id").ToString())
                                                 group dadosGeral by new { tds_id = dadosGeral.tds_id
                                                                           , tds_nome = dadosGeral.tds_nome
                                                                           , far_ordenar = dadosGeral.far_ordenar
                                                                           , far_valor = dadosGeral.far_valor
                                                                           , far_descricao = dadosGeral.far_descricao
                                                                           , esa_tipo = dadosGeral.esa_tipo } into d
                                                 orderby d.Key.tds_nome, d.Key.far_ordenar, d.Key.far_descricao
                                                 select new { far_descricao = d.Key.far_descricao, qtdAlunos = d.Count() }).ToList();

                xrChart1.Series[0].ArgumentDataMember  = "far_descricao";
                xrChart1.Series[0].ValueDataMembers[0] = "qtdAlunos";

                List <string> lstCoresRelatorio = new List <string>();

                //Carrega as faixas da turma com as cores
                var lstFaixas = (from dadosGeral in dsGestaoEscolar1.NEW_Relatorio_GrafConsAtivAvaliada_AlunosTurma.AsEnumerable()
                                 where Convert.ToInt32(dadosGeral.Field <object>("esc_id")) == Convert.ToInt32(this.GetCurrentColumnValue("esc_id").ToString()) &&
                                 Convert.ToInt32(dadosGeral.Field <object>("uni_id")) == Convert.ToInt32(this.GetCurrentColumnValue("uni_id").ToString()) &&
                                 Convert.ToInt64(dadosGeral.Field <object>("tur_id")) == Convert.ToInt64(this.GetCurrentColumnValue("tur_id").ToString()) &&
                                 Convert.ToInt32(dadosGeral.Field <object>("tds_id")) == Convert.ToInt32(this.GetCurrentColumnValue("tds_id").ToString()) &&
                                 Convert.ToInt32(dadosGeral.Field <object>("tpc_id")) == Convert.ToInt32(this.GetCurrentColumnValue("tpc_id").ToString())
                                 group dadosGeral by new
                {
                    far_ordenar = dadosGeral.Field <object>("far_ordenar") != null
                                                   ? dadosGeral.Field <object>("far_ordenar").ToString() : "",
                    far_cor = dadosGeral.Field <object>("far_cor") != null
                                               ? dadosGeral.Field <object>("far_cor").ToString() : ""
                } into faixas
                                 orderby faixas.Key.far_ordenar
                                 select faixas.Key);

                //Se todas as faixas tiverem cores então vai usar as cores das faixas
                if (!lstFaixas.Any(p => string.IsNullOrEmpty(p.far_cor)))
                {
                    lstCoresRelatorio = lstFaixas.Select(p => p.far_cor).ToList();
                }

                //Se não carregou nenhuma cor das faixas então usa as cores configuradas para o relatório
                if (lstCoresRelatorio.Count == 0)
                {
                    lstCoresRelatorio = RelatoriosDevUtil.SelecionaCoresRelatorio((int)ReportNameGestaoAcademica.GraficoConsolidadoAtividadeAvaliativa).Select(p => p.cor_corPaleta).ToList();
                }

                Palette paletaCores = RelatoriosDevUtil.CarregarPaletaCoresRelatorio(lstCoresRelatorio);

                if (paletaCores.Count > 0)
                {
                    xrChart1.PaletteRepository.Add("Gestao", paletaCores);
                    xrChart1.PaletteName = "Gestao";
                }

                xrChart1.Legend.Padding.Right = conceito ? 3 : 20;
                ((TextAnnotation)xrChart1.AnnotationRepository[0]).Text = conceito ? "Conceitos" :"Faixas de notas";
            }
        }
Ejemplo n.º 5
0
        private void GroupHeader3_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            GroupHeader3.Visible = RegistrosEncontrados;
            xrPanel1.Visible     = true;
            if (this.GetCurrentColumnValue("tur_id") != null)
            {
                tur_id = Convert.ToInt64(this.GetCurrentColumnValue("tur_id").ToString());
            }
            else
            {
                tur_id = 0;
            }
            if (this.GetCurrentColumnValue("tpc_id") != null)
            {
                tpc_id = Convert.ToInt32(this.GetCurrentColumnValue("tpc_id").ToString());
            }
            else
            {
                tpc_id = 0;
            }
            if (tur_id > 0 && tpc_id > 0)
            {
                int totalTurma = dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                                 .Any(p => Convert.ToInt64(p.Field <object>("tur_id")) == tur_id &&
                                      Convert.ToInt32(p.Field <object>("tpc_id")) == tpc_id &&
                                      p.Field <object>("totalTurma") != null &&
                                      Convert.ToInt32(p.Field <object>("totalTurma")) > 0) ?
                                 dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                                 .Where(p => Convert.ToInt64(p.Field <object>("tur_id")) == tur_id &&
                                        Convert.ToInt32(p.Field <object>("tpc_id")) == tpc_id &&
                                        p.Field <object>("totalTurma") != null &&
                                        Convert.ToInt32(p.Field <object>("totalTurma")) > 0)
                                 .FirstOrDefault().totalTurma : 0;

                xrChart1.Series.Clear();
                if (totalTurma > 0)
                {
                    List <string> lstFaixa = (from dadosGeral in dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                                              where Convert.ToInt64(dadosGeral.Field <object>("tur_id")) == tur_id &&
                                              Convert.ToInt32(dadosGeral.Field <object>("tpc_id")) == tpc_id &&
                                              dadosGeral.Field <object>("far_descricao") != null &&
                                              !string.IsNullOrEmpty(dadosGeral.Field <object>("far_descricao").ToString())
                                              group dadosGeral by new
                    {
                        descricao = dadosGeral.Field <object>("far_descricao") != null ?
                                    dadosGeral.Field <object>("far_descricao").ToString() : "",
                        ordenar = dadosGeral.Field <object>("far_descricao") != null ?
                                  dadosGeral.Field <object>("far_descricao").ToString() : ""
                    }
                                              into dadosGeralFaixa
                                              orderby dadosGeralFaixa.Key.ordenar.ToString()
                                              select dadosGeralFaixa.Key.descricao.ToString()).ToList();

                    foreach (string far_descricao in lstFaixa)
                    {
                        Series serie = new Series(far_descricao, ViewType.FullStackedBar);
                        serie.ArgumentScaleType = ScaleType.Auto;
                        ((FullStackedBarPointOptions)serie.Label.PointOptions).PercentOptions.ValueAsPercent = true;
                        serie.Label.PointOptions.ValueNumericOptions.Format    = NumericFormat.Percent;
                        serie.Label.PointOptions.ValueNumericOptions.Precision = 0;
                        serie.Label.TextColor = Color.Black;

                        serie.DataSource = (from dadosGeral in dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                                            where Convert.ToInt64(dadosGeral.Field <object>("tur_id")) == tur_id &&
                                            Convert.ToInt32(dadosGeral.Field <object>("tpc_id")) == tpc_id &&
                                            dadosGeral.Field <object>("far_descricao") != null &&
                                            dadosGeral.Field <object>("far_descricao").ToString() == far_descricao
                                            select dadosGeral).CopyToDataTable();
                        serie.ArgumentDataMember  = "dis_nome";
                        serie.LegendText          = far_descricao;
                        serie.ValueDataMembers[0] = "qtdAlunos";
                        serie.ShowInLegend        = true;

                        xrChart1.Series.Add(serie);
                    }

                    if (lstFaixa.Count > 0)
                    {
                        xrChart1.Legend.Direction = LegendDirection.BottomToTop;
                        (xrChart1.Diagram as XYDiagram).AxisY.Label.Angle = 0;
                        (xrChart1.Diagram as XYDiagram).AxisX.Label.Angle = 0;
                        (xrChart1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues(0, 1);
                        (xrChart1.Diagram as XYDiagram).AxisY.Label.NumericOptions.Format    = NumericFormat.Percent;
                        (xrChart1.Diagram as XYDiagram).AxisY.Label.NumericOptions.Precision = 0;
                        (xrChart1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues(0, 1);
                        (xrChart1.Diagram as XYDiagram).AxisY.WholeRange.AlwaysShowZeroLevel = true;
                        (xrChart1.Diagram as XYDiagram).Rotated = true;

                        int index = 0;
                        (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels.Add(new CustomAxisLabel(""));
                        (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels[index].AxisValue = -10 * 0.01;
                        index++;
                        for (int i = 0; i <= 100; i += 10)
                        {
                            (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels.Add(new CustomAxisLabel(i.ToString() + "%"));
                            (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels[index].AxisValue = i * 0.01;
                            index++;
                        }
                        (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels.Add(new CustomAxisLabel(""));
                        (xrChart1.Diagram as XYDiagram).AxisY.CustomLabels[index].AxisValue = 110 * 0.01;
                        index++;
                    }


                    List <string> lstCoresRelatorio = new List <string>();

                    //Carrega as faixas da turma com as cores
                    var lstFaixas = (from dadosGeral in dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                                     where Convert.ToInt64(dadosGeral.Field <object>("tur_id")) == tur_id &&
                                     Convert.ToInt32(dadosGeral.Field <object>("tpc_id")) == tpc_id
                                     group dadosGeral by new
                    {
                        far_ordenar = dadosGeral.Field <object>("far_ordenar") != null
                                                       ? dadosGeral.Field <object>("far_ordenar").ToString() : "",
                        far_cor = dadosGeral.Field <object>("far_cor") != null
                                                   ? dadosGeral.Field <object>("far_cor").ToString() : ""
                    } into faixas
                                     orderby faixas.Key.far_ordenar
                                     select faixas.Key);

                    //Se todas as faixas tiverem cores então vai usar as cores das faixas
                    if (!lstFaixas.Any(p => string.IsNullOrEmpty(p.far_cor)))
                    {
                        lstCoresRelatorio = lstFaixas.Select(p => p.far_cor).ToList();
                    }

                    //Se não carregou nenhuma cor das faixas então usa as cores configuradas para o relatório
                    if (lstCoresRelatorio.Count == 0)
                    {
                        lstCoresRelatorio = RelatoriosDevUtil.SelecionaCoresRelatorio((int)ReportNameGestaoAcademica.GraficoSinteseResultadosAvaliacaoTurmaMatrizCurricular).Select(p => p.cor_corPaleta).ToList();
                    }

                    Palette paletaCores = RelatoriosDevUtil.CarregarPaletaCoresRelatorio(lstCoresRelatorio);

                    if (paletaCores.Count > 0)
                    {
                        xrChart1.PaletteRepository.Add("Gestao", paletaCores);
                        xrChart1.PaletteName = "Gestao";
                    }
                    if (dsGestaoEscolar1.NEW_Relatorio_GrafTurmaMatrizCurricular.AsEnumerable()
                        .Any(p => Convert.ToInt64(p.Field <object>("tur_id")) == tur_id && Convert.ToInt32(p.Field <object>("tpc_id")) == tpc_id && Convert.ToInt64(p.Field <object>("qtdAlunos")) > 0 && p.esa_tipo != 1))
                    {
                        ((TextAnnotation)xrChart1.AnnotationRepository[0]).Text = "Conceitos";
                        xrChart1.Legend.Padding.Right = 3;
                    }
                    else
                    {
                        ((TextAnnotation)xrChart1.AnnotationRepository[0]).Text = "Faixas de notas";
                        xrChart1.Legend.Padding.Right = 20;
                    }
                }
                else
                {
                    xrPanel1.Visible = false;
                }
            }
            else
            {
                xrPanel1.Visible = false;
            }
        }