![](/img/trans.png)
[英]Deploying an Web Application built using Asp.Net,C# and Sql Server 2008 R2
[英]Creating Crystal Report in asp.net c# with SQL Server 2008 R2
我正在做调度管理系统。 我想要一个水晶报表,该报表将接受文本框或下拉列表中的日期,并且根据该日期,我需要将当天的所有数据显示为报表。
我正在使用Visual Studio 2005和SQL Server 2008 R2。 我的数据库名称是字母,用于生成报告的表名称是内部的。
该表具有列
id,dispatchno,dispatchdate,fromname,fromaddress,主题,字母类型,letterno,备注,其中主题,字母类型,letterno可能具有空值。
我想生成带有dispatchno.dispatchname,fromname和from address的报告,同时在主题和备注列中。
在记录选择公式中,我可以选择日期,但只能在该天。 我需要从文本框或下拉列表中选择一个日期,然后显示该日的报告。 我使用公式{inward.fromname} +“,” + {inward.fromaddress}来连接fromname和fromadrress。 工作正常。 但是,当我使用公式IIF(IsNull({inward.subject}),“”,{inward.remarks}&“,”)加入主题和评论时,我变得空白了。 这里的主题具有空值。
我在reports.aspx.cs页面中使用类似的代码。
使用CrystalDecisions.CrystalReports.Engine;
使用System.Data.SqlClient;
公共局部类_Default:System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Server.MapPath("CrystalReport.rpt"));
CrystalReportViewer1.ReportSource = cryRpt;
}
}
我得到了在合并数据表的两个字段时避免空值的答案。 代码是,
如果为IsNull({inward.subject}),则为“ NULL” +','+ {inward.remarks},否则为{inward.subject} +','+ {inward.remarks}
根据从文本框中选择的日期显示水晶报表仍然存在问题。 我需要这样显示。 显示水晶报表,其中派发日期=值从文本框中接受。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.