Report builder problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig J via DotNetMonster.com

    #1

    Report builder problem

    I'm trying to create a report and am getting "Report item expressions can
    only refer to fields within the current data set scope or, if inside an
    aggregate, the specified data set scope."

    I have a tableadaptor and a dataset and the query that fills the dataset has
    a couple joins and a Union All in it. When the dataset is expanded in the
    Data Sources it shows the correct fields. If I drag any of the first four
    fields onto the report the report will generate just fine, but if I drag any
    of the other fieds onto the report I get the build error listed above. I've
    been banging my head against this for two days now, so ANY ideas are most
    welcome.

    Since I know that some of you will want to see the query.....

    SELECT sysinfo.agencyn ame, clients.fname, clients.mname, clients.lname,
    clients.clientn o, ai.ddate, ai.witfirst, ai.witlast, ai.doctor, ai.nurse, ai.
    toldparent,
    ai.toldadvoca, ai.sublocatio, ai.account, ai.ttime, ai.
    location, ai.nature, ai.aggfirst, ai.agglast, ai.place, ai.repobyfirs, ai.
    repobylast, ai.response, ai.tpm,
    ai.dnnotes, ai_injur.bodypa rt, ai_injur.severi ty,
    ai_injur.injury type, ai_injur.ai_key , ai.ddate AS Expr1
    FROM sysinfo CROSS JOIN
    ai_injur LEFT OUTER JOIN
    ai ON ai.ai_key = ai_injur.ai_key LEFT OUTER JOIN
    clients ON ai.client_key = clients.client_ key
    WHERE (clients.is_cur rent = 1)
    UNION ALL
    SELECT sysinfo.agencyn ame, clients.fname, clients.mname, clients.lname,
    clients.clientn o, ai.ddate, ai.witfirst, ai.witlast, ai.doctor, ai.nurse, ai.
    toldparent,
    ai.toldadvoca, ai.sublocatio, ai.account, ai.ttime, ai.
    location, ai.nature, ai.aggfirst, ai.agglast, ai.place, ai.repobyfirs, ai.
    repobylast, ai.response, ai.tpm,
    ai.dnnotes, 'none' AS BODYPART, 'none' AS SEVERITY,
    'none' AS INJURYTYPE, ai.ai_key, ai.ddate AS Expr1
    FROM sysinfo CROSS JOIN
    ai LEFT OUTER JOIN
    ai_injur ON ai.ai_key = ai_injur.ai_key LEFT OUTER JOIN
    clients ON ai.client_key = clients.client_ key
    WHERE (clients.is_cur rent = 1) AND (ai_injur.ai_ke y IS NULL)

    --
    Message posted via http://www.dotnetmonster.com
Working...