Ask a questionAsk a question
 

QuestionData Sources, Datasets and Scope

  • Tuesday, November 03, 2009 6:32 PMbpeikes Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm trying to create a couple of reports which will be viewed using the report control using local reports. I've created a dataset with several datatables, which I will fill using code in the form, (i.e not using table adapters). When I open the report, I see in the Data Sources I see a tree view with my dataset's name at the top node and all of my datatables listed below it. The dataset's name is ClientReportDataset, and one of the tables is called MTD_Summary. MTD_Summary will have one row in it, which contains some summary information about the report, i.e. client name, etc.
    I dragged one of the fields over from the MTD_Summary table in the Data Sources window onto the report into a textbox, where the designer put:
    =First(Fields!ClientName.Value). I get a complaint from the compiler
     "Error 2 The Value expression for the textbox ‘ClientName’ has a scope parameter that is not valid for an aggregate function.  The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. C:\src-tfs\bpeikes\Overlay Services\Main\Source\OverlayServices\ClientReportLib\ClientReportMTD.rdlc ClientReportLib"

    Now I looked around and could find nothing in the MS documentation which tells you about what to set the scope to when using Datasets. I finally tried dragging the field directly onto the report, and it put:
    =First(Fields!Date.Value, "ClientReportDataset_MTD_Summary")

    Ah ha!
    Can anyone point me to documentation which says that you are supposed to use "_" as part of the scope? It seems like using Reporting Services controls is basically just trial and error.