4,816
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" Height="449px" Width="908px" ShowBackButton="True"
SizeToReportContent="True" SkinID="1">
<LocalReport ReportPath="Report\CanReport\rptCanFault.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="SqlDataSource1"
Name="CanFult_sp_CanReportVehicleFault" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:T8ConnectionString %>"
SelectCommand="sp_CanReportVehicleFault" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="WhereObjectID" Type="Decimal" />
<asp:Parameter DefaultValue="0" Name="WhereHoldID" Type="Decimal" />
<asp:Parameter DefaultValue="1" Name="Userid" Type="String" />
<asp:Parameter DefaultValue="2012-08-01" Name="WhereSTime" Type="String" />
<asp:Parameter DefaultValue="2012-08-01" Name="WhereETime" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
dsReport = SqlHelper.ExecuteDataset("exec sp_CanReportVehicleFault 0,0,2,'2012-08-20','getdate()'");
//为查看器提供本地报表数据
ReportDataSource rds = new ReportDataSource("CanFult_sp_CanReportVehicleFault", dsReport.Tables[0]);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.LocalReport.Refresh();
ReportDataSource rds = new ReportDataSource("CanFult_sp_CanReportVehicleFault", dsReport.Tables[0]);