This is a migrated thread and some comments may be shown as answers.

csv datasource gives error 'Failed to convert parameter value from a Object[] to a String'

3 Answers 725 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 07 Mar 2018, 11:16 AM

Hi,

Currently i am working with the Telerik standalone report designer to generate a report. The report consists of a crosstab table which is populated by a stored procedure. One of the parameters for the stored procedure is a column name (string) which the user should be able to choose from a list of options.

What i am trying to do is populate the list of column names (strings) of which the user can choose from with a csv datasource. The list is actually a TextBox for which the DataSource is set. The column names are shown, but when the Preview button is clicked on the report gives an error:

"An error has occurred while processing Table 'table1':

Failed to convert parameter value from a Object[] to a String.

-------------------InnerException------------------------

Object must implement IConvertible."

Because i want to set everything in the designer itself and do not want to use c# code how can i do this?

 

 

3 Answers, 1 is accepted

Sort by
0
Muhammad
Top achievements
Rank 1
answered on 09 Mar 2018, 01:13 PM
Hello Richard,

Can you provide screenshot of the designer where you're using the fields and the what is the datatype of the column you want to display ? I'm not sure about this but isn't there any option that you could convert your column to string in the query ?
Most of the time I follow the same approach as this is quite faster way to fix things.
0
Richard
Top achievements
Rank 1
answered on 09 Mar 2018, 01:30 PM

Hi Muhammad,

One of the ReportParameters is OrderByClause. This is a string (TextBox) and suppose to display the list of strings retrieved from the csv datasource. I have created a CSV datasource using the second tab 'Enter CSV as text' and entered: Column1, Column2, Column3 etc. In the properties of the OrderByClause i have set the following value: AvailableValues.ValueMember = Fields.Column1.

The string is displayed in the OrderByClause textbox (it has been turned into a dropdownlist) with the strings Column1, Column2 and Column3. However, when i select one of them and click Preview the error message appears.

 

1
Wije
Top achievements
Rank 1
answered on 24 May 2019, 04:58 PM

Hi Richard, 

if you are selecting multiple values from the list or drop-down.

check your data source -->  parameters --> values.

You may have set your data source parameter like this 

= Parameters.SalesParameter.Value

You might wanna join the multiple values like this.

=Join(",", Parameters.SalesParameter.Value)

 

 

Tags
Report Designer (standalone)
Asked by
Richard
Top achievements
Rank 1
Answers by
Muhammad
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Wije
Top achievements
Rank 1
Share this question
or