起初我遇到的問題很容易找到,然後我按照建議添加了腳本管理器,導致錯誤消失遠。現在,它只是不渲染。我將我的.RDLC從VS 2008升級到VS 2010,現在當我運行報表時頁面是空白的
這是一個非常簡單的報告。當我不首先「隱藏」報告時,它會呈現,但超時,所以我知道它會起作用。似乎我遇到了從SSRS 2008和SSRS 2010遷移的某種類型的異步問題。我嘗試了更新面板和異步渲染的各種屬性,但這並沒有幫助。
這是我的基本代碼
<rsweb:ReportViewer ID="ReportViewer2" runat="server" Font-Names="Verdana" Visible="false"
Font-Size="8pt" Height="564px" Width="1055px" >
<LocalReport ReportPath="Reports/SingleUK.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="MainSqlDataSource" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:SqlDataSource ID="MainSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:AncillaryProductionConnectionString %>"
SelectCommand="packsheets.procUKPacksheets"
SelectCommandType="StoredProcedure"
onselecting="MainSqlDataSource_Selecting">
<SelectParameters>
<asp:FormParameter Type="Int32" DefaultValue=""
FormField="StatusDropDownList" Name="Status" />
<asp:FormParameter Type="Int32" DefaultValue="" FormField="HoldDropDownList"
Name="Hold" />
<asp:FormParameter Type="Int32" DefaultValue="0"
FormField="NoteCategoryDropDownList" Name="Notes" />
<asp:FormParameter Type="Int32" DefaultValue="0"
FormField="ShippingGroupDropDownList" Name="ShMeth" />
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
和守則
背後protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
//{
// this.ReportViewer2.Visible = false;
//}
}
protected void Button1_Click(object sender, EventArgs e)
{
this.ReportViewer2.Visible = true;
this.ReportViewer2.LocalReport.Refresh();
}
protected void MainSqlDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (e.Command.Parameters["@Status"].Value == null)
{
e.Command.Parameters["@Status"].Value = DBNull.Value;
}
if (e.Command.Parameters["@Hold"].Value == null)
{
e.Command.Parameters["@Hold"].Value = DBNull.Value;
}
}
}
沒有人有還有什麼我可以嘗試任何想法?
提前致謝!
通過 「升級」你的意思是你通過Visual Studio的2010升級嚮導來運行它嗎?或者您是否使用Visual Studio 2010中包含的SSRS版本來重寫報告? – Dubs 2011-03-23 14:43:55