public partial class Form1 : Form
{
//字段
private string str = "";
private string _name;
//属性
public string name
{
get { return _name; }
set { _name = value; }
}
public Form1()
{
InitializeComponent();
init();
this.button1.Click += new EventHandler(button1_Click);
}
void button1_Click(object sender, EventArgs e)
{
//事件
}
private void init()
{
//方法
List
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
if (!li.Contains(this.dataGridView1.Rows[i].Cells[0].Value))
{
li.Add(this.dataGridView1.Rows[i].Cells[0].Value);
}
else
{
this.dataGridView1.Rows[i].Visible = false;
}
}
this.reportDocument1.Export(CrystalDecisions.Shared.ExportOptions.CreateExcelFormatOptions);
}
}
一个简单的例子,希望能帮到你。
建议买本书或借一本看