public EstadisticaExamenRpt GetEstadisticaReport(ExamenInfo item, EstadisticaExamenList lista, CompanyInfo empresa) { if (item == null) { return(null); } EstadisticaExamenRpt doc = new EstadisticaExamenRpt(); List <ExamenPrint> pList = new List <ExamenPrint>(); List <EstadisticaExamenInfo> preguntas = new List <EstadisticaExamenInfo>(); foreach (EstadisticaExamenInfo info in lista) { preguntas.Add(info); } //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports if (preguntas.Count <= 0) { return(null); } pList.Add(item.GetPrintObject(empresa, string.Empty)); doc.SetDataSource(pList); doc.Subreports["EstadisticaExamenListSubRpt"].SetDataSource(preguntas); //FormatReport(doc); return(doc); }
private void Estadisticas_BT_Click(object sender, EventArgs e) { if (EntityInfo.FechaEmision.Date > DateTime.Today.Date) { MessageBox.Show(Resources.Messages.EXAMEN_NO_EMITIDO); return; } if (!EntityInfo.Desarrollo) { EstadisticaExamenList estadisticas = EstadisticaExamenList.GetList(Entity); ShowChartAction(estadisticas); ExamenReportMng reportMng = new ExamenReportMng(AppContext.ActiveSchema); EstadisticaExamenRpt rpt = reportMng.GetEstadisticaReport(EntityInfo, estadisticas, CompanyInfo.Get(AppContext.ActiveSchema.Oid, false)); ReportViewer.SetReport(rpt); ReportViewer.ShowDialog(); } }