SubscriptionProperties.aspx - Set Parameter Values By URL
Aug 28, 2007
Is it possible to call up the SubscriptionProperties.aspx page by URL for a specific report, and *specify* the parameter(s) values directly in the URL? I have a scenario where I don't want the user to have to do it.
Hello, Can someone kindly point out what is wrong with the following code file. I'm trying to: - fill a dropdown from a db on page load (this works!) - when user selects from the list and hits a button, pass the dropdown value to a second query - use the second query to make another call to the db and fill a data grid
In the code below, if I swap an actual value (eg '1005') into the command and comment out the .Parameter.Add statements, the dategrid is filled sucessfully. Otherwise, when the button is pressed, nothing is displayed.
Thanks
PS comments about my coding approach are welcome - I'm new to aspx...
<%@ Language="VBScript" Debug="true"%> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.data.SqlClient" %> <html> <head> <script language="vb" runat="server"> Dim dbConnection As SqlConnection Dim ds_Teams,ds_Agents As DataSet Dim sqlCmd_Teams,sqlCmd_Agents As SqlDataAdapter
Dim dbConn = "server=csacd01;uid=mpierce;pwd=cabledog;database=clearviewacd"
Dim sql_select_agents = "" & _ "SELECT last_name + ', ' + first_name AS name, agent_no " & _ "FROM dbo.users " & _ "WHERE (team_no = @Team) AND (NOT (agent_no = '1029')) " & _ " AND (NOT (last_name IS NULL)) " & _ " AND (NOT (first_name IS NULL)) " & _ " AND (NOT (first_name = 'FirstName')) " & _ "ORDER BY last_name"
Dim teamList = "teamList" Dim agentList = "agentList"
Sub Page_Load(Sender As Object, E As EventArgs) if not (IsPostBack) ds_Teams = new DataSet() dbConnection = New SqlConnection(dbConn) sqlCmd_Teams = New SqlDataAdapter(sql_select_teams, dbConnection) sqlCmd_Teams.Fill(ds_Teams, teamList) dbConnection.close()
dropdownlist_Teams.DataSource=ds_Teams.Tables(teamList).DefaultView dropdownlist_Teams.DataBind() end if End Sub
sub Get_Agents(Sender As Object, E As EventArgs) ds_Agents = new DataSet() dbConnection = New SqlConnection(dbConn) sqlCmd_Agents = new SqlDataAdapter(sql_select_agents, dbConnection)
My stored proceddure "My Programs" includes a parameter @meid.How do I code an aspx file to run the procedure with a user ID, e.g. EmpID?I tried the following codes, but the error message indicated it can not findthe Stored Procedure. How do I pass the EmpID as a Stored Procedure parameter? <%meid = EmpIdcmd.CommandText = "MyPrograms meid"cmd.CommandType = CommandType.StoredProcedurecmd.Connection = sqlConnection2sqlConnection2.Open()reader3 = cmd.ExecuteReader(meid)While reader3.Read()sb.Append(reader3(i).ToString() + "......<BR> <BR /> ")End While%> TIA,Jeffrey
Hi All i have created one report using SSRS 2005, in this report one parameter is multivalue parameter, this report preview working fine and user able to select multivalues. but the problem is i deployed this report in server and opened in client system (reports shown to user using report viewer in aspx pages), i am able to access the report but multivalue parameter dropdown is not working. when i clicked on multivalue parameter dropdown report refreshing and remaining parameters default vaues coming up.. i am unable to find the solution please anyone help me
Hi,I have a form page with an insert like this:<asp:SqlDataSource ID="addProductDataSource" runat="server" InsertCommand="INSERT INTO test( title1, firstName1, lastName1, dateOfBirth ) VALUES ( @title1, @firstName1, @lastName1 @dateOfBirth )" ConnectionString="<%$ ConnectionStrings:yourQuoteCentreConnectionString %>"> <InsertParameters> <asp:ControlParameter ControlID="dateOfBirth" Name="dateOfBirth" Type="DateTime" /> <asp:ControlParameter ControlID="title1" Name="title1" PropertyName="Text" /> <asp:ControlParameter ControlID="firstName1" Name="firstName1" PropertyName="Text" /> <asp:ControlParameter ControlID="lastName1" Name="lastName1" PropertyName="Text" /> </InsertParameters></asp:SqlDataSource> In default.aspx.vb I have:Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick 'CREATE DATETIME FROM USERS BIRTH DATE Dim dateOfBirth As New System.DateTime(applicantYear.SelectedValue, applicantMonth.SelectedValue, applicantMonth.SelectedValue, 0, 0, 0) 'INSERT TO DATABASE addProductDataSource.Insert()End SubI would like to reference the variable dateOfBirth created in default.aspx.vb in the insert query on the page, or ideally move the insert query into the aspx.vb page. Would this make more sense to do?Thanks,Paul
I have the following stored proc. which i am using on the front end to get all the record from table:
if there are any fields it has anynull values in it i am getting error dbnull value error. i have null value for ReviewerComment field, can you please tell me how to pass a "" if it is null, in the store proc only, to get all the fresh dat to front end before bnding it to the datagrid control.
CREATE PROCEDURE [dbo].[sp_displayrevws] AS select r.RevID, rtrim(f.revwfunction) as revwfunction, rtrim(u.uname) as uname, CONVERT(varchar(10),r.Issued,101) as Issued, r.ReviewerComment, r.Response, r.ModuleID, rtrim(r.ModuleName) as modulename, r.ReviewerUserID,r.RevFunctionid,r.Dispositionid from TAB_ccsNetReviewers r, tabuname u, ccsfunctions f, ccsdisposition d where u.id = r.ReviewerUserID and r.RevFunctionid = f.id and r.Dispositionid = d.id and r.ModuleID = 1 order by r.RevID ASC GO
I have parameters in my report. The user can choose the year, month and date (3 parameters). Now I want to set default vaules for the parameters , so that the user sees the report for example for the current day without selecting the parameters. I tried to set the type of the parameters to DateTime and the default value for example for the year to "=Today().Year" . But when I execute the report an error occures . Something like : no validValue for this parameter.
My Attributes for the year month and date are from an Analyis Services Cube from a Server Time dimension . Does somebody know how to make it possible to set default values for this parameters?
Other question :
Does somebody know how I can reduce the values for a parameter. For Example I have a parameter "year" from a server time dimension from a cube. The values which are available are "Year 2004", "Year 2005", "Year 2006", "Year 2007". But I want that the user only can choose "Year 2006" or "Year 2007" ant not every Year or "All". Or Other Example: The User should only choose a Date that is int the past or Today but not a Date in the future.
Is it possible to fill a parameter list with values based on another parameter value? Here's what I have so far (which hasn't worked)... I'd like to generate a report listing information for a student. The report viewer would first select a school from the first drop-down menu, and then the second drop-down menu would populate with the list of students at that school. I have a dataset that calls a sp which returns a list of schools (SchoolID and SchoolName fields from the database table). I have another dataset that calls a sp (with SchoolID as the parameter) which returns a list of students for that school. Both datasets return the appropriate data when tested individually, but when I set up the Report Parameters and build the report, these errors come up... The value expression for the query parameter '@SchoolID' refers to a non-existing report parameter 'SchoolID'. The report parameter 'Student' has a DefaultValue or a ValidValue that depends on the report parameter "SchoolID". Forward dependencies are not valid. ...Is it possible for the reoprt to generate a list of available parameter values based on the value selected for another parameter? Any help you can give me would be great!! Thank you
I have my stored procedure set to Territory_code IN (@Territory)
, now , how do i enter in more then one value. When i select the multi value check box, it gives me more spaces. But then doesnt recognize the values when i put in more then one. am i doing something wrong?
I have a parameter (hidden) that gets its value using an expression base on another parameter. When in the designer, the first time when the designer loads I can select the Parameter that controls the child parameter (expression lies in the default value section). The value changes.
When I change the parent parameter again, the value of the child parameter does not seem to change.
How can I make this parameter change automatically when the parent is changed ?
If I have a Select statement like this in my C# code: Select * From foods Where foodgroup In (@foodgroup) And I want @foodgroup to have these values ... "meat", "dairy", fruit", what is the correct way to add the parameter? I tried meat, dairy, fruit 'meat', 'dairy', 'fruit' but neither worked. Is this possible?
Hello!I have tables "forum_topics" and "forum_categories":forum_topics:-topic_id-topic_title-topic_cat_id-topic_user_id-topic_dateforum_categories:-cat_id-cat_name For example: I have 5 categories in table forum_categories and by this query I can display topics from 2nd and 3rd category only. So I'm using this query:SELECT topic_title FROM forum_topics WHERE topic_cat_id IN (2;3)Now I want to parametrized this query by one parameter, so: SELECT topic_title FROM forum_topics WHERE topic_cat_id IN (@param)And I want to input this parameter lik in the query first - so @param = "2;3"But I have a problem to make this works, can someone explain me, how to solve this problem ? Thanks.
Let's say i've got simple table with only one attribute - primary key. I'm populating GridView via SqlDataSource, however dunno how to update PK - how to pass new-updated value and old value (to locate the right record to update) as the UpdateCommand parameters from GridView control. Simple update sample using SQL statement: update TABLE_NAME set PRIMARY_KEY = @NEW_VALUE where PRIMARY_KEY = OLD_VALUE Thank you for your kind help.
In creating a report, how can you display a parameter selection that is a choice (for example, yes/no) where the data that is passed to the query is translated for the query. Selecting 'yes' would pass, for example, 'internal' to the query and selecting 'no' would pass 'external'.
Is this a setting that can be adjusted in Reporting Services, or is this just a matter of how I write my queries?
I am seriously stuck in SQL Reporting Services. And don't know where to go and what to do in order to achieve what I want to achieve.
1. In my report I have the following parameters. SiteID, Document Name, Document Location and Action. These values are picked from the database through queries and filled in the parameter combos.
2. I want the user to be able to view the report for 'Any', 'All' and/or 'None' of the values in the parameter.
e.g. 2.a. The user can generate the report and return all values. 2.b. The user can generate the report with a particular 'SiteID' but all Document Locations, Document Names and Actions. 2.c. The user can generate the report for 'All' SiteIDs, but one Document Location, 'All' Documents and 'All' Actions.
etc.
I was trying this out with parameters. But it wasn't working. Meaning, first of all I wasn't able to get 'All' from the database.
Can someone please help me out, or at least point me in the direction where I should be looking, since I have run out of options.
I have a problem with reports parameters. When I enter the parameter value , Report shows the same value no matter what the parameter value is. Here is my code.
Code Block WITH yesterdayCTE AS ( SELECT type = 'Members Joined Yesterday' , Borrowers = (select count(*) from LoanApplication where LoanApplication.SubmittedOn >= GETDATE()-1) , Depositors = (select count(*) from CDOrder where CDOrder.SubmittedOn >= GETDATE()-1) , CreditUnion = ( select CreditUnion.Name from CreditUnion where (CreditUnion.Id = @CreditUnionID) ) ), last7daysCTE AS ( SELECT type = 'Members Joined Last 7 Days' , Borrowers = (select count(*) from LoanApplication where LoanApplication.SubmittedOn >= GETDATE()-7) , Depositors = (select count(*) from CDOrder where CDOrder.SubmittedOn >= GETDATE()-7) , CreditUnion = ( select CreditUnion.Name from CreditUnion where (CreditUnion.Id = @CreditUnionID) ) ), last30daysCTE AS ( SELECT type = 'Members Joined Last 30 Days' , Borrowers = (select count(*) from LoanApplication where LoanApplication.SubmittedOn >= GETDATE()-30) , Depositors = (select count(*) from CDOrder where CDOrder.SubmittedOn >= GETDATE()-30) , CreditUnion = ( select CreditUnion.Name from CreditUnion where (CreditUnion.Id = @CreditUnionID) ) ), combinedCTE AS ( SELECT * FROM yesterdayCTE UNION ALL SELECT * FROM last7daysCTE UNION ALL SELECT * FROM last30daysCTE ) SELECT * , Members = Borrowers + Depositors FROM combinedC
I'm creating a procedure to fetch rows from table. One field will come come as IN(). Its the condition. That field is numeric field (note down), i would like to pass the In values as parameter.
eg: procedurename @fieldvalue varchar(100) as begin ...
WHERE fieldname IN(@fieldvalue)
while executing the procedure how to pass the value... or procedure itself has problem...? Help me...
Is there any way to validate the input paratemers for the report? For example: I want to restrict the value to be less than 100 in one parameter. How to achieve this?
I have some 5 parameters which I've specified as multi-valued and my report uses a stored procedure. When I select all values in my dropdown (parameters) within my reports nothing shows up. How can I pass multiple values of a parameter into my stored procedure such that it works?
I am having a serious problem developing my reports within VS2005. For no reason, on one of my report it seems the parameters have got a life of there own.
There is a collection of 4 parameters whose values change randomly (internal, hidden, multivalue). Regardless of what I set them to, once I click save some change, when I alter 1 parameter, the values of one of the other parameters change while the settings for the parameter I changed to not apply.
What is going on here, I have been developing reports without issue however this is becoming a major concern. Please help!
i wanna know ,where to keep configuration parameter values either in an config file (xml), or a parameter table. i have it in xml and its working fine , but for a few of them , i need a greater fleximibility to change the values at any time, so was considering a param table.
the problem is that , a common package which reads the config from xml , now will need to read it from a table , while in case of xml , a file path can be assigned to a variable to be used by the package, but here, i dont have any db connection specification, it may be loaded on various servers. is it feasible..to use a parameter table...??
I am deploying an rdl that is being deployed in a server.But i am encountering a problem regarding the valid values of the parameter.My parameters have dependencies,and one of my parameter comes out with two dependencies.
Scenario : User needs to input his userID to access Book A. Book B needs Book A because the output will be depending on the its content. And Book C depend on Book B.
Problem: when deploying, only Book A will have the initial value.The dependency in Book B is only one,which is fine.It shows its valid values. But how about for Book C which have 2 dependencies? Because it doesnt show it's valid values..
Code Snippet SELECT Portfolio, RptSection, RepExcRsn, Report, SUM( Units) as TotUnits , FROM Exc_SummaryData_Custom WHERE (Report = 'Exc') AND (RepExcRsn = 'Grand Total') AND (RptSection ='New') AND (Portfolio IN (@Portfolio)) GROUP BY Report, RptSection,Portfolio, RepExcRsn
UNION ALL
SELECT DISTINCT 'ALL UP' AS Portfolio, RptSection, 'Grand Total' AS RepExcRsn, Report , CASE WHEN Portfolio = 'ALL UP' THEN (SELECT SUM(Units) FROM Exc_SummaryData_Custom WHERE Portfolio IN ('CBank','DTC','EDirect', 'InstLend','ALL UP')AND (Report = 'Exc') AND (RepExcRsn = 'Grand Total') AND (RptSection ='New') ) ELSE 0 END as TotUnits , FROM Exc_SummaryData_Custom WHERE (Report = 'Exc') AND (RepExcRsn = 'Grand Total') AND (RptSection ='New') GROUP BY Report, RptSection, Portfolio, RepExcRsn
My problem is when I input a value for Portfolio parameter, i get two rows instead of one. If I input 'ALL UP' then I get value only for ALL UP. But if I input smthing else , then I get values for that paramter value as well as ALL UP thus giving me two rows not just one as I want. Case stament always gives me 0 value for ALL UP which is not the true value. can anyone help me to correct this?
I want to do something like this SELECT LocationID, Description, ActiveFROM dbo.CapLocationWHERE (Active = 1) AND (LocationID NOT IN (2)) AND (LocationID NOT IN (@LocationID) OR @LocationID IS NULL)ORDER BY Description For the life of my I can not figure out how to pass a group of values like 1,2,3. Any help would be greatly appreciated, Bryan
End select '' as unuseid, substring(ltrim(rtrim(s.Spares_Code)),1,12) as Code, oh.WO_Number AS Claim_Id, ltrim(rtrim(sc.section_code)) AS section_code, ltrim(rtrim(dc.defect_code)) AS defect_code, ltrim(rtrim(at.Action_Taken_Code)) AS Repair_Code, cs.Call_status_code from [32_Trans_Work_Order_Spares_Detail] ws inner join [32_Trans_Work_Order_Header] oh on oh.WO_Number = ws.WO_Number inner join [11_Master_Spares]s on s.Spares_ID = ws.Spares_ID inner join [31_Master_Section_Code] sc on sc.Section_ID = ws.Section_Code_ID inner join [31_Master_Defect_Code] dc on dc.Defect_ID = ws.Defect_Code_ID inner join [10_Master_Equipment_Status] e on e.Equipment_Status_ID = oh.Equipment_Status_ID inner join [00_Master_Country] c on c.Country_ID = mp.Country_ID where e.Equipment_Status_ID in (1,2) and cs.Call_Status_ID in (1,2) and oh.WO_Record_Date between @Fromdt and @ToDt and oh.WO_Status='C'
My Problem is How to pass values to parameters Status Code Consists of values C, V, R which i am passing from the Front End along with Call_Status_ID which can be 1,2.
At the top of my report, if I want to display the selected value for a given parameter, I can put this expression in a text box:
="The xyz param's value is: " & Parameters!paramXYZ.Label(0).ToString
How do I go about displaying all the selected values for a multi-value parameter (one that has mulitple checkboxes in the drop-down list)? Is it possible to do a for loop and iterate through the values of the param within an expression? Something like
for i = 0 to Parameters!paramXYZ.Count - 1 mystring = mystring & ", " & Parameters!paramXYZ.Label(i).ToString
And then display mystring in the textbox? Or can I use a list control on the report?
I have the SQL query. If the user is selecting all the vendor Numbers available in the vendor number parameter drop down then, I will not include the vendor Number condition in the where portion of the sql query. For that I want to know whether the user has selected all the values available in the drop down. How to identify this?
Would like to restrict the dates users can put as parameters. For example, I have a report showing all orders in year 2007. I have exposed Start Date and End Date parameters. When users click the 'View Report' button, the report will filter for orders where attribute EnteredDate is >= Start Date and <= End Date.
I want to restrict the users from entering a start date greater than today's date. Would also like to restrict them from entering an end date that is less than the start date parameter. How can I do this?
We have a report that has about five different parameters. One of the parameters is a float value and we have a default value set at 999,999,999.00 and the report parameter accepts this value. The other parameter (a string) has a default value set at 0, however it is not showing up in the textbox for that parameter. The parameter is non-queried and is just a report parameter.
When we preview the report, it is there. Once we deploy the report to the report server, it is not. Now, the development machine is using SP2, but the Report Server is still at SP1. Could this be the problem? If it is, why would the float default value display and the string default value not?