public override global::System.Data.DataSet Clone() { ReportDS cln = ((ReportDS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public void FillODL_APERTI(ReportDS ds) { string select = @" SELECT * FROM $T{ODL_APERTI}"; using (DbDataAdapter da = BuildDataAdapter(select)) { da.Fill(ds.ODL_APERTI); } }
public void FillTV_SCADENZE_CLIFO(ReportDS ds) { string select = @" SELECT * FROM $T{TV_SCADENZE_CLIFO}"; using (DbDataAdapter da = BuildDataAdapter(select)) { da.Fill(ds.TV_SCADENZE_CLIFO); } }
private static List <ODLApertiModel> EstraiODlApertiPerPiegafilo() { string Reparto = Reparti.Stampaggio; List <string> fasi = new List <string>(); fasi.Add("PIEGF;"); fasi.Add("STAF;"); ReportDS ds = new ReportDS(); List <ODLApertiModel> odl = new List <ODLApertiModel>(); using (ReportWebBusiness bWebReport = new ReportWebBusiness()) { bWebReport.FillODL_APERTI(Reparto, TipoMovimentoFase.OrdineProduzione, ds); bWebReport.FillTV_SCADENZE_CLIFO(ds); } ReportDS.TV_SCADENZE_CLIFORow scadenza = ds.TV_SCADENZE_CLIFO.Where(x => x.CODICECLIFO.Trim() == Reparto).FirstOrDefault(); int ritardo = 2; if (scadenza != null) { ritardo = (int)scadenza.INTERVALLO_RITARDO; } foreach (ReportDS.ODL_APERTIRow odlAperto in ds.ODL_APERTI.Where(x => x.PIANIFICATO_SN == "No" && fasi.Contains(x.ELENCOFASI)).OrderBy(x => x.DATAFINE_ODL_E_MULTIPLA)) { ODLApertiModel model = new ODLApertiModel() { Azienda = odlAperto.IsAZIENDANull() ? string.Empty : odlAperto.AZIENDA, Articolo = odlAperto.IsMODELLO_LANCIONull() ? string.Empty : odlAperto.MODELLO_LANCIO, Commessa = odlAperto.IsNOMECOMMESSANull() ? string.Empty : odlAperto.NOMECOMMESSA, Segnalatore = odlAperto.IsSEGNALATORENull() ? string.Empty : odlAperto.SEGNALATORE, Fase = odlAperto.IsELENCOFASINull() ? string.Empty : odlAperto.ELENCOFASI, Brand = string.Empty, ODL = odlAperto.IsNUMMOVFASENull() ? string.Empty : odlAperto.NUMMOVFASE, QtaDaTerminare = odlAperto.IsQTANull() ? (decimal?)null : odlAperto.QTADATER, QtaTotale = odlAperto.IsQTADATERNull() ? (decimal?)null : odlAperto.QTA, Wip = odlAperto.IsMODELLO_WIPNull() ? string.Empty : odlAperto.MODELLO_WIP, DataFine = odlAperto.IsDATAFINE_ODL_E_MULTIPLANull() ? (DateTime?)null : odlAperto.DATAFINE_ODL_E_MULTIPLA, Priority = (int)Priorità.Bassa, DataCreazione = odlAperto.IsDATAINIZIO_ODLNull() ? (DateTime?)null : odlAperto.DATAINIZIO_ODL }; if (odlAperto.DATAFINE_ODL_E_MULTIPLA < DateTime.Today) { model.Priority = (int)Priorità.Alta; } if (odlAperto.DATAFINE_ODL_E_MULTIPLA >= DateTime.Today && odlAperto.DATAFINE_ODL_E_MULTIPLA < DateTime.Today.AddDays(ritardo)) { model.Priority = (int)Priorità.Media; } odl.Add(model); } return(odl); }
public void FillORDINIATTIVI(ReportDS ds) { string query = @"select * from ITUSER.ORDINIATTIVI "; using (DbDataAdapter da = BuildDataAdapter(query)) { da.Fill(ds.ORDINIATTIVI); } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { ReportDS ds = new ReportDS(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
protected void Page_Load(object sender, EventArgs e) { ds = new ReportDS(); ta = new ReportDSTableAdapters.VW_RequisitionsByEmployeeTableAdapter(); ta.Fill(ds.VW_RequisitionsByEmployee); DataView dv = ds.VW_RequisitionsByEmployee.DefaultView; dv.RowFilter = "departmentid =" + Utilities.Membership.GetCurrentLoggedInUser().DepartmentID; GridView1.DataSource = dv; DataBind(); }
protected void Page_Load(object sender, EventArgs e) { rep = new ReportDocument(); rep.Load(Server.MapPath("~/Print/Store/StationeryOrderedByCategory.rpt")); ds = new ReportDS(); vw_StationeryOrderedByCategoryTableAdapter ts = new vw_StationeryOrderedByCategoryTableAdapter(); ts.Fill(ds.vw_StationeryOrderedByCategory); dv = ds.vw_StationeryOrderedByCategory.DefaultView; GenerateReport(dv); }
protected void Page_Load(object sender, EventArgs e) { rep = new ReportDocument(); rep.Load(Server.MapPath("~/Print/Store/StationeryRequisitionTrendReportByDept.rpt")); ds = new ReportDS(); VW_StationeryRequisitionTrendByDepartmentTableAdapter ts = new VW_StationeryRequisitionTrendByDepartmentTableAdapter(); ts.Fill(ds.VW_StationeryRequisitionTrendByDepartment); dv = ds.VW_StationeryRequisitionTrendByDepartment.DefaultView; GenerateReport(dv); }
public void FillODL_APERTI(string codiceTipoMovimentoFase, ReportDS ds) { string select = @" SELECT * FROM $T{ODL_APERTI} WHERE CODTIPOMOVFASE = $P{CODTIPOMOVFASE}"; ParamSet ps = new ParamSet(); ps.AddParam("CODTIPOMOVFASE", DbType.String, codiceTipoMovimentoFase); using (DbDataAdapter da = BuildDataAdapter(select, ps)) { da.Fill(ds.ODL_APERTI); } }
protected void Page_Load(object sender, EventArgs e) { ds = new ReportDS(); ta = new ReportDSTableAdapters.StationeriesTableAdapter(); ta.Fill(ds.Stationeries); ReportDocument doc = new ReportDocument(); doc.Load(Server.MapPath("~/Print/Store/InventoryStatus.rpt")); doc.SetDataSource(ds); CrystalReportViewer1.ReportSource = doc; }
public void FillBOLLE_VENDITA(DateTime inizio, DateTime fine, ReportDS ds) { string query = @" select * from ituser.bolle_vendita where datdoc >= to_date('{0} 00:00:00','dd/mm/yyyy HH24:Mi:SS') and datdoc <= to_date('{1} 23:59:59','dd/mm/yyyy HH24:Mi:SS') order by azienda, numdoc,nrriga"; query = string.Format(query, inizio.ToString("dd/MM/yyyy"), fine.ToString("dd/MM/yyyy")); using (DbDataAdapter da = BuildDataAdapter(query)) { da.Fill(ds.BOLLE_VENDITA); } }
public List <string> EstraiRepartiODL_Aperti(ReportDS ds) { string query = @"select distinct ragionesoc from ituser.odl_aperti where datamovfase > to_date('31/12/2019','dd/mm/yyyy') ORDER BY RAGIONESOC"; using (DbCommand cmd = BuildCommand(query)) using (IDataReader reader = cmd.ExecuteReader()) { List <string> returnedData = new List <string>(); while (reader.Read()) { returnedData.Add(reader.GetString(0)); } return(returnedData); } }
protected void Page_Load(object sender, EventArgs e) { ds = new ReportDS(); ta = new ReportDSTableAdapters.VW_StationeryCatalogueTableAdapter(); ta.Fill(ds.VW_StationeryCatalogue); doc = new ReportDocument(); doc.Load(Server.MapPath("~/Print/Employee/PrintStationeryCatalogue.rpt")); if (!IsPostBack) { doc.SetDataSource(ds); } CrystalReportViewer1.ReportSource = doc; }
public static QuadrantiModel GetDatiPerQuadranti(string Reparto) { ReportDS ds = new ReportDS(); using (ReportWebBusiness bWebReport = new ReportWebBusiness()) { bWebReport.FillODL_APERTI(Reparto, TipoMovimentoFase.OrdineProduzione, ds); } QuadrantiModel model = new QuadrantiModel(); model.InScadenza = (int)ds.ODL_APERTI.Where(x => x.DATAFINE_ODL_E_MULTIPLA >= DateTime.Today && x.DATAFINE_ODL_E_MULTIPLA < DateTime.Today.AddDays(+2) && x.PIANIFICATO_SN == "No").Sum(x => x.QTADATER); model.Scaduti = (int)ds.ODL_APERTI.Where(x => x.DATAFINE_ODL_E_MULTIPLA < DateTime.Today).Sum(x => x.QTADATER); model.DaPrendereInCarico = (int)ds.ODL_APERTI.Where(x => x.IsDATAPRIMOINVIO_ODLNull() && !x.IsDATAMOVFASENull() && DateTime.Today.Subtract(x.DATAMOVFASE).TotalDays > 1 && x.PIANIFICATO_SN == "No").Sum(x => x.QTADATER); return(model); }
public void FillSALDIUBICAZIONI(string Articolo, ReportDS ds) { string query = @" select ma.modello,tm.codicemag, ITUSER.CLASSIFICA_MAGAZZINO(tm.codicemag ,'','', tm.destabmag ) categoria,val.costo1,sg.qesi, sg.qesi*val.costo1 valore, SG.QTOT_DISP_ESI from ditta1.saldi_gen sg inner join gruppo.magazz ma on ma.idmagazz = sg.idmagazz inner join gruppo.tabmag tm on tm.idtabmag = sg.idtabmag left outer join ditta1.USR_INVENTARIOs val on val.idmagazz = sg.idmagazz and val.idinventariot= '81af466b-104b-4ca9-998c-5bf5e4d22e0c' WHERE SG.QESI > 0 AND ma.MODELLO LIKE '{0}%' "; query = string.Format(query, Articolo); using (DbDataAdapter da = BuildDataAdapter(query)) { da.Fill(ds.SALDIUBICAZIONI); } }
public void FillREPORTQUANTITA(ReportDS ds) { string query = @" select CODICECLIFO, trim(ragionesoc) as RAGIONESOC,elencofasi, sum (qtadater) as SOMMA,round(sum (qtadater)/(select sum(qtadater) from ITUSER.odl_aperti where qtadater > 0 AND CODTIPOMOVFASE <>'ODP' and CODICECLIFO <>'02350' and datamovfase > to_date('31/12/2019','dd/mm/yyyy')),4)*100 as PERC from ITUSER.odl_aperti --where substr(codiceclifo,1,1)= '0' where datamovfase > to_date('31/12/2019','dd/mm/yyyy') and qtadater > 0 AND CODTIPOMOVFASE <>'ODP' and CODICECLIFO <>'02350' group by codiceclifo , ragionesoc,elencofasi order by sum(qta) desc"; using (DbDataAdapter da = BuildDataAdapter(query)) { da.Fill(ds.REPORTQUANTITA); } }
public void FillODL_APERTI(ReportDS ds, String reparto) { string select = @"select * from ituser.odl_aperti where datamovfase > to_date('31/12/2019','dd/mm/yyyy') AND CODTIPOMOVFASE <>'ODP'"; if (reparto != ElementiVuoti.TuttiReparti.ToString()) { select += " AND ragionesoc = $P<REPARTO> "; } select += " ORDER BY datamovfase"; ParamSet ps = new ParamSet(); ps.AddParam("REPARTO", DbType.String, reparto); using (DbDataAdapter da = BuildDataAdapter(select, ps)) { da.Fill(ds.ODL_APERTI); } }
public static List <ODLApertiModel> FillODLAperti(string Reparto) { ReportDS ds = new ReportDS(); List <ODLApertiModel> odl = new List <ODLApertiModel>(); switch (Reparto) { case Reparti.Piegafilo: odl = EstraiODlApertiPerPiegafilo(); break; case Reparti.Stampaggio: odl = EstraiODlApertiPerStampaggio(); break; default: odl = EstraiODlApertiDaRepartoStandard(Reparto); break; } return(odl); }
private void ReportPreview_Load(object sender, EventArgs e) { // Copy data to Data Temp ReportDS dsTemp = new ReportDS(); dsTemp.tbLand.ImportRow(tblReport.tbLand[0]); // Select data from Database dbConString.Chk_ConnectionState(); string sqlTmp = "SELECT * FROM uv_Timeline ORDER BY TimeLineDate, EvidenceCode, EvidenceName"; TimelineReport fReport = new TimelineReport(); DataSet Ds = new DataSet(); dbConString.Com = new SqlCommand(); dbConString.Com.CommandType = CommandType.Text; dbConString.Com.CommandText = sqlTmp; dbConString.Com.Connection = dbConString.mySQLConn; SqlCommand cmd = new SqlCommand(sqlTmp, dbConString.mySQLConn); SqlDataAdapter da = new SqlDataAdapter(cmd); tblReport.Clear(); da.Fill(tblReport, "uv_Timeline"); da.Dispose(); //// Import data from Data Temp to main dataset //tblReport.tbLand.ImportRow(dsTemp.tbLand[0]); fReport.SetDataSource(tblReport); fReport.SetParameterValue("VillageNo", dsTemp.tbLand[0].VillageNo.ToString()); fReport.SetParameterValue("VillageName", dsTemp.tbLand[0].VillageName.ToString()); fReport.SetParameterValue("SubDistrict", dsTemp.tbLand[0].SubDistrict.ToString()); fReport.SetParameterValue("District", dsTemp.tbLand[0].District.ToString()); fReport.SetParameterValue("Province", dsTemp.tbLand[0].Province.ToString()); crvTimeline.ReportSource = fReport; }
public void FillSALDIUBICAZIONI(String Articolo, ReportDS ds) { ReportAdapter r = new ReportAdapter(DbConnection, DbTransaction); r.FillSALDIUBICAZIONI(Articolo, ds); }
public void FillBOLLE_VENDITA(DateTime inizio, DateTime fine, ReportDS ds) { ReportAdapter r = new ReportAdapter(DbConnection, DbTransaction); r.FillBOLLE_VENDITA(inizio, fine, ds); }
public void FillREPORTQUANTITA(ReportDS ds) { ReportAdapter r = new ReportAdapter(DbConnection, DbTransaction); r.FillREPORTQUANTITA(ds); }
public void FillODL_APERTI(ReportDS ds, string reparto) { ReportAdapter a = new ReportAdapter(DbConnection, DbTransaction); a.FillODL_APERTI(ds, reparto); }
public byte[] ReportQuantitaExcel(ReportDS ds) { byte[] content; MemoryStream ms = new MemoryStream(); using (SpreadsheetDocument document = SpreadsheetDocument.Create(ms, SpreadsheetDocumentType.Workbook)) { WorkbookPart workbookPart = document.AddWorkbookPart(); workbookPart.Workbook = new Workbook(); WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>(); worksheetPart.Worksheet = new Worksheet(); // Adding style WorkbookStylesPart stylePart = workbookPart.AddNewPart <WorkbookStylesPart>(); stylePart.Stylesheet = GenerateStylesheet(); stylePart.Stylesheet.Save(); int numeroColonne = 4; Columns columns = new Columns(); for (int i = 0; i < numeroColonne; i++) { Column c = new Column(); UInt32Value u = new UInt32Value((uint)(i + 1)); c.Min = u; c.Max = u; c.Width = 15; columns.Append(c); } worksheetPart.Worksheet.AppendChild(columns); Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets()); Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Report" }; sheets.Append(sheet); workbookPart.Workbook.Save(); SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData()); // Constructing header Row row = new Row(); row.Append(ConstructCell("Codice", CellValues.String, 2)); row.Append(ConstructCell("Ragione Soc", CellValues.String, 2)); row.Append(ConstructCell("Somma", CellValues.String, 2)); row.Append(ConstructCell("Percentuale", CellValues.String, 2)); sheetData.AppendChild(row); foreach (ReportDS.REPORTQUANTITARow reportquantita in ds.REPORTQUANTITA) { Row rowDati = new Row(); rowDati.Append(ConstructCell(reportquantita.CODICECLIFO, CellValues.String, 1)); rowDati.Append(ConstructCell(reportquantita.RAGIONESOC, CellValues.String, 1)); rowDati.Append(ConstructCell(reportquantita.SOMMA.ToString(), CellValues.String, 1)); rowDati.Append(ConstructCell(reportquantita.PERC.ToString(), CellValues.String, 1)); sheetData.AppendChild(rowDati); } workbookPart.Workbook.Save(); document.Save(); document.Close(); ms.Seek(0, SeekOrigin.Begin); content = ms.ToArray(); } return(content); }
public byte[] BolleVenditaExcel(ReportDS ds) { byte[] content; MemoryStream ms = new MemoryStream(); using (SpreadsheetDocument document = SpreadsheetDocument.Create(ms, SpreadsheetDocumentType.Workbook)) { WorkbookPart workbookPart = document.AddWorkbookPart(); workbookPart.Workbook = new Workbook(); WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>(); worksheetPart.Worksheet = new Worksheet(); // Adding style WorkbookStylesPart stylePart = workbookPart.AddNewPart <WorkbookStylesPart>(); stylePart.Stylesheet = GenerateStylesheet(); stylePart.Stylesheet.Save(); int numeroColonne = 18; Columns columns = new Columns(); for (int i = 0; i < numeroColonne; i++) { Column c = new Column(); UInt32Value u = new UInt32Value((uint)(i + 1)); c.Min = u; c.Max = u; c.Width = 15; columns.Append(c); } worksheetPart.Worksheet.AppendChild(columns); Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets()); Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Bolle vendita" }; sheets.Append(sheet); workbookPart.Workbook.Save(); SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData()); // Constructing header Row row = new Row(); row.Append(ConstructCell("Azienda", CellValues.String, 2)); row.Append(ConstructCell("Tipo", CellValues.String, 2)); row.Append(ConstructCell("Causale", CellValues.String, 2)); row.Append(ConstructCell("Documento", CellValues.String, 2)); row.Append(ConstructCell("Data documento", CellValues.String, 2)); row.Append(ConstructCell("Numero documento", CellValues.String, 2)); row.Append(ConstructCell("Segnalatore", CellValues.String, 2)); row.Append(ConstructCell("Cliente", CellValues.String, 2)); row.Append(ConstructCell("Riga", CellValues.String, 2)); row.Append(ConstructCell("Modello", CellValues.String, 2)); row.Append(ConstructCell("Quantità", CellValues.String, 2)); row.Append(ConstructCell("Prezzo", CellValues.String, 2)); row.Append(ConstructCell("Valore", CellValues.String, 2)); row.Append(ConstructCell("Ordine cliente", CellValues.String, 2)); row.Append(ConstructCell("Data ordine", CellValues.String, 2)); row.Append(ConstructCell("Data richiesta", CellValues.String, 2)); row.Append(ConstructCell("Data conferma", CellValues.String, 2)); row.Append(ConstructCell("Riferimento", CellValues.String, 2)); sheetData.AppendChild(row); foreach (ReportDS.BOLLE_VENDITARow bolla in ds.BOLLE_VENDITA) { Row rowDati = new Row(); rowDati.Append(ConstructCell(bolla.IsAZIENDANull() ? string.Empty : bolla.AZIENDA, CellValues.String, 1)); rowDati.Append(ConstructCell(string.Format("{0}-{1}", bolla.CODICETIPOO, bolla.DESTABTIPOO), CellValues.String, 1)); rowDati.Append(ConstructCell(string.Format("{0}-{1}", bolla.CODICECAUTR, bolla.DESTABCAUTR), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.FULLNUMDOC, CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.DATDOC.ToString("dd/MM/yyyy"), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.NUMDOC, CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.IsSEGNALATORE_RSNull() ? string.Empty : bolla.SEGNALATORE_RS.Trim(), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.RAGIONESOC.Trim(), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.NRRIGA, CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.MODELLO, CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.QTATOT.ToString().Replace(',', '.'), CellValues.Number, 1)); rowDati.Append(ConstructCell(bolla.PREZZOTOT.ToString().Replace(',', '.'), CellValues.Number, 1)); rowDati.Append(ConstructCell(bolla.VALORE.ToString().Replace(',', '.'), CellValues.Number, 1)); rowDati.Append(ConstructCell(bolla.IsFULLNUMDOC_OCNull() ? string.Empty : bolla.FULLNUMDOC_OC, CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.IsDATDOC_OCNull() ? string.Empty : bolla.DATDOC_OC.ToString("dd/MM/yyyy"), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.IsDATA_RICHIESTANull() ? string.Empty : bolla.DATA_RICHIESTA.ToString("dd/MM/yyyy"), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.IsDATA_CONFERMANull() ? string.Empty : bolla.DATA_CONFERMA.ToString("dd/MM/yyyy"), CellValues.String, 1)); rowDati.Append(ConstructCell(bolla.IsRIFERIMENTONull() ? string.Empty : bolla.RIFERIMENTO, CellValues.String, 1)); sheetData.AppendChild(rowDati); } workbookPart.Workbook.Save(); document.Save(); document.Close(); ms.Seek(0, SeekOrigin.Begin); content = ms.ToArray(); } return(content); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ReportDS ds = new ReportDS(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "ReportTableDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public void FillODL_APERTI(string reparto, string codiceTipoMovimentoFase, ReportDS ds) { ReportWebAdapter a = new ReportWebAdapter(DbConnection, DbTransaction); a.FillODL_APERTI(reparto, codiceTipoMovimentoFase, ds); }
public List <string> EstraiReportQuantita(ReportDS ds) { ReportAdapter a = new ReportAdapter(DbConnection, DbTransaction); return(a.EstraiRepartiODL_Aperti(ds)); }
public void FillORDINIATTIVI(ReportDS ds) { ReportAdapter a = new ReportAdapter(DbConnection, DbTransaction); a.FillORDINIATTIVI(ds); }
public void FillODL_APERTI(ReportDS ds) { ReportWebAdapter a = new ReportWebAdapter(DbConnection, DbTransaction); a.FillODL_APERTI(ds); }
public byte[] CaricoLavoroExcel(ReportDS ds) { byte[] content; MemoryStream ms = new MemoryStream(); using (SpreadsheetDocument document = SpreadsheetDocument.Create(ms, SpreadsheetDocumentType.Workbook)) { WorkbookPart workbookPart = document.AddWorkbookPart(); workbookPart.Workbook = new Workbook(); WorksheetPart worksheetPart = workbookPart.AddNewPart <WorksheetPart>(); worksheetPart.Worksheet = new Worksheet(); // Adding style WorkbookStylesPart stylePart = workbookPart.AddNewPart <WorkbookStylesPart>(); stylePart.Stylesheet = GenerateStylesheet(); stylePart.Stylesheet.Save(); int numeroColonne = 38; Columns columns = new Columns(); for (int i = 0; i < numeroColonne; i++) { Column c = new Column(); UInt32Value u = new UInt32Value((uint)(i + 1)); c.Min = u; c.Max = u; c.Width = 15; columns.Append(c); } worksheetPart.Worksheet.AppendChild(columns); Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets()); Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "Carico lavoro" }; sheets.Append(sheet); workbookPart.Workbook.Save(); SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData()); // Constructing header Row row = new Row(); row.Append(ConstructCell("Azienda", CellValues.String, 2)); row.Append(ConstructCell("Tipo Lancio", CellValues.String, 2)); row.Append(ConstructCell("Codice", CellValues.String, 2)); row.Append(ConstructCell("Codiceclifo", CellValues.String, 2)); row.Append(ConstructCell("Ragione Soc", CellValues.String, 2)); row.Append(ConstructCell("nummovfase", CellValues.String, 2)); row.Append(ConstructCell("pianificato_sn", CellValues.String, 2)); row.Append(ConstructCell("NomeCommessa", CellValues.String, 2)); row.Append(ConstructCell("segnalatore", CellValues.String, 2)); row.Append(ConstructCell("Codtipomovfase", CellValues.String, 2)); row.Append(ConstructCell("destipomovfase", CellValues.String, 2)); row.Append(ConstructCell("Modello_lancio", CellValues.String, 2)); row.Append(ConstructCell("Desmodello_lancio", CellValues.String, 2)); row.Append(ConstructCell("Idmagazz", CellValues.String, 2)); row.Append(ConstructCell("Modello_wip", CellValues.String, 2)); row.Append(ConstructCell("Desmodello_wip", CellValues.String, 2)); row.Append(ConstructCell("Elencofasi", CellValues.String, 2)); row.Append(ConstructCell("datamovfase", CellValues.String, 2)); row.Append(ConstructCell("Datainizio_odl", CellValues.String, 2)); row.Append(ConstructCell("Dataprimoinvio_odl", CellValues.String, 2)); row.Append(ConstructCell("Documenti_invio", CellValues.String, 2)); row.Append(ConstructCell("Datafine_odl_e_multipla", CellValues.String, 2)); row.Append(ConstructCell("Datafine_fasecommessa", CellValues.String, 2)); row.Append(ConstructCell("Conta_multiple", CellValues.String, 2)); row.Append(ConstructCell("Codiceunimi", CellValues.String, 2)); row.Append(ConstructCell("Qta", CellValues.String, 2)); row.Append(ConstructCell("qtadater", CellValues.String, 2)); row.Append(ConstructCell("Priorita", CellValues.String, 2)); row.Append(ConstructCell("Noteparticolarifase", CellValues.String, 2)); row.Append(ConstructCell("Notaparticolareodl", CellValues.String, 2)); row.Append(ConstructCell("Modello_lancio_mp", CellValues.String, 2)); row.Append(ConstructCell("Desmodello-lancio_mp", CellValues.String, 2)); row.Append(ConstructCell("Impegnatoareparto", CellValues.String, 2)); row.Append(ConstructCell("Internoesterno", CellValues.String, 2)); row.Append(ConstructCell("Fermounasettimana", CellValues.String, 2)); row.Append(ConstructCell("Scaduto", CellValues.String, 2)); row.Append(ConstructCell("Annocarico", CellValues.String, 2)); row.Append(ConstructCell("Settimanacarico", CellValues.String, 2)); row.Append(ConstructCell("Apertodaduegiorni", CellValues.String, 2)); row.Append(ConstructCell("Nota", CellValues.String, 2)); row.Append(ConstructCell("Appoggio", CellValues.String, 2)); sheetData.AppendChild(row); foreach (ReportDS.ODL_APERTIRow odl_aperto in ds.ODL_APERTI) { Row rowDati = new Row(); rowDati.Append(ConstructCell(odl_aperto.IsAZIENDANull() ? string.Empty : odl_aperto.AZIENDA, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDESTIPOLANCIONull() ? string.Empty : odl_aperto.DESTIPOLANCIO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsCODICETIPOONull() ? string.Empty : odl_aperto.CODICETIPOO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsCODICECLIFONull() ? string.Empty : odl_aperto.CODICECLIFO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsRAGIONESOCNull() ? string.Empty : odl_aperto.RAGIONESOC, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsNUMMOVFASENull() ? string.Empty : odl_aperto.NUMMOVFASE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsPIANIFICATO_SNNull() ? string.Empty : odl_aperto.PIANIFICATO_SN, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsNOMECOMMESSANull() ? string.Empty : odl_aperto.NOMECOMMESSA, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsSEGNALATORENull() ? string.Empty : odl_aperto.SEGNALATORE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsCODTIPOMOVFASENull() ? string.Empty : odl_aperto.CODTIPOMOVFASE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDESTIPOMOVFASENull() ? string.Empty : odl_aperto.DESTIPOMOVFASE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsMODELLO_LANCIONull() ? string.Empty : odl_aperto.MODELLO_LANCIO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDESMODELLO_LANCIONull() ? string.Empty : odl_aperto.DESMODELLO_LANCIO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsIDMAGAZZ_WIPNull() ? string.Empty : odl_aperto.IDMAGAZZ_WIP, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsMODELLO_WIPNull() ? string.Empty : odl_aperto.MODELLO_WIP, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDESMODELLO_WIPNull() ? string.Empty : odl_aperto.DESMODELLO_WIP, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsELENCOFASINull() ? string.Empty : odl_aperto.ELENCOFASI, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDATAMOVFASENull() ? string.Empty : odl_aperto.DATAMOVFASE.ToShortDateString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDATAINIZIO_ODLNull() ? string.Empty : odl_aperto.DATAINIZIO_ODL.ToShortDateString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDATAPRIMOINVIO_ODLNull() ? string.Empty : odl_aperto.DATAPRIMOINVIO_ODL.ToShortDateString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDOCUMENTI_INVIONull() ? string.Empty : odl_aperto.DOCUMENTI_INVIO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDATAFINE_ODL_E_MULTIPLANull() ? string.Empty : odl_aperto.DATAFINE_ODL_E_MULTIPLA.ToShortDateString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDATAFINE_FASECOMMESSANull() ? string.Empty : odl_aperto.DATAFINE_FASECOMMESSA.ToShortDateString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsCONTA_MULTIPLENull() ? string.Empty : odl_aperto.CONTA_MULTIPLE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsCODICEUNIMINull() ? string.Empty : odl_aperto.CODICEUNIMI, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsQTANull() ? string.Empty : odl_aperto.QTA.ToString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsQTADATERNull() ? string.Empty : odl_aperto.QTADATER.ToString(), CellValues.Number, 1)); rowDati.Append(ConstructCell(odl_aperto.IsPRIORITANull() ? string.Empty : odl_aperto.PRIORITA.ToString(), CellValues.Number, 1)); rowDati.Append(ConstructCell(odl_aperto.IsNOTEPARTICOLARIFASENull() ? string.Empty : odl_aperto.NOTEPARTICOLARIFASE, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsNOTAPARTICOLAREODLNull() ? string.Empty : odl_aperto.NOTAPARTICOLAREODL, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsMODELLO_LANCIO_MPNull() ? string.Empty : odl_aperto.MODELLO_LANCIO_MP, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsDESMODELLO_LANCIO_MPNull() ? string.Empty : odl_aperto.DESMODELLO_LANCIO_MP, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsIMPEGNATOAREPARTONull() ? string.Empty : odl_aperto.IMPEGNATOAREPARTO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsINTERNOESTERNONull() ? string.Empty : odl_aperto.INTERNOESTERNO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsFERMOUNASETTIMANANull() ? string.Empty : odl_aperto.FERMOUNASETTIMANA, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsSCADUTONull() ? string.Empty : odl_aperto.SCADUTO, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsANNOCARICONull() ? string.Empty : odl_aperto.ANNOCARICO.ToString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsSETTIMANACARICONull() ? string.Empty : odl_aperto.SETTIMANACARICO.ToString(), CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsAPERTODADUEGIORNINull() ? string.Empty : odl_aperto.APERTODADUEGIORNI, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsNOTANull() ? string.Empty : odl_aperto.NOTA, CellValues.String, 1)); rowDati.Append(ConstructCell(odl_aperto.IsAPPOGGIONull() ? string.Empty : odl_aperto.APPOGGIO, CellValues.String, 1)); sheetData.AppendChild(rowDati); } workbookPart.Workbook.Save(); document.Save(); document.Close(); ms.Seek(0, SeekOrigin.Begin); content = ms.ToArray(); } return(content); }
public void FillTV_SCADENZE_CLIFO(ReportDS ds) { ReportWebAdapter a = new ReportWebAdapter(DbConnection, DbTransaction); a.FillTV_SCADENZE_CLIFO(ds); }