我用vs2008,winform来做报表,用microsoftReportview控件,添加了报表后,想在程序中动态的设置报表report1.rdlc中的某个文本框textbox1的内容,不知道该用哪些代码,请高手耐心指教:
private void Report_Load(object sender, EventArgs e)
{ this.reportViewer1.RefreshReport();
reportViewer1.LocalReport.ReportEmbeddedResource = "Report1.rdlc";
//以下设定 "Report1.rdlc"中的某个文本框textbox1的值为“ABC”,该写啥代码啊
}
private void Report_Load(object sender, EventArgs e)
{ this.reportViewer1.RefreshReport();
reportViewer1.LocalReport.ReportEmbeddedResource = "Report1.rdlc";
//以下设定 "Report1.rdlc"中的某个文本框textbox1的值为“ABC”,该写啥代码啊
}
解决方案 »
- socket通讯时 xml报文如何加密?
- 请教判断字符串是否符合要求的问题
- ssh tectia 这款软件可以设置用户权限问题
- remoting的案例
- richTextBox 中只有粘贴BMP格式的图片 才能把图片一起保存在文件中吗?
- 怎么下载这种url的xml文件
- c# 现在有一个别人做好的程序,在不改动这个程序的前提下,用C#编写一个新的程序,调用原来的程序,在每个程序界面中加入新的logo,如何实现?
- 大家说说哪一种连接数据库的方法最好?
- 请问各位高手,怎样可以使导出到excel的数字是数字型而不是字符型的。——心急人上
- VS 2010 C#中设置按钮的快捷键问题
- C# WinForm 如何消除图像的“锯齿”???
- 谢谢ttotcs3大哥帮我解决彩信下行的问题。
选中Report,
Ctrl+Alt+D,添加一个Parameter, 如 Report_Parameter_Text,类型选为String
选中Textbox1,右键选择Expression, 输入=Parameters!Report_Parameter_Text.Value,
你也可以编辑界面的右下方Category中选择Parameters->Report_Parameter_Text,双击会自动跳上去.在CS代码里:
//add new report parameters
var reportParams = new List<ReportParameter>()
{
new ReportParameter("Report_Parameter_Text", "ABC"),
};
reportViewer1.LocalReport.SetParameters(reportParams);
//refresh report after parameters and data source set
reportViewer1.RefreshReport();
我是VS2008的,不知还要using哪些啊
using Microsoft.Reporting.WinForms;
运行到这句出现异常了,大概如下:
未处理 Microsoft.Reporting.WinForms.LocalProcessingException
Message="本地报表处理期间出错。"
Source="Microsoft.ReportViewer.WinForms"
........
InnerException: System.ApplicationException
Message="尚未指定报表“Report1.rdlc”的报表定义"
Source="Microsoft.ReportViewer.Common"
StackTrace:
请问这位大侠,在rdlc报表里,怎么让textbox1显示边框?也就是打印出矩形框,我现在是用折线图来做的,每个矩形得拉4条折线,并且对其,实在太麻烦了,有简单的方法吗?
属性里改一下
BorderStyle = Solid;
默认情况下是None,你可以分别设置四边是否显示边框
另外BorderColor是边框颜色BTW:该结的帖子请及时结贴