知方号

知方号

锐浪报表<锐浪报表工具60>

锐浪报表



一直以来,锐浪报表做的不错,尤其是适用于国内的状况。加上不是很满意rdlc的功能,查遍网络,很少有这方面的介绍。所以整理常用功能,以备使用。水平有限,大家根据自身情况来学习。

一、             套打技巧

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

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

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

二、             多表头

详见ppt

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

 

数据连接有两种模式(推模式、拉模式),推模式就是由程序代码把连接字符串、SQL语句推送给报表;拉模式则是在明细网格中根据填好的连接字符串、SQL语句由报表自身自主查询(不建议,连接语句包含在报表中,不太安全)。

 

private GridppReportReport = new GridppReport();//1.定义一个新报表

public voidshowreport()

        {           

            //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;PersistSecurity Info=True;User ID= xxxxxx;Initial Catalog=ry_powder;DataSource=192.168.8.18;Use Procedure for Prepare=1;Auto Translate=True;PacketSize=4096;Workstation ID=UNCLE13;Use Encryption for Data=False;Tag with columncollation when possible=False";

 

//4.连接报表取数事件

Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(MyReport);

//5.设定查询显示器要显示的报表

axGRPrintViewer1.Report = Report;        

        }

private voidMyReport()//报表查询条件

        {

            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 + ANDunit_2 = + comboBox2.Text + AND materialtype = + comboBox3.Text + AND typedetail = + comboBox4.Text + and uploaddate  >= +startdate + and uploaddate 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至lizi9903@foxmail.com举报,一经查实,本站将立刻删除。

上一篇 没有了

下一篇没有了