Question Trying to pass drop down value to URL for SSRS

dhall1

Member
Joined
Jul 25, 2013
Messages
6
Programming Experience
Beginner
I have a page that the user chooses a date range, a name, and a Form type (A, B, E, T). On the basis of that, I populate a grid with the results and hyperlink a report number. When the user clicks the report number, a report is displayed. The issue is how can I insert the drop down list selected value into the URL to get the proper report based upon the report type the user chooses? So, if the user chooses Form A, the URL for SSRS should call the forma report from SSRS, and so on. Markup is here:
VB.NET:
<body>
<linkhref="StyleSheet.css"rel="stylesheet"/>
<formid="form1"runat="server">
<div>
<center><h1>Custom Reporting<br/>
        Pick a date range, an Inspector, and the type of inspection to list:
</h1>
<p>Note - Date range is the dates of inspection, not dates of data input</p><br/>
        Start date: 
<asp:TextBoxID="stdt"runat="server"></asp:TextBox><asp:RegularExpressionValidatorID="RegularExpressionValidator2"runat="server"ControlToValidate="stdt"ErrorMessage="mm/dd/yyyy"ValidationExpression="^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$"Display="Dynamic"></asp:RegularExpressionValidator> End date: <asp:TextBoxID="enddt"runat="server">
</asp:TextBox>
<asp:RegularExpressionValidatorID="RegularExpressionValidator1"runat="server"ControlToValidate="enddt"ErrorMessage="mm/dd/yyyy"ValidationExpression="^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$"Display="Dynamic"></asp:RegularExpressionValidator> Inspector: <asp:DropDownListID="DDLInsp"runat="server"DataSourceID="SqlDataSource1"DataTextField="Name"DataValueField="Name">
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:ESDFormsConnectionString %>"SelectCommand="SELECT [Name] FROM [Inspectors] ORDER BY [Name]"></asp:SqlDataSource>
        Inspection Type: 
<asp:DropDownListID="DDLType"runat="server">
<asp:ListItem>Form A</asp:ListItem>
<asp:ListItem>Form B</asp:ListItem>
<asp:ListItem>Form E</asp:ListItem>
<asp:ListItem>Form T</asp:ListItem>
<asp:ListItemSelected="True">Pick One</asp:ListItem>
</asp:DropDownList>
<br/>
<br/>
<asp:ButtonID="btnFind"runat="server"Text="Find Reports"/>
<br/>
</center>
</div>
<br/>
<center>
<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="False"EmptyDataText="No records found"BackColor="White"BorderColor="#999999"BorderStyle="None"BorderWidth="1px"CellPadding="3"GridLines="Vertical">
<AlternatingRowStyleBackColor="#DCDCDC"/>
<Columns>
<asp:BoundFieldDataField="enddt"HeaderText="Date"DataFormatString="{0:d}"/>
<asp:HyperlinkFieldHeaderText="Report Number"DataTextField="rptnum"DataNavigateURLFields="rptnum"DataNavigateurlformatstring="http://servername/ReportServer?/esdforms/REPORT NAME SHOULD GO HERE&rs:Command=Render&rc:Parameters=False&rptnum={0}"/>
</Columns>
<FooterStyleBackColor="#CCCCCC"ForeColor="Black"/>
<HeaderStyleBackColor="#000084"Font-Bold="True"ForeColor="White"/>
<PagerStyleBackColor="#999999"ForeColor="Black"HorizontalAlign="Center"/>
<RowStyleBackColor="#EEEEEE"ForeColor="Black"/>
<SelectedRowStyleBackColor="#008A8C"Font-Bold="True"ForeColor="White"/>
<SortedAscendingCellStyleBackColor="#F1F1F1"/>
<SortedAscendingHeaderStyleBackColor="#0000A9"/>
<SortedDescendingCellStyleBackColor="#CAC9C9"/>
<SortedDescendingHeaderStyleBackColor="#000065"/>
</asp:GridView></center>
</form>
</body>
Any help is appreciated
 
Back
Top