Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts

Monday, March 19, 2012

Issues Filtering a chart

I am trying to filter a series in a chart by specifying
a paramter. I am showing a chart where the data
returned from the SP has many employees, but I only
want the employee specified in the parameter. However,
when I enter the following:

=Parameters!employee_id.Value

into the filters tab for the employee series, the chart
is blank and I know for sure that there is data for the
employee I have specified in the parameter because
when I remove the filter, that employee shows up in
the legend along with 20 others.

This should be simple and it's driving me nuts!
Can someone point out what I'm doing wrong?

Turns out the SSRS "like" operator does not
ignore spaces like SQL does. I had spaces
coming back at the end of each employee so
I had to modify the above as follows:
=Parameters!employee_id.Value + "*"

Monday, March 12, 2012

Issue with the ForEachLoop Task in SSIS


Hi,


I am using a SQL task to execute a stored procedure which returns a single field with multiple records. I want the records returned by the stored procedure to be processed one by one within a ForEachLoop container. How do I assign the records one by one to one variable and use it in a Script task running inside the ForEachLoop container.


I am using 2 tasks in my package.


In my first task I call a SQL task that executes a stored procedure which returns a list of reference numbers (TrackData). This works perfectly.


However, in my second task I must use the ForEachLoop task to loop through the above list and set the value of var_TrackData (a user variable declared by me) with the value of the TrackData present in it during that particular loop.


I am not sure how to go about the second task. Any help would be greatly appreciated.

Create an object variable.

In the execute sql task set the resultset to the variable name (set result name to 0).

Create a variable to hold the reference numbers (int or string?)

Create a for each loop task

Set the collection to for each ADO enumerator

Set the ADO object source variable to your object variable name (which contains the resultset).

In variable mappings set the variable to the variable name you created to hold the reference numbers

Set the precednce so that the execute sql runs before the for each llop.

Now when this runs the object variable will be set to the resultset the the for each loop will itterate through it setting the variable to the reference number for each loop.

|||

See if this post gives you some idea of how you can do it:

http://rafael-salas.blogspot.com/2006/12/import-header-line-tables-into-dynamic_22.html