public DocumentacionRpt GetDocumentacionReport(AlumnoList list, PromocionList promociones)
        {
            if (list == null)
            {
                return(null);
            }

            DocumentacionRpt      doc   = new DocumentacionRpt();
            List <MatriculaPrint> pList = new List <MatriculaPrint>();
            PromocionInfo         promo;

            foreach (AlumnoInfo item in list)
            {
                //promo = promociones.GetItem(item.OidPromocion);
                if (promociones != null)
                {
                    pList.Add(MatriculaPrint.New(item));//, promo));
                }
            }

            doc.SetDataSource(pList);

            FormatReport(doc);

            return(doc);
        }
Example #2
0
        /// <summary>
        /// Implementa Save_button_Click
        /// </summary>
        protected override void SubmitAction()
        {
            AlumnoInfo    alumno    = TodosAlumno_CkB.Checked ? null : _alumno;
            PromocionInfo promocion = TodosPromocion_CkB.Checked ? null : _promocion;

            string filtro = GetFilterValues();

            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema, string.Empty, filtro);

            AlumnoList    alumnos = GetAlumnoList(alumno, promocion);
            PromocionList promos  = GetPromocionList(promocion);

            if (Documentos_CLB.GetItemCheckState(0) == CheckState.Checked)
            {
                MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }

            /*if (Documentos_CLB.GetItemCheckState(1) == CheckState.Checked)
             * {
             *  MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(list, promocion);
             *
             *  if (rpt != null)
             *  {
             *      ReportViewer.SetReport(rpt);
             *      ReportViewer.ShowDialog();
             *  }
             *  else
             *      MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
             * }*/

            if (Documentos_CLB.GetItemCheckState(2) == CheckState.Checked)
            {
                DocumentacionRpt rpt = reportMng.GetDocumentacionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }
            _action_result = DialogResult.OK;
        }
        private void FormatReport(DocumentacionRpt rpt)
        {
            string path = CompanyInfo.GetLogoPath(Schema.Oid);

            if (File.Exists(path))
            {
                Image image  = Image.FromFile(path);
                int   width  = rpt.Section1.ReportObjects["Logo"].Width;
                int   height = rpt.Section1.ReportObjects["Logo"].Height;

                rpt.Section1.ReportObjects["Logo"].Width  = 15 * image.Width;
                rpt.Section1.ReportObjects["Logo"].Height = 15 * image.Height;
                rpt.Section1.ReportObjects["Logo"].Left  += (width - 15 * image.Width) / 2;
                rpt.Section1.ReportObjects["Logo"].Top   += (height - 15 * image.Height) / 2;
            }
        }