private void frmReporte_Load(object sender, EventArgs e)
{
DateTime fecha = Convert.ToDateTime("26/11/2010");
List
<string> lista
= new GenMailNotasNG
().notas_cliente(conexionOracle,fecha
); foreach (string nota in lista)
{
this.reportViewer1.ProcessingMode = ProcessingMode.Local;
this.reportViewer1.LocalReport.ReportPath = pathReportes;
try
{
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource
("dsReporte_dtNota",
new GenMailNotasNG
().obtenerNota(conexionOracle,nota
))); } catch (Exception ex)
{
MessageBox.Show(ex.Message + "n" + ex.Source, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
this.reportViewer1.RefreshReport();
byte[] bytes = reportViewer1.LocalReport.Render("PDF", null, out mimeType,
out encoding, out extension, out streamids, out warnings);
FileStream fs
= new FileStream
(@"c:\tmp\"+nota
+@".pdf", FileMode
.Create); fs.Write(bytes, 0, bytes.Length);
fs.Close();
}
}