水晶报表调用存储过程 (没多少分了有了补上)

hn8158 2012-02-09 05:52:26
用的是VS2008

最近在做一个的动态水晶报表,使用dataset 方法可以正常显示,但是点击下一页或者是打印等功能 就上登录,一直未能找到解决办法.

另外使用水晶报表调用存储过程,但是存储过程所需要的参数,跟水晶报表在同一个页面,很纠结该怎么实现..

求图表的大神们给点意见.
...全文
72 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hn8158 2012-02-09
  • 打赏
  • 举报
回复
用阿泰的那种方法,我在page_init写的
private void ConfigureCrystalReports()
{


// 定义ReportDocument对象,装载Crystalreport1.rpt
myReport = new ReportDocument();
string reportPath = Server.MapPath("Crystalreport1.rpt");
myReport.Load(reportPath);


//定义水晶报表的数据库连接信息
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "base1";
connectionInfo.UserID = "SA";
connectionInfo.Password = "shhighbird";
connectionInfo.ServerName = @"192.168.16.251\highbird";

//将数据库信息传递给报表
SetDBLogonForReport(connectionInfo, myReport);
myReport.SetParameterValue("@objname", "VB");----------这个VB是需要动态传值的这个该怎么办呢!
//把模板对象赋给报表前端呈现控件CrystalReportViewer1
CrystalReportViewer1.ReportSource = myReport;
}

private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
{
Tables tables = reportDocument.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);

}
}

private void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}

4,820

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