.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Label of parameter = values of 2 fields

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Sql Server


I would like to create a parameter that has as value, the combination of 2 fields of my dataset.
Say like Name and FirstName combined as EmployeeName
There is no chance I can update/change the procedure that delivers these fields.

I tried looking into the code, but didn't have a lot of success.
Anyone some ideas?


View Complete Post

More Related Resource Links

Any way to pass Multiple Values for a single Label in the Parameter?

  I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610" One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter.  PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data. Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610. QUESTION: Any way to pass Multiple Values for a single Label in the Parameter? I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting it correct. I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….   Note: We are using Report Builder 3.0  

Get Submitted SQL with Parameter Values (Not @Names)



I want to retrieve the full SQL that my Web Application generates and executes on the database. So when the INSERTED or UPDATED events are triggered on the SqlDataSource, I want to get that particular SQL Statement.

The  problem I've got there though is when I use "e.Command.CommandText" that gets the SQL statement with the paramter names NOT the paramter values. I specifically need the values.

So... how can I get it to display the full SQL statement containing submitted values!?



Values in user control fields empty when AutoEventWireup=true ?

As a BizTalk developer I'm trying to build a ASP.NET website so some obvious things might be new to me (so please be gentle). I have a web form and I have a user control on it. This user control contains a panel with some user properties that are to be stored in a database. So far nothing fancy. The user control itself contains a panel and is working fine (all code to retrieve and store the values is working). I used the default settings of creating a user control and one of them was AutoEventWireup=true. This works fine because I also have some dropdown boxes (and other fields) that need to be filled with values from the database and that happens in the Page_load event. The panel specifies the 'DefaultButton' which calls a method when clicked to save the values after the user has changed them. On this click the code of the method is called, I confirmed that, but I found out that the values of my controls on the user control (for example the Textbox control) are empty. As a non-ASP.NET developer I couldn't figure out why. So I changed some settings like AutoEventWireup to false. Off course this resulted in my dropdown boxes no longer to be initially filled, but my surprise was big to find out my controls actually contained the values the user typed in. Logically I need both the values and th

How do you add duplicate fields to a SSRS custom report and receive differtent output values.

