diff --git a/GMW/GMW_data/reportExporter.cs b/GMW/GMW_data/reportExporter.cs deleted file mode 100644 index 2b49a5ff..00000000 --- a/GMW/GMW_data/reportExporter.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Data; -using System.Drawing.Imaging; -using System.Drawing.Printing; -using System.Windows.Forms; -using Microsoft.Reporting.WinForms; -using System.Configuration; -using SteamWare; -using GMW_data; - -/// -/// Classe che restituisce uno stream ed i dati accessori per reinviare un report in pdf -/// -public class reportExporter -{ - /// - /// mimeType del report - /// - public string mimeType; - /// - /// encoding dei dati - /// - public string encoding; - /// - /// nome estensione - /// - public string fileNameExtension; - /// - /// steam di bytes del report - /// - public byte[] renderedBytes; - /// - /// metodo protected - /// - public reportExporter() - { - } - /// - /// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...) - /// - /// tipo di report richiesto - /// cod UDC - /// tabella dati - private DataTable caricaDati(reportRichiesto tipoReport, string UDC) - { - DataTable tab = new DataTable(); - switch (tipoReport) - { - //case reportRichiesto.CartellinoPesa: - // tab = (DataTable)GMW_data.DataProxy.obj.taCartellini.getByUdc(UDC); - // break; - case reportRichiesto.CartellinoTara: - tab = (DataTable)GMW_data.DataProxy.obj.taCartellini.stp_getByUdc(UDC); - break; - default: - break; - } - return tab; - } - /// - /// renderizza il report in pdf - /// - /// report ammessi: RichiestaIntervento - /// cod UDC - /// parametri "device input" - /// - public void popolaPdfStream(reportRichiesto tipoReport, string UDC, devInfoParam deviceInfoParam) - { - LocalReport report = new LocalReport(); - string deviceInfo = ""; - ReportParameter[] _UDC = { new ReportParameter("UDC", UDC) }; - switch (tipoReport) - { - case reportRichiesto.CartellinoPesa: - report.ReportPath = @".\Reports\CartellinoCompleto.rdlc"; - report.DataSources.Add(new ReportDataSource(memLayer.ML.confReadString("ReportDatasource"), caricaDati(tipoReport, UDC))); - deviceInfo = deviceInfoParam.xmlParam; - break; - case reportRichiesto.CartellinoTara: - report.ReportPath = @".\Reports\CartellinoTara.rdlc"; - report.DataSources.Add(new ReportDataSource(memLayer.ML.confReadString("ReportDatasource"), caricaDati(tipoReport, UDC))); - deviceInfo = deviceInfoParam.xmlParam; - break; - default: - break; - } - createPdfStream(report, deviceInfo); - } - - /// - /// crea il vero e proprio stream pdf - /// - /// - /// - private void createPdfStream(LocalReport report, string deviceInfo) - { - // export in PDF - string reportType = "PDF"; - Warning[] warnings; - string[] streams; - renderedBytes = report.Render( - reportType, - deviceInfo, - out mimeType, - out encoding, - out fileNameExtension, - out streams, - out warnings); - } - -} -