views:

345

answers:

1

hi, i am trying to create a report from a row of data with about 60 columns. The workflow is as follows.

1] user selects the fields they want to view in the report from within c# 2] c# calls a sp in sql and passes the fields (expecting between 1 and 5 fields per report) 3] ssrs displays these fields on a pie chart in reporting services.

My questions are,

1] can i pass an array of fields through to sql in one parameter? or do i have to set up 60 parameters to the report and pass them all through even if only a few are required.

2] how can i programatically add only the selected fields to the pie chart and have it created at runtime? my experience has always been you have to build the report prior to deployment.

Thanks!

+2  A: 

Take a look at - http://stackoverflow.com/questions/1069311/passing-an-array-of-parameters-to-stored-procedure

http://stackoverflow.com/questions/114504/is-it-possible-to-send-a-collection-of-ids-as-a-ado-net-sql-parameter

Arrays and Lists in SQL Server 2005

SUMMARY:This article describes a number of different ways to do this, both good and bad. I first give a background to the problem (including a quick, if the not the best, solution). I then give a brief overview over the methods.

adatapost
thanks.. any idea for my second question regarding reporting?
Grant