横向合计代码 锐浪报表_锐浪报表使用技巧

1.

套打技巧

(

1

)

扫描原件电子版作为报表背景

(

2

)

在报表上面依据背景画出控件位置

(

3

)

根据字段可以设计数据库和报表的连接进行自动大批量打印

2.

多表头

详见

ppt

3.

锐浪报表使用(单数据连接)

数据连接有两种模式(推模式、拉模式)

,推模式就是由程序代码把连接字符串、

SQL

语句推送给报表;

拉模式则是在明细网格中根据填好的连接字符串、

SQL

语句由报表自

身自主查询(不建议,连接语句包含在报表中,不太安全)

private

GridppReport

Report =

new

GridppReport

();

//1.

定义一个新报表

public

void

showreport()

{

//2.

载入报表模板数据

//Report.LoadFromFile(GridppReportDemo.Utility.GetReportTemplatePath() +

"program\\ParamQuerySQL2.grf");

Report.LoadFromFile(

Application

.StartupPath +

"\\1.grf"

);

//3.

设置与数据源的连接串,因为在设计时指定的数据库路径是绝对路径。

Report.DetailGrid.Recordset.ConnectionString =

"Provider=SQLOLEDB.1;Password=xxxxxx;Persist Security Info=True;User ID= xxxxxx;Initial

Catalog=ry_powder;Data Source=192.168.8.18;Use Procedure for Prepare=1;Auto

Translate=True;Packet Size=4096;Workstation ID=UNCLE13;Use Encryption for Data=False;Tag

with column collation when possible=False"

;

//4.

连接报表取数事件

Report.Initialize +=

new

_IGridppReportEvents_InitializeEventHandler

(MyReport);

//5.

设定查询显示器要显示的报表

axGRPrintViewer1.Report = Report;

}

private

void

MyReport()

//

报表查询条件

{

string

startdate = dateTimePicker1.Value.ToString(

"yy-MM-dd 0:00:00"

);

string

enddate = dateTimePicker2.Value.ToString(

"yy-MM-dd 23:59:59"

);

string

SQL =

"SELECT * FROM production_material_lose WHERE

unit = '"

+

comboBox1.Text +

"' AND unit_2 = '"

+ comboBox2.Text +

"' AND materialtype = '"

+

comboBox3.Text +

"' AND typedetail = '"

+ comboBox4.Text +

"' and uploaddate  >= '"

+

startdate +

"' and uploaddate  <='"

+ enddate +

"'"

;

//

用拉模式为报表提供数据,将按条件生成的

SQL

设置到报表上

Report.DetailGrid.Recordset.QuerySQL = SQL;

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值