当前位置:编程学习 > C#/ASP.NET >>

FastReport绑定带参数的SQL数据源

用过FastReport可以帮下忙,我用FastReport绑定带参数的SQL数据源。
1)指定SQL语句,这里用@指定参数的名称了

2)我设定参数,其中那么与1中的参数名称一样

3)这样设置以后下一步出现提示,缺失表达式,我感觉这样的提示是正确的,因为带参数,所以sql不能正确执行。
但是下一步时,就没有出现能够编辑的字段了

4)用代码运行报表

protected void Page_Load(object sender, EventArgs e)
    {
        this.WebReport1.Prepare();
    }
    protected void WebReport1_StartReport(object sender, EventArgs e)
    {
        Report FReport = (sender as WebReport).Report;
        FReport.SetParameterValue("p", "2");
 }

运行时提示错误
ERROR: (id): Error CS1525: 无效的表达式项“[” (id): Error CS1002: 应输入 ; (id): Error CS1002: 应输入 ; (id): Error CS1525: 无效的表达式项“]” 
在 FastReport.Code.AssemblyDescriptor.InternalCompile() 在 FastReport.Code.AssemblyDescriptor.Compile() 在 FastReport.Report.Compile() 在 FastReport.Report.PreparePhase1() 在 FastReport.Web.Handlers.WebExport.ReportPrepare() 在 FastReport.Web.Handlers.WebExport.GetReportHTML(StringBuilder sb, WebReport webReport, HttpContext context) 在 FastReport.Web.Handlers.WebExport.SendReport(HttpContext context)



我就想知道在配置数据源第三步那,为什么不能出我要查询的字段,我这是测试SQL,如果好使了我准备用被的复杂的参数SQL。
求大神拯救!在线等啦!
FastReport 参数 SQL 数据源 报表 --------------------编程问答-------------------- 有知道这个的吗?亲们? --------------------编程问答-------------------- --------------------编程问答-------------------- 除
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,