作者:cheny 来源: 浏览:Loading... 日期:2013-07-09
文章中所用为Stimulsoft Reports.Net 2013试用版
系统配置:Win7开发者旗舰版,MS SQL Server 2008,MS SQL Server 2008
今天在用Stimulsoft Reports.Net 的时候遇到了一个很有取得问题,个人觉得是产品本身的BUG,写出来和大家分享下。
在该asp.net页面,我加入:
1) asp:SqlDataSource - This pulls the data from a SQL stored procedure
2) cc1:StiWebReport - I created the report and the data shows when in the Design Preview
3) cc1:StiWebViewer - The viewer shows the report (header, footer, etc) but does not show any data..
在ASP.NET提供的SqlDataSource我可以运用已经存储的程序,实际上,我并不是想在报表中创建新的连接。
下面是截图
网页截图:
设计模式截图:
VB代码截图:
网页代码截图:
做到这里可能会遇到无法往下制作的问题,例如无法让其替代CR,如果是创建一个新的SQL链接,添加数据源,下面的代码也许可以帮助你:
SqlConnection conn = new SqlConnection();
SqlDataAdapter da = new SqlDataAdapter("select * from DS1", conn);
DataTable dataTableDS1 = new DataTable();
conn.Open();
da.Fill(dataTableDS1);
StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
foreach (DataColumn col in dataTableDS1.Columns)
{
DS1.Columns.Add(col.ColumnName, col.DataType);
点击下载Stimulsoft Reports.Net
注意:此方法为个人测试所得,不一定适用所用问题,仅作分享交流用。
Tag标签:Stimulsoft Reports.Net
上一篇: 用Stimulsoft Reports创建发票教程(一):制作背景
下一篇: 从数据库服务器运行报表 避免报表杂乱无章