WebForm问题?急!急!急

上海老李 2002-12-01 06:11:45
我在WEBFORM中得到一数据集DS,怎么把它传给CrystalReport1?如何正确的把有当前数据集的Report显示出来?
...全文
29 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
emeng 2002-12-03
  • 打赏
  • 举报
回复
同意楼上
上海老李 2002-12-03
  • 打赏
  • 举报
回复
TO : amylqt(小妹)
我的是在WEBFORM中呀
amylqt 2002-12-02
  • 打赏
  • 举报
回复
CrystalReport1 cr=new CrystalReport1();
cr.SetDataSource(ds);
CrystalReportView1.ReportSource=cr;
只要用上面的三句话就可以
去掉CrystalReportView1.DataBind();
上海老李 2002-12-02
  • 打赏
  • 举报
回复
help
上海老李 2002-12-01
  • 打赏
  • 举报
回复
我刚上去了,原来是我前天就访问了的,我是按那个做,可还是不行,我用空报表或直接连接数据库的报表可以显示,现在显示不了:
ReportDocument rpt=new ReportDocument();
rpt.Load(Server.MapPath("CrystalReport1.rpt"));
TableLogOnInfo logOnInfo = new TableLogOnInfo();
Tables crTables;
crTables=rpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
logOnInfo.ConnectionInfo.UserID="sa";
logOnInfo.ConnectionInfo.Password="";
crTable.ApplyLogOnInfo(logOnInfo);
}
CrystalReportViewer1.ReportSource =rpt;
CrystalReportViewer1.DisplayToolbar=false;
上海老李 2002-12-01
  • 打赏
  • 举报
回复
我的不知为什么访问不了你所说的站点,请具体说一下!
yarshray 2002-12-01
  • 打赏
  • 举报
回复
Why????It's true a web appliction.

Ok you could find out

here:
http://aspfree.com/authors/jitajay/crystalreport.aspx
上海老李 2002-12-01
  • 打赏
  • 举报
回复
上边大侠说的是在WIN FORM中的吧?我是在WEB FORM中实现的!用上边显示登录错
yarshray 2002-12-01
  • 打赏
  • 举报
回复
Sub BindReport()

Dim myConnection As New SqlClient.SqlConnection()

myConnection.ConnectionString= "server= (local)\NetSDK;database=pubs;Trusted_Connection=yes"

Dim MyCommand As New SqlClient.SqlCommand()

MyCommand.Connection = myConnection

MyCommand.CommandText = "Select * from Stores"

MyCommand.CommandType = CommandType.Text

Dim MyDA As New SqlClient.SqlDataAdapter()

MyDA.SelectCommand = MyCommand



Dim myDS As New Dataset1()

'This is our DataSet created at Design Time



MyDA.Fill(myDS, "Stores")



'You have to use the same name as that of your Dataset that you created during design time



Dim oRpt As New CrystalReport1()

' This is the Crystal Report file created at Design Time



oRpt.SetDataSource(myDS)

' Set the SetDataSource property of the Report to the Dataset



CrystalReportViewer1.ReportSource = oRpt

' Set the Crystal Report Viewer's property to the oRpt Report object that we created



End Sub



http://aspfree.com/authors/jitajay/crystalreport.aspx
上海老李 2002-12-01
  • 打赏
  • 举报
回复
我知道用ReportViewer,在WINFORM中已有
CrystalReport1 cr=new CrystalReport1();
cr.SetDataSource(ds);
CrystalReportView1.ReportSource=cr;
CrystalReportView1.DataBind();
可在WEBFORM中不能用?
zag 2002-12-01
  • 打赏
  • 举报
回复
用ReportViewer组件就可以了.

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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