超级水晶报表入门问题

bl_xin 2005-03-30 02:59:42
做好的rpt文件,如何绑定到c# webform的CRYSTALREPORTVIEWER里面?
...全文
228 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluefox1999 2005-04-01
  • 打赏
  • 举报
回复
例如:ReportSource=' <%# "C:\Program Files\Microsoft Visual Studio.NET\Crystal Reports\Samples\Reports\General Business\World Sales Report.rpt" %>'>
bluefox1999 2005-04-01
  • 打赏
  • 举报
回复
DataBind中要有双引号,因此外部只能用单引号
cloudjava 2005-04-01
  • 打赏
  • 举报
回复
补充一下,显示报表的时候,指定一下就可以了

CrystalReportViewer.ReportSource = oRpt;
cloudjava 2005-04-01
  • 打赏
  • 举报
回复
楼上的正确。

不过,最好在程序中直接写,代码如下
using CrystalDecisions.CrystalReports.Engine;

ReportDocument oRpt = new ReportDocument();
// 报表路径取得
String sPath = HttpContext.Current.Server.MapPath(Request.ApplicationPath);
sPath += @"\Report\xxxxxx.rpt";

oRpt.Load(@sPath);

注意这个“@”一定要加上
Jeacey 2005-03-31
  • 打赏
  • 举报
回复
google搜一下,很多源代码的!
祝你好运!
bl_xin 2005-03-30
  • 打赏
  • 举报
回复
直接绑定控件上,运行错误如下:
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误信息: CS1026: 应输入 )

源错误:



行 14: <body MS_POSITIONING="GridLayout">
行 15: <form id="Form1" method="post" runat="server">
行 16: <CR:CRYSTALREPORTVIEWER id=CRreport runat="server" ReportSource="<%# d:\\rdwork\\hlf.rpt %>" Width="1024px" Height="1144px">
行 17: </CR:CRYSTALREPORTVIEWER>
行 18: </form>


源文件: http://localhost/rdwork/WebForm1.aspx 行: 16

4,819

社区成员

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

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