摘要:Winform 打印报表(从网上看到的代码,感觉不错,上传以做备忘)winform 打印原理..1.先在画布上面画好表格2.然后传入要打印的数据代码如下:using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.Drawing.Printing;using System.Drawing;namespace Etaocn.Util{ public class Printer { private DataGridView dataview; pri.
阅读全文
摘要:/// <summary> /// 合并GridView中某列相同信息的行(单元格) /// </summary> /// <param name="GridView1">GridView</param> /// <param name="cellNum">第几列</param> public static void GroupRows(GridView GridView1, int [] cellNum)//已经改动过了现在是对指定多列后把相同信息合并 { //int []arr
阅读全文
摘要:http://ufo-crackerx.blog.163.com/ 全球最大编程控件补丁仓库http://www.spreadsheetgear.com/support/samples/excel.aspx资源网站http://www.cnblogs.com/springSky/archive/2011/07/15/2107108.html博客园关于Devexpress 的xtraReports学习可制作复杂表头Spreadsheet.XMLData 字符串类型的属性,可用来获得或设置XML格式的电子表格内容。Spreadsheet.Range 该方法接受一个区域引用(例如A1:B2或A:B)
阅读全文
摘要:第一步:拖一个printDocument控件到界面。打印按钮的代码:C# CODE:privatevoid button1_Click(object sender, EventArgs e)//执行打印 { PrintDialog MyPrintDg =new PrintDialog(); MyPrintDg.Document = printDocument1; if (MyPrintDg.ShowDialog() == DialogResult.OK) { try { printDocument1.Print(); } catch { //停止打印 printDocument1.PrintC
阅读全文
摘要:zedgraph相关链接:http://download.csdn.net/tag/zedgraphhttp://download.csdn.net/detail/wuyazhe/2591699http://download.csdn.net/detail/wuyazhe/2588529教程相关链接http://wenku.baidu.com/view/ffcf461dc281e53a5802ff9a.html源码下载:1.http://download.csdn.net/download/liu5623/18649332.http://download.csdn.net/download/s
阅读全文
摘要:一、在报表里定义三个公式字段如:qty_head、qty_dtl、qty_foot二、给三个字段分别加上代码1. qty_head代码whileprintingrecords;numbervar qty:=0; //数字currencyVar qty:=0; //金额2. qty_dtl代码whileprintingrecords;numbervar qty; //数字currencyVar qty; //金额qty := qty + {tbOrderOut_Dtl_View.qty};3. qty_foot代码whileprintingrecords;numbervar qty; //数字c
阅读全文
摘要:原文来自:http://wenwen.soso.com/z/q104168454.htmusing System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;/// <summary>/// TreeMa
阅读全文
摘要:C#编写的winform程序打包方法1.在解决方案资源管理器 点击“解决方案” 添加 “新建项目” 选择-->其它项目类型-->安装和部署-->安装项目可修改名称、路径,默认不修改也可以2.右击 刚刚添加的“安装项目” 点击“添加”-->“项目输出” 直接点击 “确定”.3.右击 “安装项目” -->“视图” -->“文件系统”会看到有三个分类文件夹:1.应用程序文件夹 2.用户的“程序”菜单 3.用户桌面点击 应用程序文件夹 -->选中“主输出来自[解决方案即项目]”;复制并粘贴到“用户桌面文件”下 即是 桌面快捷方式。在用户的“程序”菜单下也粘贴个
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;using System.Data.SqlClient;namespace WindowsFormsApplication1{ /** * 两个RadioButton,分别用来让用户选择求最大值以及求最小值 rbtM
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1{ public partial class Form12 : Form { public enum RunState { running, pause, stop } priva
阅读全文
摘要:/// <summary> /// 当前所选内容更改时发生 /// </summary> /// <param name="sender"></param> /// <param name="e"></param>private void dgvUserList_SelectionChanged(object sender, EventArgs e) { for (int i = 0; i < dgvUserList.RowCount; i++) { DataGridViewL
阅读全文
摘要:dgvHistory.EnableHeadersVisualStyles = false;//列标题是否使用用户当前主题的可观样式 DataGridViewColumnHeaderCell dgvc=dgvHistory.Columns[10].HeaderCell;//获取表示列标题 dgvc.Style.ForeColor = Color.Red;//设置单元格样式
阅读全文
摘要:private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { Brush gridBrush = new SolidBrush(this.dataGridView1.GridColor); SolidBrush backBrush = new SolidBrush(e.CellStyle.BackColor); SolidBrush fontBrush = new SolidBrush(e.CellStyle.ForeColor); int cellheight; i.
阅读全文
摘要://SetstheToolTiptextforcellsintheRatingcolumn.voiddataGridView1_CellFormatting(objectsender,DataGridViewCellFormattingEventArgse){if((e.ColumnIndex==this.dataGridView1.Columns["Rating"].Index)&&e.Value!=null){DataGridViewCellcell=this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIn
阅读全文
摘要:DataTable dt = igmbll.getAllVWShopGoodsPurMas(); foreach (DataRow Row in dt.Rows) { Row[4] = Convert.ToDecimal(Row[4].ToString()); dgvVWShopGoodPurMas.Rows.Add(Row.ItemArray);// } this.dgvVWShopGoodPurMas.DataSource = dt;
阅读全文
摘要:/// <summary> /// 查找根节点(parent_ID为0的节点)的子节点 /// </summary> /// <param name="parent_ID">参数,接收根节点ID即0</param> public void bindtree(string parent_ID) { this.tvgood.Nodes.Clear(); DataTable dt = frmgb.Getdata(parent_ID); if (dt.Rows.Count > 0) { for (int i = 0; i <
阅读全文
摘要:if (dgvgood.Rows.Count > 0) { switch (MessageBox.Show("单据已经修改,要保存吗?", "询问", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)) { case DialogResult.Cancel: break; case DialogResult.Yes: { //if (string.IsNullOrEmpty(cbperson.Text)) //{ // M
阅读全文
摘要:/// <summary> /// ArrayList转换类型为DataTable /// </summary> /// <param name="list"></param> /// <returns></returns> public static DataTable ToDataTableTow(IList list) { DataTable result = new DataTable(); if (list.Count > 0) { PropertyInfo[] propertys =
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace GoldCubePos.App{ public partial class Form1 : Form { private delegate void ShowName(object sender);//定义委托 private
阅读全文
摘要:C# 的 Delegate TypeDelegate 是一种函数指针,但与普通的函数指针相比,区别主要有三:1) 一个 delegate object 一次可以搭载多个方法(methods)[译注1],而不是一次一个。当我们唤起一个搭载了多个方法(methods)的 delegate,所有方法以其“被搭载到 delegate object 的顺序”被依次唤起——稍候我们就来看看如何这样做。2) 一个 delegate object 所搭载的方法(methods)并不需要属于同一个类别。一个 delegate object 所搭载的所有方法(methods)必须具有相同的原型和形式。然而,这些方
阅读全文