Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Reportviewer未在ASPX页面中显示-VB_Asp.net_Vb.net_Reportviewer - Fatal编程技术网

Asp.net Reportviewer未在ASPX页面中显示-VB

Asp.net Reportviewer未在ASPX页面中显示-VB,asp.net,vb.net,reportviewer,Asp.net,Vb.net,Reportviewer,我在.aspx页面(rvSuggestions)中有一个ReportViewer控件,用于显示报表(rptCountByUnit)。该报表使用数据源OBJDSCONTBYUnit,该数据源使用存储过程(dsCountByUnit.xsd中的tableadapter)获取数据。存储过程接受参数@fromDate(从页面上的txtFrom传递)和@toDate(从页面上的txtTo传递) 当我打开dsCountByUnit.xsd并预览数据时,我得到了预期的结果,但是当我运行页面时,不会显示rvSu

我在.aspx页面(rvSuggestions)中有一个ReportViewer控件,用于显示报表(rptCountByUnit)。该报表使用数据源OBJDSCONTBYUnit,该数据源使用存储过程(dsCountByUnit.xsd中的tableadapter)获取数据。存储过程接受参数@fromDate(从页面上的txtFrom传递)和@toDate(从页面上的txtTo传递)

当我打开dsCountByUnit.xsd并预览数据时,我得到了预期的结果,但是当我运行页面时,不会显示rvSuggestions。DIV容器向下展开,就像它在那里一样,但是我只看到一个空白

回发是由btnSubmit触发的,我添加了下面的代码,如上所述,但它并没有解决问题(奇怪的是,它确实解决了我一直在从事的另一个项目的问题)

这是我的ReportViewer和对象数据源:

<rsweb:ReportViewer ID="rvSuggestions" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="870px" AsyncRendering="False">
            <LocalReport ReportPath="Reports\rptCountByUnit.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="objdsCountByUnit" Name="rptDataSet" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>

        <asp:ObjectDataSource ID="objdsCountByUnit" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="dsCountByUnitTableAdapters.getCountOfSuggestionsByUnitTableAdapter">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtFrom" Name="fromDate" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtTo" Name="toDate" PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

你知道这是什么原因吗?

我设法解决了这个问题。我已经在.RDLC文件本身的报表数据的parameters文件夹中添加了参数@fromDate和@toDate。我删除了这些,报告现在显示正确。

这听起来很奇怪,但是当你看到空白div时,在浏览器中做一个视图源,看看HTML是否在那里显示报告。相信我。:-)嗨,努扎巴,不,HTML不在那里。有什么原因导致reportviewer无法呈现?那么是什么原因导致DIV容器向下扩展?
<rsweb:ReportViewer ID="rvSuggestions" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="870px" AsyncRendering="False">
            <LocalReport ReportPath="Reports\rptCountByUnit.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="objdsCountByUnit" Name="rptDataSet" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>

        <asp:ObjectDataSource ID="objdsCountByUnit" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="dsCountByUnitTableAdapters.getCountOfSuggestionsByUnitTableAdapter">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtFrom" Name="fromDate" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="txtTo" Name="toDate" PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
CREATE PROCEDURE getCountOfSuggestionsByUnit 
@fromDate nvarchar(50), 
@toDate nvarchar(50) 
AS
BEGIN

SET NOCOUNT ON;

SELECT unit, COUNT (ref) as Suggestions
FROM suggestion.dbo.suggestions
where dateRaised BETWEEN @fromDate and @toDate
group by unit