代码尽量全面,必须是动态的,
解决方案 »
- 為何DBNULL寫在類理面會報錯
- 在c#中如何实现点一个按钮就弹出一个datetimepicker?
- 求教!用c#写出这样一个程序的,看看大家的思路!
- 请教:如何判断当前计算机用户是域登录还是本地登录呢
- 在美国建一个电子商务网站出售我公司的商品,资金的流转具体是怎么个流程?
- 生成PDF的时候想加入数字签名要怎么做呢
- 两个form的问题?
- (紧急!!!)c# winform 高亮显示的行后,点击其他行,之前的高亮行不消失
- 怎样在模板类中查找控件。急!急!急!
- 送分》。。》》》》》》》》》》》》》》
- 用户‘(NULL)’登录失败:未与信任SQL SERVER连接相关联
- DevExpress的ASPxTreeList导出xls的问题
rdlc google
挺多的
下面是核心代码,你分析一下,一定可以的,因为里面还要建立dataset集,代码很难贴全,但你认真分析下面的就一定可以,当初我为了下面的代码搞了一个星期,(网上面的代码拖泥带水,不简洁,)终于在VS2005测试通过,using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;
namespace rdlc
{
public partial class Form1 : Form
{
ReportDataSource reportdatasource1 = new ReportDataSource();
ReportDataSource reportdatasource2 = new ReportDataSource();
DataSet mydataset = new DataSet();
DataSet mydataset2 = new DataSet();
public Form1()
{
InitializeComponent();
bind();
this.reportViewer1.RefreshReport();
} private void Form1_Load(object sender, EventArgs e)
{
} public void bind() {
data mydata = new data();
string str = "select * from mysfc2 where 存货编码='ww001'";
mydataset = mydata.getlist(str,"mysfc2");
reportdatasource1.Name = "caigouDataSet_mysfc2";
reportdatasource1.Value = mydataset.Tables[0];
this.reportViewer1.LocalReport.DataSources.Add(reportdatasource1);
this.reportViewer1.LocalReport.DataSources.Add(reportdatasource2);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "rdlc.Report1.rdlc";
} private void reportViewer1_Load(object sender, EventArgs e)
{ } }
}
////设计新报表和报表控件的连接 ////studentBindingSource.Add(dt);
//rpvStuent.LocalReport.ReportPath = "Report1.rdlc";
//ReportDataSource rds = new ReportDataSource();
//rds.Name = "DataSet_student";
//rds.Value = dt;
//rpvStuent.LocalReport.DataSources.Add(rds); ////this.rpvStuent.RefreshReport(); //rpvStuent.RefreshReport();