public byte[] GenerateCertificate(vResultList participantResult, out string mimeType) { ReportViewer reportViewer = new ReportViewer(); string format = "PDF"; //domyslnie format pdf List <vResultList> dbResult = new List <vResultList>(); dbResult.Add(participantResult); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.SizeToReportContent = true; reportViewer.LocalReport.ReportPath = @"Reports\ParticipantResult.rdlc"; // reportViewer.LocalReport.ReportPath = @"~\ParticipantResult.rdlc"; reportViewer.LocalReport.DataSources.Add(new ReportDataSource("listawynikow", dbResult)); string encoding; string filenameExtension; string[] streams; Warning[] warnings; byte[] streamBytes; try { streamBytes = reportViewer.LocalReport.Render(format, null, out mimeType, out encoding, out filenameExtension, out streams, out warnings); } catch (Exception ex) { string er = ex.InnerException.Message; byte[] tabEmpty = new byte[1]; mimeType = "pusto"; return(tabEmpty); } return(streamBytes); }
public byte[] GenerateCertificate(vResultList participantResult, out string mimeType) { throw new NotImplementedException(); }