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

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

Loop in SSRS Expression

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :Sql Server

Hi guys,

I got a multi value parameter which displays all my 'companies'.  On my report header, I wish to display all the companies selected by the user.

Parameters!Company.Label(0) only shows the first on selected

Please, any help will be greatly appreciated


W Wilmot




View Complete Post

More Related Resource Links

Expression for 24 hours time and date in SSRS

Hi Guys, What is the expression for  displaying 24 hours time and date in SSRS? Is this the format: =Format(now, "MM/dd/yyyy HH:mm:ss")?Thanks Shiven:)

SSRS BUG? When a FontStyle expression is used in a report, the Browser Text Size setting overrides t

I have created a report that has the same font size for all the sections in the report. Some sections' fields use a FontStyle expression that changes the FontStyle between Normal and Italics conditionally. I run the report through the reportserver interface and the report looks fine. I run the report through the ReportViewer control and the the fields which use the FontStyle formula are overridden by the Browser's Page Text Size. Also, when I look at the inline HTML Style that's generated, the fields with the formula don't have a style, they are blank, while the fields with without a FontStyle expression have an inline HTML Style generated. And this is probably why the browser text size setting can override. This seems like a ReportViewer HTML render bug... Or is there a way around it??

Convert crystal expression to ssrs

Hi, I am new to crystal to ssrs converstion. could any one please convert the below expression to ssrs. Local StringVar strPaidDate := ToText({CLM153_CLMS.Paid Date Key}, "0"); strPaidDate := Mid(strPaidDate, 5, 2) & "/" & Right(strPaidDate, 2) & "/" & Left(strPaidDate, 4); strPaidDate & chr(10) & {CLM153_CLMS.Primary Group Identifier} & chr(10) & {CLM153_CLMS.Class Plan Identifier} & chr(10) & {CLM153_CLMS.Product Identifier} Thanks, Naveen kumar.Y

Checking weather a chart is hidden or displayd by using an Expression (SSRS 2008)

Hello, I want to check weather a chart is hidden or displayd by using the Expression of a Text Box that toggles display of that chart. Therefore I need to call the chart in the Expression. Something like this: =IIF(ReportItems!Chart2.Hidden = False ... But obviously charts are not regarded as report items by ssrs!?!? Thanks Axel

SSRS 2005 - Expression Results


The table being used for my report contains 2 months worth of data. When viewing the report, the report shows results for both months even though I have the following expression. What am I doing wrong?


how to use split in iif conditional expression in ssrs 2008 r2



how can i use conditional iif combined with split?

i'm trying to get values from check boxes(from sharepoint custom list), the condition is like this :

if the value is null/blank, the return value would be "-"

if the value is not blank, the return value would be the value of the check box field that already splitted from the ";#" character

as you might know, values from check box is written along with ";#" character before and after the value itself.

i tried to use this expression:

=IIF(Fields!Action__For_User_Access_.Value Is Nothing," - ",(Split(Fields!Action__For_User_Access_.Value, ";#")(1)))

the split worked just fine, but the conditional iif didn't work.

can anybody help me?

i used that expression in the calculated field.

btw, i'm using report builder content type from ssrs 2008 r2


thx in advance.



Partially Bold Text in SSRS 2005 using Expression ?



I am using SSRS 2005.

I have one requirment. I need to Partially Bold some part of Text in column.

Below is the Example.

Name < - -- Column in SSRS 2005 Report.

This column contains combination of Last Name and First Name. All Database record contains Last name , while in some record our requirment is to append First Name with that.

That is i aleady handled using Nested IIF Expression.

Now, i want to display appended First Name in normal while all Last Name whihc is Database Field in BOLD Font.

How is it possible ?


SSRS 2008 R2 - Line chart labels - visibility based on expression?


I would like to control the visibility of a data label in a line chart using an expression. For example, I have a requirement to show the data label for two compariable data points in a line chart where the horizontal axis is time (Q1, Q2, Q3, etc...) and the data points are determined based on a selected parameter. The basic idea is that a user can select to view Q3 as the end point of reporting and the chart will graph a complete time line (e.g. FY 2001 thru FYXX Q3) but only show the label for Q3 and prior year Q3.

I have tried to build an expression in the visibility property of 'Chart Series Labels' but this does not appear to work.


What is the Expression for calculating Sum of percentages in SSRS report.


Hi All,

I want to calculate Sum of percentages in my SSRS report.

I have two fields :

Field1   Field2

For Field1 I am using the following formula --- Fields!suminsured/Sum(Fields!no.ofRisks) * 100

The  Field1  formula is working correctly....

Now I want to calculate Field2 from  Field1 ....

My Field2 Formula is Sum(Fields!suminsured/Sum(Fields!no.ofRisks)*100) --- But when I am doing this way its giving error...

Can any body let me know how to acheive Field2 ....??

Field2 is nothing but Sum(Field1) ....But for Field1 I am using Percentage Forumula....So field2 should be Sum(Field1) percentages....

Any ideas in this regard will be appreciated...

Waiting for the responses..




SSRS Format Expression w/ Dashes


I have a filename field that contains text such as:  data/0123456789ABCDEFG.txt

Does someone know of an expression that can format it as this: 

data/0123456789ABCDEFG/0123456789-AB-CDEFG.index.htm               ?

So, it would be adding the original field again and formatting it with dashes?

Hope that makes sense....




I hear and I forget. I see and I remember. I do and I understand.

SSRS 2005 error: The Value expression for the textbox contains an error: [BC30205] End of statement



I am trying to run an ssrs 2005 report and receiving the error above.

I want to run custom code in the CODE tab.

Here is my code

Public Function GetDayName (dayIn as integer) as String
Select Case dayIn
Case 0
 Return "Sunday"
Case 1
  Return "Monday"
Case 2
 Return "Tuesday"
Case 3
  Return "Wednesday"
Case 4
  Return "Thrusday"
Case 5
  Return "Friday"
Case 6
   Return "Saturday"
 Case Else
  Return  "None"
End Select
End Function

What is wrong with my code?


Expression help Crystal to SSRS 2008


How would i convert this expression to SSRS/

1.) Sum(Qty),Reportnumber))


