1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
private void DetailReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
string CodMateriale = (string)this.Parameters["CodMateriale"].Value;
string CodColore = (string)this.Parameters["CodColore"].Value;
double Spessore = (double)this.Parameters["Spessore"].Value;
DetailReport.FilterString = string.Format("[sCodMateriale] = '{0}' AND [sCodColore] = '{1}' AND [nSpessore] = {2}", CodMateriale, CodColore, Spessore);
}
private void DetailReport2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
int IDP = (int)this.Parameters["IDP"].Value;
DetailReport2.FilterString = string.Format("[iIDP] = {0}", IDP);
}
private void cfDimensioni_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e) {
string maschera = "{0} x {1} x {2} mm";
string lunghezza = DetailReport2.GetCurrentColumnValue("nBase").ToString();
string larghezza = DetailReport2.GetCurrentColumnValue("nAltezza").ToString();
string spessore = this.Parameters["Spessore"].Value .ToString();
string dimensioni = string.Format(maschera, lunghezza, larghezza, spessore);
e.Value = dimensioni;
}
private string GetDatoFST(string key) {
List<KeyValuePair<string, string>> DatiFST = DetailReport2.GetCurrentColumnValue("DatiFST") as List<KeyValuePair<string, string>>;
if (DatiFST != null) {
if (DatiFST.Count(d => d.Key == key) > 0)
return DatiFST.Find(d => d.Key == key).Value;
else
return string.Empty;
}
else
return string.Empty;
}
private void barCode1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
barCode1.Visible = !string.IsNullOrEmpty(barCode1.Text);
}
private void cfMyCncFile_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e) {
string cnc = DetailReport2.GetCurrentColumnValue("sCNCFiles").ToString();
cnc = Path.GetFileNameWithoutExtension(cnc);
if(!string.IsNullOrEmpty(cnc)) {
cnc += ".CIX";
e.Value = cnc;
}
else
e.Value = string.Empty;
}
private void pictureBox2_Paint(object sender, PaintEventArgs e) {
e.Graphics.DrawLine(Pens.Black, 0, 100, 100, 100);
} |
Partager