Tag: dynamic rdlc generation

如何在RDLC中设置参数值

我在报告中为日期范围添加了两个文本框。 要填充文本框中的值,我将参数设置为文本框。 现在,日期范围来自名为DateRange的表单,该表单具有两个DateTimePickers。 如何设置rdlc中的文本框的值等于这些DataTimePickers?

如何在运行时使用C#生成RDLC文件

我正在做一些应用程序开发(CRM解决方案),它需要在运行时以图形方式生成RDLC文件。 我怎么做?

动态绑定数据集到RDLC报告

我想将动态数据集绑定到rdlc。 如果我在ASPX文件中使用内联DataSource(静态绑定),我可以查看报告。 但是,如果我使用以下代码,报表查看器将继续显示“正在加载…”图像。 我已经检查了数据集名称,如果我将数据集名称更改为“Orders2”,则表明我没有提供所需的数据集“Orders”。 所以,我在表单上添加GridView并测试我的DataSet。 数据集包含数据并与GridView很好地显示。 问题只出在报告中,我无法动态地将数据绑定到ReportViewer。 请帮我。 谢谢。 protected void Page_Load(object sender, EventArgs e) { DataSet ds = GetDataSet(); ReportDataSource rds = new ReportDataSource(“Orders”, ds.Tables[0]); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.Refresh(); GridView1.DataSource = ds; GridView1.DataBind(); } private DataSet GetDataSet() { var conString = ConfigurationManager.ConnectionStrings[“dotnetConnectionString”]; string strConnString = conString.ConnectionString; SqlConnection conn = new SqlConnection(strConnString); conn.Open(); string sql = […]

在RDLC中动态生成列

我试图在ASP.NET中生成一个RDLC报告,其中我的数据集的列将是动态的,并且仅在运行时确定。 我有一个返回DataTable的函数,通过在RDLC报告向导中选择此函数, 我可以成功生成我的报告。 public DataTable GetTable() { // Here we create a DataTable with four columns. DataTable table = new DataTable(); table.Columns.Add(“Dosage”, typeof(int)); table.Columns.Add(“Drug”, typeof(string)); table.Columns.Add(“Patient”, typeof(string)); table.Columns.Add(“Date”, typeof(DateTime)); table.Columns.Add(“testColumn”, typeof(DateTime)); // Here we add five DataRows. table.Rows.Add(25, “Indocin”, “David”, DateTime.Now); table.Rows.Add(50, “Enebrel”, “Sam”, DateTime.Now); table.Rows.Add(10, “Hydralazine”, “Christoff”, DateTime.Now); table.Rows.Add(21, “Combivent”, “Janet”, DateTime.Now); table.Rows.Add(100, “Dilantin”, […]

从RDLC报告中的Render PDF上不显示Base64图像

我正在尝试使用RDLC报告中的参数( @CustomerSign )显示图像(base64字符串) (我从报告中呈现PDF文件,我看到的是PDF文件) 我已经配置了如下图像属性: 选择图像源: Database 使用此字段: =Convert.FromBase64String(Parameters!CustomerSign.Value) 使用此MIME类型: image/png 并传递参数: ReportParameter CustomerSign = new ReportParameter(“CustomerSign”, obj.SignImage); rptvw.LocalReport.SetParameters(CustomerSign); 但图像显示红十字[X]而不是图像,并没有给出错误! 可能是什么问题? 我也尝试过: 如何将PNG图像(作为内存流)渲染到.NET ReportViewer报表界面上