C# 创建从“特定日期到其他日期”的CrystalReport
我的数据库中几乎没有数据需要生成crystal报告。我需要生成一个从特定日期到其他日期的crystal报表。例如,必须生成2014年5月14日到2014年5月16日之间的报表。如何生成它?任何示例代码都会有很大帮助。注意:其Windows应用程序使用c.netC# 创建从“特定日期到其他日期”的CrystalReport,c#,.net,windows,C#,.net,Windows,我的数据库中几乎没有数据需要生成crystal报告。我需要生成一个从特定日期到其他日期的crystal报表。例如,必须生成2014年5月14日到2014年5月16日之间的报表。如何生成它?任何示例代码都会有很大帮助。注意:其Windows应用程序使用c.net enter code here StrSQL=从包含vcitemid的项目中选择vcCatId、vcCatSubId、vcitemid、vcitemname; StrSQL+=从订单项目中选择vcItemId,其中vcInTime; S
enter code here
StrSQL=从包含vcitemid的项目中选择vcCatId、vcCatSubId、vcitemid、vcitemname;
StrSQL+=从订单项目中选择vcItemId,其中vcInTime;
StrSQL+=介于“+StartDate+”和“+EndDate+”之间
已使用以下查询获取报告。当我将其用于单个表时,它工作正常。当选择多个表时,它不会将日期作为参数。确定只需使用简单方法即可 假设您的报表查看器对象是ReportViewer
ReportViewer.SelectionFormula = " Date({Table1.Date1})>= #" + Date1.Text+ "# And Date({Table1.Date2})<= #" + Date2.Text + "#";
ReportViewer. RefreshReport();
如果它不起作用或者您需要更多详细信息,请告诉我
<CR:CrystalReportViewer ID="ExpiryReportCrystalReportViewer" runat="server"
AutoDataBind="true"
EnableDatabaseLogonPrompt="False" EnableDrillDown="False"
EnableParameterPrompt="False" HasCrystalLogo="False" HasDrilldownTabs="False"
HasDrillUpButton="False" HasToggleGroupTreeButton="False"
HasToggleParameterPanelButton="False" ToolPanelView="None" ToolPanelWidth=""
Width="350px"/>
ReportDocument RptDoc = new ReportDocument();
ExpiryReportCrystalReportViewer.ReportSource = RptDoc;
Session["EDR"] = dsDocument;
很难回答您的问题,因为它不具体。请下次更具体。这是crystal report的示例。
希望能有所帮助。问题是它适用于单个表,但当我使用多个表时,它不会将日期作为参数。您好,很抱歉回复太晚。您可以在此处发布您的表链接屏幕截图,该截图显示在报告中。干杯请注意,它不是web应用程序,而是windowsapp