From 2095a7bb968f0f393f8adb1e8d7da27c358d28b6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 17 Oct 2017 14:32:39 +0200 Subject: [PATCH] Fix filtri in export excel x MtzProg --- .vs/WebGIM/v15/sqlite3/storage.ide | Bin 3039232 -> 3039232 bytes GIM_site/ExcelExportMtzPrev.aspx | 125 +++++----- GIM_site/ExcelExportMtzPrev.aspx.cs | 213 +++++++++--------- GIM_site/ExcelExportMtzPrev.aspx.designer.cs | 41 ++-- GIM_site/ExcelExportMtzPrevPending.aspx.cs | 142 ++++++------ ...ExcelExportMtzPrevPending.aspx.designer.cs | 28 +-- 6 files changed, 270 insertions(+), 279 deletions(-) diff --git a/.vs/WebGIM/v15/sqlite3/storage.ide b/.vs/WebGIM/v15/sqlite3/storage.ide index b191515646b21f71d593a8e53a8fd2272423bb14..f647269f02fccf86cc87de31fd516a3f2ae18554 100644 GIT binary patch delta 8819 zcmeHNc~nzZx4-8OxtVUl5E23;3@U*bkUDmuu?o0Z#2a}2m8!;*WD+4zXA^de>oZk zPDqVHg#tu3Ze zWQixNJ*mm>WNu+Ev@9=EC}}oA!&i(ew~s%=eJryGHUXs+F7^);;@F2(Nu(1I!8BXx zoNSzFuD+{jtt^z2YBn}qj ziD}U_Q588vv_Z5`lp^#O%7_bsKLxi17X=eYK$Q-EjT5QkiuzaK&afA(AefoHRKyc85S6G zaUWtZ4quK0o;)zjj~I@_@A}~?Htk*Tu^UZVusl2vgYp_s<4>2-v*=hlgj5huh&o~i zQ9{fl^h8&J!mr~;@wIpkJ`@i`+usk6o+JvKch7#>{>RM5)=JV<|H3=S*8(2fXRDn&f(k&1}2 zG2C&`lihU&Oy;v>Ie6KFW-73B5P`wqVi1E%Z^L=TU>P?lUvdKT$jnYngs+N$n&f`5 zJ|<8s=3HVh(obfcQYC_4mx33Zl}5ugM}V7E`cw>?%fNF9(oVyTPBo%k#;rHg6gV;c zU;`kXkWN$+=!T2VLTwXR%N}n6lW3ecV6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%5#|t?%i*u{}3*epa-AR!DtUC-Z;o-}@ROEh5 zqo24bqA5HSF%+>B{VDDvellRwO5K+wGyFx_6(wa*_h+Y_^uOW!%0#<3gS598?JW{! z=DyLATi-a%!ZutPM?>ee|Am*4)-a z;|P8+cZ{~KIk*#2LS7qf4$t!eHy0eKCi5@|@d+7f`Lx5lF0TmBj7Z!Hf%L?!#GRH{ z%Cb|rdT9R4y8ymo9g%S3m{X+hpQwk>Oj_~DN$zLf6$n!I zc~_EY2fb@pmRS|1zGvouC&TV&tUBtYh$mG?6PilKpzVy6$z(*cVWol7FJm%wd$d1k z(@YPef8Y*bq46c=uI7wpJinGZ!$q)FsxufSFdS#z8>zq0e9E~VDql$$fSDF3IpKU6 zj^@}TezW)rGXdI;IL50S8{y91lPqd;kf7^~^QFEHAuw+Syj(D^&pai?ZG_v^oFzyr9C!W-{(zqFib6_h*$qSy8VG4DFj&0)<{(uplsuQuQg6 z8gHoIH!1M2CK%SZB3?D*WJ8*#^!-xrJO#lB3@La~`* z6U8e(LmjJg>Kf(2Gbt`nT&B1}ahl=`#aW7T6z69qm&`9+2x<9pwK8yL80l$}2beIv zKsZkXRoqLsl!%}Dj(1UsxoshKU)GDQ|X + Inherits="GIM_site.ExcelExportMtzPrev" %> - + -
-
- - - - - - - - - - - - - - - - - - - - - - <%--DataFormatString="{0:dd/MM/yy}" --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+
+
+ + + + + + + + + + + + + + + + + + + + + + <%--DataFormatString="{0:dd/MM/yy}" --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/GIM_site/ExcelExportMtzPrev.aspx.cs b/GIM_site/ExcelExportMtzPrev.aspx.cs index df892071..a98c70a 100644 --- a/GIM_site/ExcelExportMtzPrev.aspx.cs +++ b/GIM_site/ExcelExportMtzPrev.aspx.cs @@ -6,118 +6,111 @@ using System.Web.UI.WebControls; namespace GIM_site { - public partial class ExcelExportMtzPrev : System.Web.UI.Page + public partial class ExcelExportMtzPrev : System.Web.UI.Page + { + /// + /// evento dati associati a controllo + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) { - /// - /// evento dati associati a controllo - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) + if (grView.Rows.Count > 0) + { + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) { - if (grView.Rows.Count > 0) - { - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) - { - try - { - cella.Text = traduci(cella.Text); - } - catch - { } - } - } + try + { + cella.Text = traduci(cella.Text); + } + catch + { } } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// fix rendering tabelle standard in webform - /// - /// - public override void VerifyRenderingInServerForm(Control control) - { - // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. - } - /// - /// Si occupa di rendere l'out HTML come excel file (mimetype) - /// - private void doExport() - { - Response.Clear(); - Response.AddHeader("content-disposition", "attachment; filename=SchemaInterventi.xls"); - Response.Charset = ""; - // If you want the option to open the Excel file without saving than - // comment out the line below - Response.Cache.SetCacheability(HttpCacheability.NoCache); - Response.ContentType = "application/vnd.xls"; - System.IO.StringWriter stringWrite = new System.IO.StringWriter(); - System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); - grView.RenderControl(htmlWrite); - Response.Write(stringWrite.ToString()); - Response.End(); - } -#if false - /// - /// restituisce la data formattata coem da web.config - /// - /// - /// - public string dtFormat(string key) - { - return memLayer.ML.CRS("key"); - } -#endif - - #region area protected - - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - aggiornamento(); - doExport(); - } - } - - #endregion - - - public void aggiornamento() - { - grView.AllowPaging = false; - checkFixOds(); - ods.DataBind(); - grView.DataBind(); - } - - /// - /// sistemo filtraggio con valori selezionati - /// - private void checkFixOds() - { - ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )"; - if (memLayer.ML.isInSessionObject("idxTipo_filt")) - { - ods.FilterExpression += " AND (idxTipo = {1})"; - } - if (memLayer.ML.isInSessionObject("idxMacchina_filt")) - { - ods.FilterExpression += " AND (idxMacchina = {2})"; - } - } - + } } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// fix rendering tabelle standard in webform + /// + /// + public override void VerifyRenderingInServerForm(Control control) + { + // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. + } + /// + /// Si occupa di rendere l'out HTML come excel file (mimetype) + /// + private void doExport() + { + Response.Clear(); + Response.AddHeader("content-disposition", "attachment; filename=SchemaInterventi.xls"); + Response.Charset = ""; + // If you want the option to open the Excel file without saving than + // comment out the line below + Response.Cache.SetCacheability(HttpCacheability.NoCache); + Response.ContentType = "application/vnd.xls"; + System.IO.StringWriter stringWrite = new System.IO.StringWriter(); + System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); + grView.RenderControl(htmlWrite); + Response.Write(stringWrite.ToString()); + Response.End(); + } + + #region area protected + + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + aggiornamento(); + doExport(); + } + } + + #endregion + + + public void aggiornamento() + { + grView.AllowPaging = false; + checkFixOds(); + ods.DataBind(); + grView.DataBind(); + } + + /// + /// sistemo filtraggio con valori selezionati + /// + private void checkFixOds() + { + ods.FilterExpression = "( codMacchina LIKE '%{0}%' OR nomeMacchina LIKE '%{0}%' OR descrizione LIKE '%{0}%' )"; + if (memLayer.ML.isInSessionObject("idxTipo_filt")) + { + ods.FilterExpression += " AND (idxTipo = {1})"; + } + if (memLayer.ML.isInSessionObject("idxImpianto_filt")) + { + ods.FilterExpression += " AND (idxImpianto = {2})"; + } + if (memLayer.ML.isInSessionObject("idxMacchina_filt")) + { + ods.FilterExpression += " AND (idxMacchina = {3})"; + } + } + + } } \ No newline at end of file diff --git a/GIM_site/ExcelExportMtzPrev.aspx.designer.cs b/GIM_site/ExcelExportMtzPrev.aspx.designer.cs index 29320d2..7832d9f 100644 --- a/GIM_site/ExcelExportMtzPrev.aspx.designer.cs +++ b/GIM_site/ExcelExportMtzPrev.aspx.designer.cs @@ -1,51 +1,50 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace GIM_site -{ - - +namespace GIM_site { + + public partial class ExcelExportMtzPrev { /// - /// Head1 control. + /// Controllo Head1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; /// - /// form1 control. + /// Controllo form1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// - /// grView control. + /// Controllo grView. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.GridView grView; /// - /// ods control. + /// Controllo ods. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; } diff --git a/GIM_site/ExcelExportMtzPrevPending.aspx.cs b/GIM_site/ExcelExportMtzPrevPending.aspx.cs index 1130238..987b7d2 100644 --- a/GIM_site/ExcelExportMtzPrevPending.aspx.cs +++ b/GIM_site/ExcelExportMtzPrevPending.aspx.cs @@ -6,84 +6,84 @@ using System.Web.UI.WebControls; public partial class ExcelExportMtzPrevPending : System.Web.UI.Page { - /// - /// evento dati associati a controllo - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) + /// + /// evento dati associati a controllo + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) { - if (grView.Rows.Count > 0) + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) - { - try - { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); - } - catch - { } - } + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); } + catch + { } + } } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + + /// + /// fix x export excel + /// + /// + public override void VerifyRenderingInServerForm(Control control) + { + // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. + } + + private void doExport() + { + Response.Clear(); + Response.AddHeader("content-disposition", "attachment; filename=InterventiProgrammati.xls"); + Response.Charset = ""; + // If you want the option to open the Excel file without saving than + // comment out the line below + Response.Cache.SetCacheability(HttpCacheability.NoCache); + Response.ContentType = "application/vnd.xls"; + System.IO.StringWriter stringWrite = new System.IO.StringWriter(); + System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); + grView.RenderControl(htmlWrite); + Response.Write(stringWrite.ToString()); + Response.End(); + + } + + #region area protected + + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { - return user_std.UtSn.Traduci(lemma.ToString()); + aggiornamento(); + doExport(); } + } - /// - /// fix x export excel - /// - /// - public override void VerifyRenderingInServerForm(Control control) - { - // Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. - } + #endregion - private void doExport() - { - Response.Clear(); - Response.AddHeader("content-disposition", "attachment; filename=InterventiProgrammati.xls"); - Response.Charset = ""; - // If you want the option to open the Excel file without saving than - // comment out the line below - Response.Cache.SetCacheability(HttpCacheability.NoCache); - Response.ContentType = "application/vnd.xls"; - System.IO.StringWriter stringWrite = new System.IO.StringWriter(); - System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); - grView.RenderControl(htmlWrite); - Response.Write(stringWrite.ToString()); - Response.End(); + public void aggiornamento() + { + grView.AllowPaging = false; + ods.DataBind(); + grView.DataBind(); + } - } - - #region area protected - - - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - aggiornamento(); - doExport(); - } - } - - #endregion - - public void aggiornamento() - { - grView.AllowPaging = false; - ods.DataBind(); - grView.DataBind(); - } - } diff --git a/GIM_site/ExcelExportMtzPrevPending.aspx.designer.cs b/GIM_site/ExcelExportMtzPrevPending.aspx.designer.cs index d128675..11829f0 100644 --- a/GIM_site/ExcelExportMtzPrevPending.aspx.designer.cs +++ b/GIM_site/ExcelExportMtzPrevPending.aspx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ @@ -12,29 +12,29 @@ public partial class ExcelExportMtzPrevPending { /// - /// form1 control. + /// Controllo form1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; /// - /// grView control. + /// Controllo grView. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.GridView grView; /// - /// ods control. + /// Controllo ods. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; }