微软提供的水晶报表例子程序CS_ReducedCode_Parameters,default.aspx源码为:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>51aspx.com Demo</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Select a city:
<asp:DropDownList ID="cityList" runat="server">
<asp:ListItem>Paris</asp:ListItem>
<asp:ListItem>Tokyo</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="redisplay" runat="server" Text="Redisplay Report" /><br />
<br />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="XtremeCustomers.rpt">
<Parameters>
<CR:ControlParameter ControlID="cityList" ConvertEmptyStringToNull="False" DefaultValue=""
Name="City" PropertyName="SelectedValue" ReportName="" />
</Parameters>
</Report>
</CR:CrystalReportSource>
</div>
</form>
<a href="http://www.51aspx.com" target="_blank">Download From 51aspx.com</a>
</body>
</html>
defult.aspx.cs程序为:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
}
为什么按钮ID="redisplay"内无如何程序代码,当选择DropDownList ID="cityList"时,按此按钮时,也能使水晶报表更新?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>51aspx.com Demo</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Select a city:
<asp:DropDownList ID="cityList" runat="server">
<asp:ListItem>Paris</asp:ListItem>
<asp:ListItem>Tokyo</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="redisplay" runat="server" Text="Redisplay Report" /><br />
<br />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="XtremeCustomers.rpt">
<Parameters>
<CR:ControlParameter ControlID="cityList" ConvertEmptyStringToNull="False" DefaultValue=""
Name="City" PropertyName="SelectedValue" ReportName="" />
</Parameters>
</Report>
</CR:CrystalReportSource>
</div>
</form>
<a href="http://www.51aspx.com" target="_blank">Download From 51aspx.com</a>
</body>
</html>
defult.aspx.cs程序为:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
}
为什么按钮ID="redisplay"内无如何程序代码,当选择DropDownList ID="cityList"时,按此按钮时,也能使水晶报表更新?
解决方案 »
- c# 如何把folderbrowser获取的路径传递给其他方法使用!
- 一句简单的SQL
- 《求教》如何判断 两个日期之间有几个 周末???
- DataSet 写到XML问题
- AxWebBrowser的NewWindow2,NewWindow的触发顺序???
- 数据同步更新
- ultralgrid(winform):CalcManager的使用
- 请教网页乱码问题
- CheckedListBox控件问题?
- 请问子窗口怎么访问父窗口里面的控件(不要用static)
- C#.net应用程序打包时怎样把Sql数据库一同打包?
- 传递过来一个二进制数据byte[] PHOTO,准备将PHOTO转换为JPG格式的图片存储在服务器的image文件夹下
是这个属性true的原因吧.
感觉和AutoPostBack差不多,自动数据绑定.
<asp:Button ID="redisplay" runat="server" Text="Redisplay Report" /> 这个按钮主要是触发一个服务器回发事件
CRViewer会自动去提取cityList控件的值返回给报表模板
请问一下.如果AutoDataBind="false",这个报表会自动刷新吗?ControlID="cityList",这个在这里是报表的一个参数吧,和LZ问的"按此按钮时,也能使水晶报表更新?"没有什么关系吧.