Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

RDLC Multi-Value Input Parameters

$
0
0

Using the following query for my dataset: 

select

gu.id, gu.first_name, gu.last_name, a.activity_date, sum(a.hours)
fromglobal.users gu
leftouterjoin activity a on a.user_id = gu.id
groupby gu.id, gu.first_name, gu.last_name, a.activity_date
having (a.activity_date between :START_DATE and :END_DATE) and (gu.id IN (:USER_ID_LIST))
orderby gu.last_name, gu.first_name, a.activity_date

Visual Studio creates the following XML for the parameters: 

<Parameters><Parameter AllowDbNull="False" AutogeneratedName="START_DATE" ColumnName="ACTIVITY_DATE" DataSourceName="PROJECT.ACTIVITY" DataTypeServer="DATE(7)" DbType="DateTime" Direction="Input" ParameterName="START_DATE" Precision="0" ProviderType="DateTime" Scale="0" Size="7" SourceColumn="ACTIVITY_DATE" SourceColumnNullMapping="False" SourceVersion="Current"></Parameter><Parameter AllowDbNull="False" AutogeneratedName="END_DATE" ColumnName="ACTIVITY_DATE" DataSourceName="PROJECT.ACTIVITY" DataTypeServer="DATE(7)" DbType="DateTime" Direction="Input" ParameterName="END_DATE" Precision="0" ProviderType="DateTime" Scale="0" Size="7" SourceColumn="ACTIVITY_DATE" SourceColumnNullMapping="False" SourceVersion="Current"></Parameter><Parameter AllowDbNull="False" AutogeneratedName="USER_ID_LIST" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="Decimal" Direction="Input" ParameterName="USER_ID_LIST" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current"></Parameter></Parameters>

 In the page load for my web page I assign the default values:

empHoursObjectDataSource.SelectParameters.Item(

"USER_ID_LIST").DefaultValue ="1"
empHoursObjectDataSource.SelectParameters.Item("START_DATE").DefaultValue = _firstDayOfMonth
empHoursObjectDataSource.SelectParameters.Item(
"END_DATE").DefaultValue = _lastDayOfMonth

The USER_ID_LIST is the issue.  A single-value "1", works just fine. However when I try to include
several values for USER_ID_LIST like this:

empHoursObjectDataSource.SelectParameters.Item("USER_ID_LIST").DefaultValue ="1,26"

I get the following error message:

An error has occurred during report processing.

  • 1,26 is not a valid value for Decimal.
  • Input string was not in a correct format.
  • How do I send multiple values to the parameter for the "IN" clause?


  • Viewing all articles
    Browse latest Browse all 1418

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>