Advertisement

07.24.2008 at 09:57AM PDT, ID: 23592828
[x]
Attachment Details

How To Use a Drop Down List With Reporting Services

Asked by UserName01100001 in Visual Studio 2008, SQL Reporting, .Net Editors & IDEs

Tags: ASP.NET 2.0, ASP.NET 3.5, FireFox

Greetings,
I am attempting to use the selected value in a drop down list to return report data.  However, I am unable to pass the value from the drop down list to the parameter used to get the report data.  It only returns data for the default value.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource4"
        DataTextField="PropertyID" DataValueField="PropertyID">
    </asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT DISTINCT [PropertyID] FROM [tblWorkOrders] ORDER BY [PropertyID]">
    </asp:SqlDataSource>
    <br />
    <br />
    <br />
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
        Height="400px" Width="400px">
        <LocalReport ReportPath="StaleRPT_0.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="ObjectDataSource3" 
                    Name="MCP_DevUseOnlyDataSet_tblWorkOrders" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
        TypeName="MCP_DevUseOnlyDataSetTableAdapters.tblWorkOrdersTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList2" DefaultValue="-1" 
                Name="PropertyID" PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
[+][-]07.25.2008 at 06:38AM PDT, ID: 22088411

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio 2008, SQL Reporting, .Net Editors & IDEs
Tags: ASP.NET 2.0, ASP.NET 3.5, FireFox
Sign Up Now!
Solution Provided By: jgv
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.31.2008 at 10:47AM PDT, ID: 22131868

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628