Give Blood (Report Expressions in Report Builder)


It’s not obvious, but SQL Server 2005 Report Builder allows you to use expressions in textboxes on the report surface. You don’t get an expression editor, but if you begin a textbox value with ‘=’, it will be evaluated at report processing time. For example, you can add a time / date stamp to a report by using =Globals.ExecutionTime.ToString(“f”). Since you can’t set the formatting property, you will have to format the string yourself if you don’t like the default format.

Comments (8)

  1. vc says:

    may I add a column show a field value in the matrix after I have a column group ?

  2. bwelcker says:

    Not sure what you are asking. You want to add a field value to the matrix after you have defined a column group? This is just basic matrix manipulation.

  3. Enrico Albrecht says:

    Hello Brian,

    i am looking for a way to create report parameters in Report Builder. Is there any way to do that?

    Enrico

  4. bwelcker says:

    For parameters in Report Builder, in the filter dialog, click on the left hand item (attribute or entitry) and select prompt.

  5. sray says:

    Any way to make prompted parameters in Report Builder optional at execution time?

  6. bwelcker says:

    I just posted an entry on how to do this at http://blogs.msdn.com/bwelcker/archive/2006/07/29/682444.aspx.

  7. Eric says:

    I assume I can add page numbers this way? Ideally, Page # of ##.

  8. bwelcker says:

    Unfortunately, Report Builder doesn’t provide access to the Report Header and Footer and you can’t use page numbers in the body. This is possible in Report Designer.