I have built a custom report in SSRS 2008 using fields for supplier and customer.   I have added a Parent Row Group using the Supplier field for the group expression and used the Customer Details as my child details group. This returns a list of all customers for each supplier.   (Supplier | = Customer details ( Name, Dob etc.)   How would I add an additional Supplier field to the customer details returning only values for other Suppliers used by a customer, not the value of the Supplier listed in the Parent Group?

problem with passing parameter values to stored proceedure from asp.net c#

hi all, i am facing a problem while passing parameters to a stored proceedure. following is my sql query written for creating this stored procedure:   CREATE proc [dbo].[getstudent]( @wherecolumn nvarchar(2000), @wherevalue nvarchar(2000)) asbegin  declare @sql nvarchar(max) set @sql = 'select * from student2 where ' + @wherecolumn+'='+@wherevalueexec sp_Executesql @sql end   my table contains four columns: And the sql Query For the table is as follows:   CREATE TABLE [dbo].[student2]( [name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [rollno] [int] NOT NULL, [class] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [section] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, CONSTRAINT [PK_student2] PRIMARY KEY CLUSTERED ( [rollno] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]   from page behind I am passing the values to parameter as follows:   SqlCommand command = new SqlCommand("getstudent", c.con); SqlDataAdapter datadapter = new SqlDataAdapter(c.cmd); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@wherecolumn", SqlDbType.NVarChar).Value = "rollno"; command.Parameters.Add("@wherevalue", Sq

Number of query values and destination fields are not the same

If RadioButton1.Checked = True Then rbtn = 1 Else rbtn = 2 End If ' Our insert command strSQLQuery = "INSERT INTO tblJobs " _ & "(filingDate, filingDay, reportDate, reportTime, company, jobsite, location, duration, DrugTestReq, foreman, instructions, jobSteward, nPlumbers, nFitters, nWelders, nTradesmen, nPlAppr, nFitAppr, nServTech, nHelpers) " _ & "VALUES (@DTValue, @TextDay, @DTValue2, @TextValue, @TextValue2,@TextValue3,@TextValue4,@TextValue5,@rbutton,@TextValue6.@TextValue7,@TextValue8,@NumVal,@NumVal2,@NumVal3,@NumVal4,@NumVal5,@NumVal6,@NumVal7,@NumVal8)" ' Create new command object passing it our SQL insert ' and telling it which connection to use. objCommand = New OleDbCommand(strSQLQuery, objConnection) ' Add parameters that our SQL command takes: 'radio button 'OleDbType. objCommand.Parameters.Add(New OleDbParameter("@rbutton", OleDbType.LongVarChar)) '- objCommand.Parameters.Add(New OleDbParameter("@DTValue", OleDbType.Date)) objCommand.Parameters.Add(New OleDbParameter("@TextDay", OleDbType.LongVarChar)) objCommand.Parameters.Add(New OleDbParameter("@DTValue2", OleDbType.Date)) objCommand.

NULL label doesn't appear on drop down or multi-select parameter.

Hi, I am using SSRS 2005 SP3. I have the following query that I use for my parameter: SELECT 0 AS c1, 'NOT Specified' AS c2 UNION SELECT 1 AS c1, NULL AS c2 UNION SELECT 2 AS c1, 'Test 1' AS c2 UNION SELECT 3 AS c1, 'Test 2' AS c2 Let's call my parameter prm1. The type of prm1 is string and it has "Allow null value" and "Allow blank value" options ticked. C1 is the value field and C2 is the label field for prm1. When I preview the report, and I didn't see NULL in my drop down list,  but that record has been shown as 1 (which is the value). I am wondering if this is a normal behavior of SSRS? It's not a big deal. I can replace NULL with something else, but I am just curious. Cheers, Uzzie

How to Create an MDX Query Parameter to Select 30 Values from a Dimension?

Hi, I'm using SSRS 2005 to report on an SSAS cube that contains a Procedure dimension.  I don't need to use members of this dimension in my report, but rather need to select records (patients) where their chart has one or more of the codes.  I've researched this today and cannot locate the best approach.  Thus far, I've attempted to create an MDX query parameter as part of my dataset.  However, I don't know whether this is the correct approach, and how to structure the syntax so that only records with one or more procedures are included in the report?  If so, what is the proper MDX syntax for setting my Procedure code equal to the query parameter? Thanks, Sid

Passing multi values to another multi value parameter

Hi, my requirement is as follows I have a parameter1 in which i populate values from database. the user can select multiple values from parameter1. after the parameter1 i have another parameter2 which is also mutliselection value. i,e depending on the selection of parameter i need to populate remaining values in Parameter2 (which is also a multi selection value). i have splited the values from parameter1 and passed the value of parameter1 (parameter1.value) to parameter2. but i am getting the following error An expression of non-boolean type specified in a context where condition is expected, near ',' incorrect syntax near the keyword 'ELSE' can anyone help me in this Thanks, Rajesh Peethala

Format Datetime Parameter Label

I'm trying to format the label of a parameter which is populated by a dropdown in SQL2008 RS. Essentially, i want to put a title in the report which puts the date in the format dd MMM yyyy. I have tried the following options with no luck: =Format(Parameters!MyDate.Label, "dd MMM yyyy") =Format(CDate(Parameters!MyDate.Label), "dd MMM yyyy") Can this be achieved in this way? I "could" reformat the data in the dataset, but i'd rather explore this avenue first. TIAevery day is a school day

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

Report Parameter Values - Can I use getdate() or now() or any other function?

Hi all,      I have a report that utilizes a calendar function but I need to make it a subscription report. Is it possible to use getdate() or now() on the Report Parameter Values? I have a text box that says Enter a Date and that is where I want to have the default value to be run with the subscription. Please let  me know if possible. Thank you.

Null values in formula fields

Hi,I tried using this and am concatenating the fields together.  It does not appear to be working.  Here's what I have.  Any suggestions?   IIF(IsNull({nomination.recparty1}), '0.0', {nomination.recparty1} ) &  chr(13)IIF(IsNull({nomination.recparty2}), '0.0', {nomination.recparty2} ) & chr(13)IIF(IsNull({nomination.recparty3}), '0.0', {nomination.recparty3} )andif IsNull({nomination.recparty1}) then '0.0' else {nomination.recparty1} & chr(13)if IsNull({nomination.recparty2}) then '0.0' else {nomination.recparty2} & chr(13)if IsNull({nomination.recparty3}) then '0.0' else {nomination.recparty3}Both this gets failed beacuse my fields are returned as null.Please get me to solve this.Thanks in advance.Regards,Mugil

Ignore a parameter values ??

Hello I will briefly describe my problem, I have a report as a matrix where the years are presented in columns and below these years we find months, the report accepts as parameter the year and month and other params, I'd like under the choice of an user to display either the years and months at a time or Only the years. I tried as a solution to add a new value = "Ignore months" to the parameter "month " but when i try to view the report, it does not display anything (because it filters month which = 'Ignore months ' and finds no result) So there is a way to ignore the month parameter values in this case??? Hope to get response as soon as possible.Thank you Regards Aya

System.Reflection: How to use the name of fields within classes to get the values?

Hey there, I have  a class defiend as follows:public class VisitorStat { public int? PageViews { get; set; } public int? Visits { get; set; } public int? Visitors { get; set; } ... } At some point in my program, I need to gather the  Visitor stats and create a report table.List<VisitorStat> visitorStats = GetVisitorStats(startDate, endDate);   My issue is this: Because there are many rows in the table, rather than hard coding the name for each row as: "PageViews", "Visits", "Visitors"... I want a way to use the name of the fields in the class to create the Row name and insert the appropriate values. I found out about System.Reflection and wrote the following:  Type type = typeof(VisitorStat); // Get type pointer FieldInfo[] fields = type.GetFields(); // Obtain all fields //Start creating a row for each field in the class foreach (var field in fields) // Loop through fields { object temp = field.GetValue(null); //The first cell in the Row contains the name of the field Cell Col2Row1 = new Cell(new Paragraph(field.Name)); PdfTable.AddCell(Col2Row1); //for item returned when calling the function to get t

Report parameter values must be specified before the report can be displayed. Choose parameter value


Helllo...I am getting error "Report parameter values must be specified before the report can be displayed. Choose parameter values in the parameters area and click the Apply button." when I deploy the report in the SharePoint. The report works fine in the when I run in BIDS. we have two parameter in this report...Parameter #1 is tied filterd based on the user who is accessing the report and Parameter #2 is dependent on the value selected in Parameter #1.

Please let me know what I am doing wrong here? Is there any workaround to get past this message?

Thanks for help.


How to add values of a fields (decimal numbers) to another field?

I have bunch of decimal fields on an InfoPath form and I need to add them up into a totals field when the form is saved.  How can I do that ?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend