XtraReport1添加参数
解决了
在report有个BeforePrint事件
这里面直接
|
1
|
string year = this.Parameters["year"].Value.ToString(); |
这样就可以获取到了
至于传参就是
|
1
2
3
4
5
6
|
ReportPreviewModel model = new ReportPreviewModel("../ReportService1.svc");model.ReportName = "SLA_Manage_TrafficSafety.Web.HarborReport";model.Parameters["year"].Value = txtYear.Text; //参数model.AutoShowParametersPanel = false; //隐藏参数面板documentPreview1.Model = model;model.CreateDocument();
|
using System;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Parameters;
// ... private void simpleButton1_Click(object sender, EventArgs e) {
// Create a report instance.
XtraReport1 report = new XtraReport1(); // Create a parameter and specify its name.
Parameter param1 = new Parameter();
param1.Name = "CatID"; // Specify other parameter properties.
param1.Type = typeof(System.Int32);
param1.Value = 1;
param1.Description = "Category: ";
param1.Visible = true; // Add the parameter to the report.
report.Parameters.Add(param1); // Specify the report's filter string.
report.FilterString = "[CategoryID] = [Parameters.CatID]"; // Force the report creation without previously
// requesting the parameter value from end-users.
report.RequestParameters = false; // Show the parameter's value on a Report Header band.
XRLabel label = new XRLabel();
label.DataBindings.Add(new XRBinding(param1, "Text", "Category: {0}"));
ReportHeaderBand reportHeader = new ReportHeaderBand();
reportHeader.Controls.Add(label);
report.Bands.Add(reportHeader); // Assign the report to a ReportPrintTool,
// to hide the Parameters panel,
// and show the report's print preview.
ReportPrintTool pt = new ReportPrintTool(report);
pt.AutoShowParametersPanel = true;
pt.ShowPreviewDialog();
}
XtraReport1添加参数的更多相关文章
- RDLC中添加参数,用来显示报表中数据集之外的信息。
我添加了两个参数,首先后台: ReportParameter rp = ,,).ToString()); ReportParameter rp1 = new ReportParameter(" ...
- c#数据绑定(4)——向查询中添加参数
本实例主要练习了ADO.Net 连接到外部数据库的基础上,向查询中添加参数.使用的是ACCESS数据库. 在ACCESS数据库中可以用MSSQL的形式定义操作字符串,也可以采用OLEDB的形式. MS ...
- 在VS中向命令行添加参数的方法
在VS中向命令行添加参数的方法 在VS中向命令行添加参数,即向main()函数传递参数的方法: 右键单击要 添加参数的工程-->属性-->配置属性-->调试,在右侧“命令参数”栏输入 ...
- 技巧~向URL地址添加参数
只是个小技巧,感觉挺有用,拿出来分享一下 功能:在URL地址上添加参数,如果只有一个,会是?userid=1,需要是大于1个,会是&userid=1 实现: private string Ad ...
- Extjs中给同一个GridPanel中的事件添加参数的方法
Extjs中给同一个GridPanel中的事件添加参数的方法: this.isUse = new Ext.Action({ text:'启用', scope ...
- XgCalendar日历插件动态添加参数
在使用xgcalendar日历插件的时候,参数数组并非只有类型.显示时间.时区等这些参数,还可以根据extParam自定义参数扩展搜索条件,例如根据用户Id搜索不同用户的日历信息,需要将用户的Id存在 ...
- 关于 preHandle 重写和添加参数问题,重写HttpServletRequestWrapper和Filter
由于 preHandle 中HttpServletRequest 只有setAttribute而没有setParameter 也没有 add 方法 所以是没办法直接添加参数的.从网上查了很多资料,基本 ...
- url后面添加参数,注意&?的添加方式
// 添加参数&key=value 直接输出url function insertParam(key, value) { key = encodeURI(key); value = encod ...
- Revit Family API 添加参数与尺寸标注
使用FamilyManager其他的与普通添加参数与标注没区别. [TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Man ...
随机推荐
- 国外最受欢迎的15个BT下载网站
1.EYH.BIZ 海盗湾(The Pirate Bay)现在在中国成立的一个分部 www.eyh.biz 一个提供BT种子文件和链接,以方便使用BT协议的对等文件共享网站.该网站于2003年在瑞典创 ...
- 【NGINX】LINUX安装NGINX
安装依赖() · yum install gcc · yum install pcre-devel · yum install zlib zlib-devel · yum install openss ...
- php 基础 PHP保留两位小数的几种方法
$num = 10.4567; //第一种:利用round()对浮点数进行四舍五入 echo round($num,2); //10.46 //第二种:利用sprintf格式化字符串 $format_ ...
- JavaScript - 编译性还是解释性?
疑问 在JS的变量和声明式函数的提升看到了"预编译/预处理/预解释"中"预编译"这个字眼,产生了一个疑问:JS是熟知的解释性语言,但JS能被编译吗? 参考 ht ...
- GO闭包
package main import "fmt" func main() { add_func := add(1,2) fmt.Println(add_func(1,1)) fm ...
- IELTS Writing Task 2: 'music' essay
IELTS Writing Task 2: 'music' essay Here's my band 9 sample answer for the question below. Some peop ...
- 第2节 Scala中面向对象编程:7、继承的概念以及override和super关键字;8、isInstanceOf 和 asInstanceOf关键字
6.3. Scala面向对象编程之继承 6.3.1. Scala中继承(extends)的概念 Scala 中,让子类继承父类,与 Java 一样,也是使用 extends 关键字: 继承 ...
- [HNOI 2017]大佬
Description 题库链接 题意简述来自Gypsophila. 你现在要怼 \(m\) 个大佬,第 \(i\) 个大佬的自信值是 \(C_i\) .每次怼大佬之前,你的自信值是 \(mc\),等 ...
- SD-WAN基本介绍
SD-WAN是什么? SD-WAN,即软件定义广域网络,是将SDN技术应用到广域网场景中所形成的一种服务.这种服务用于连接广阔地理范围的企业网络.数据中心.互联网应用及云服务,旨在帮助用户降低广域网的 ...
- 「SPOJ10707」Count on a tree II
「SPOJ10707」Count on a tree II 传送门 树上莫队板子题. 锻炼基础,没什么好说的. 参考代码: #include <algorithm> #include &l ...