13 Programación Web con .NET y C#
Transcript of 13 Programación Web con .NET y C#
![Page 2: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/2.jpg)
Crystal Reports Referencias
CrystalDecisions.SharedCrystalDecisions.ReportSourceCrystalDecisions.CrystalReports.Engine
![Page 3: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/3.jpg)
Crystal Reports (Cont.)ReportClass rpt = new ReportClass();rpt.FileName = Server.MapPath("report.rpt");rpt.Load();rpt.SetDataSource(db.PERSONAS);Stream stream = rpt.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
return File(stream, "application/pdf");
![Page 4: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/4.jpg)
Crystal Reports (Cont.) Parametros
rpt.SetParameterValue(“p",“valor");
![Page 5: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/5.jpg)
RPLCLocalReport reporte= new LocalReport();reporte.ReportPath = "Reports/Report1.rdlc";ReportDataSource reportDataSource =
new ReportDataSource("DataSet1", db);reporte.DataSources.Add(reportDataSource);
![Page 6: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/6.jpg)
RDLC (Cont.)string deviceInfo =
"<DeviceInfo>" +" <OutputFormat>PDF</OutputFormat>" +" <PageWidth>8.5in</PageWidth>" +" <PageHeight>11in</PageHeight>" +" <MarginTop>0.5in</MarginTop>" +" <MarginLeft>1in</MarginLeft>" +" <MarginRight>1in</MarginRight>" +" <MarginBottom>0.5in</MarginBottom>" +"</DeviceInfo>";
![Page 7: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/7.jpg)
RDLC (Cont.)byte[] renderedBytes = reporte.Render(
reportType,deviceInfo,out mimeType,out encoding,out fileNameExtension,out streams, //string[]out warnings); //Warning[]
return File(renderedBytes, mimeType);
![Page 8: 13 Programación Web con .NET y C#](https://reader036.fdocuments.co/reader036/viewer/2022082905/58772dc51a28ab2b2c8b645b/html5/thumbnails/8.jpg)
RDLC (Cont.) Referencias
Microsoft.ReportViewer.WebForms Parámetros
reporte.SetParameters(new ReportParameter(“p",“valor"));
Descargar ArchivoResponse.AddHeader("content-disposition",
"attachment; filename=reporte." + fileNameExtension);