something like this is not working for me



 Crystal Sum(qty),@Rackstatus))

Tryin to use it for SSRS like this? @Rackstatus is an expression which i already converted to SSRS

sum(fields!qty.value), sum(


Can you help ?


Fields!RACKNUMBER.Value &

"-" & Fields!INVENTORYSTATUS.Value))??????

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

where can i download from SSRS?


Hi all,

My  machine is alread installed with Sql Server 2005.  I need to install sql server 2005 reporting services as a add-on.

Where can i download this from. Can anyone post the link here..?


Thanks in advance


MDX Query parameter from SSRS


I've a MDX Query that has where clause as shown below.
I'm designing report using SSRS 2008. How can i pass date as parameter ? I tried to setup @from and @to as parameter but not working ?
any ideas....

WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )

need it to work as
WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )



How to change text in columns in SSRS?


I need to create a complex report and export it to Excel. 

In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. Any ideas please. I am new to SSRS and tried out many ways but didn't get it.

for each loop



Need help in for each loop. i'm poor in for each loop. i wanna create a for each loop that can give me 2 value in each rows.

i create a for loop.. but is a mulitple rows. Anyone can help ?

here is my code.

Dim x As Integer, y As Double, x1 As Integer

        Dim d As Date, prevD As Date
        Dim d1 As TimeSpan

        temp_sec = ac.getTempTime(ddl_date.SelectedValue, ddl_id.SelectedValue)

        For I As Int32 = 0 To temp_sec.Tables(0).Rows.Count - 1
            If I Mod 1 = 0 Then
                ' To prevent list out of bounds
                If I + 1 < temp_sec.Tables(0).Rows.Count Then
                    d = temp_sec.Tables(0).Rows(I).Item(0)
                    prevD = temp_sec.Tables(0).Rows(I + 1).Item(0)
                    d1 = prevD - d
                    x = d1.TotalSeconds
                    x = x1 + x
                    y = temp_sec.Tables(0).Rows(I).Item(1)
                    list.Add(x, y)
                    x1 = x
                End If
            End If

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