none
Where to learn about RDLC syntax RRS feed

  • Question

  • Where can I read about how to use RDLC expressions like IIf and so on. I've googled a lot but I don't find any "tutorial" i RDLC

    Monday, October 1, 2007 7:06 AM

Answers

  • The RDL/RDLC expression syntax is VB.NET. Expressions have to start with "=".References to names of Fields, Parameters, ReportItems are case-sensitive.


    Regarding available functions - basically you can use any object / function from the .NET framework which is available within the following namespaces:
    * System
    * System.Convert
    * System.Math
    * Microsoft.VisualBasic

     

    A reference of available expression functions in the VB runtime library is available at:
    http://msdn2.microsoft.com/en-us/library/c157t28f(vs.71).aspx

     

     

    -- Robert

     

    Monday, October 1, 2007 5:38 PM
    Moderator

All replies

  • The RDL/RDLC expression syntax is VB.NET. Expressions have to start with "=".References to names of Fields, Parameters, ReportItems are case-sensitive.


    Regarding available functions - basically you can use any object / function from the .NET framework which is available within the following namespaces:
    * System
    * System.Convert
    * System.Math
    * Microsoft.VisualBasic

     

    A reference of available expression functions in the VB runtime library is available at:
    http://msdn2.microsoft.com/en-us/library/c157t28f(vs.71).aspx

     

     

    -- Robert

     

    Monday, October 1, 2007 5:38 PM
    Moderator
  • =iif(Fields!Profit.Value < 0, "Red", "Black")

    =iif(RowNumber(Nothing) Mod 2, "White", "Lavender")

     

    I agree; it's very hard to find good RDLC tutorials.  Try this link - a word doc, see page 43:

    http://marifegarcia.net/files/ReportViewer%20Compilation%20from%20MSDN.doc

     

    At the bottom of this link, you'd find some tutorial links that I compiled:

    http://marifegarcia.net/rdlc/rdlc.aspx

     

    hope this helped.  good luck!

    Marife

    Thursday, January 3, 2008 4:30 PM
  • THX Marife

    this solved my problem too

    i was looking for a file to print and read, exaclty what u post
    Wednesday, January 16, 2008 6:25 AM
  • I tried using VB and it did not work. Yes, I know I should be more specific than "doesn't work" but VS is vague in it's message; it just says that the code I wrote for background color is not a valid color.

    I write mostly C++ and C# but I know that the code I wrote is valid VB code. I don't have the exact code because VS ate it. It was somethig such as:

    If Tag = 0 Then
    	"Green"
    else
    	Transparent
    end if
    

    I am not sure of the details of how to do what I need to do, and the VB reference is not clear about syntax. It does not specify how to return values. I know that in VB normally we set the function name to the value to return, but I don't see now to do that in a reports expresion. I suspect that there is something that is obvious to people familiar with the syntax but for those of us that don't see it, it is not obvious.



    Sam Hobbs; see my SimpleSamples.Info
    Friday, April 30, 2010 7:02 AM
  • There is no 'Transparent' keyword in VB, that's why the code is not valid.

    Instead, I suggest to use something similar to this:

    If Tag = 0 Then
    "Green"
    else
     Nothing
    end if

    HTH,
    Robert


    Robert Bruckner   http://blogs.msdn.com/robertbruckner
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, April 30, 2010 7:38 AM
    Moderator
  • Transparent without quotes is the default value. So why is it there if it is not valid?

    Sam Hobbs; see my SimpleSamples.Info
    Friday, April 30, 2010 4:20 PM
  • Transparent only shows up in the UI. 

    If you look inside the RDL/RDLC file, you will find that the Color element is omitted in that case - you will not see the value Transparent show up.

    HTH,
    Robert


    Robert Bruckner   http://blogs.msdn.com/robertbruckner
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Sunday, May 2, 2010 11:51 PM
    Moderator
  • Note: Marife's links are broken
    Thursday, March 10, 2011 3:07 PM