none
Lookup Values RRS feed

  • Question

  • I have a report that displays data in various units (dsSimulations).  I need to be able to lookup the ID of the units in another dataset (dsUnits) in the report and display the appropriate units' name.  Things I have tried (that don't work):

    1.  Adding the function "GetUnits(int uid)" to the dsSimulations.  Attempting to call GetUnits from the report results in "#Error" - though this was not a static funciton which I may try next.

     

    2.  Creating a list data region where I need to display the units and applying a filter to the list Fields!uid = FIRST(Fields!id.Value,"dsSimulations").  Reporting complains about using aggregate functions in a filter.

     

    Other things I've thought of:

     

    1.  Create a separate assembly that I can call as custom code from the report.  The problem with this is, dsUnits is populated from an XML file and not always the same XML file, so I could pass the XML file name into the report as a parameter, but I haven't found a "ReportInit" or similar event in which to load said XML file.

     

    2.  Combine the datasets and add relationships between each unit id field in the Simulations table to the Units table. Though this seems kind of silly considering there are MANY unit id fields.

     

    And finally....

    3.  There has got to be an easier way to do such a common task???

     

    Any help or insight to this seeminly simple problem is greatly appreciated!

     

    Thanks

     

    Dave Taylor

     

     

    Friday, May 16, 2008 6:56 PM

Answers

  • Solution found...hadn't really considered "Subreports" for this, but that works fine.  (Lots of very small sub reports to report the units).

    Monday, May 19, 2008 4:39 PM

All replies

  • Ok, I found Code.OnInit() documented in SQL Server Books - but that does not give access to the Parameters list...if it's not one thing its another!!

     

    Friday, May 16, 2008 8:30 PM
  • Solution found...hadn't really considered "Subreports" for this, but that works fine.  (Lots of very small sub reports to report the units).

    Monday, May 19, 2008 4:39 PM