Confessions of a Dangerous Mind

Brain.FlushBuffer()
posts - 83, comments - 151, trackbacks - 325

RDLC DataSource

La settimana scorsa mi sono imbattuto in un piccolo problema effettuando il binding di un datasource di tipo object ad un report rdlc; il problema si verificava in questa linea:

rvReport.LocalReport.DataSources.Add(New ReportDataSource("BusinessData", _businessData))

Dove _businessData è un oggetto del Domain Model. L'errore si presentava come: 'Value does not fall within the expected range'.

Riporto la soluzione: Un oggetto di tipo ReportDataSource ammette come DataSource solo oggetti di tipo Collection e NON oggetti singoli. Non è possibile quindi passare un oggetto _businessData, bensì:

Dim _dummyDataSource as New List(Of BusinessData)

_dummyDataSource.Add(_businessData)

rvReport.LocalReport.DataSources.Add(New ReportDataSource("BusinessData", _dummyDataSource))

Print | posted on lunedì 22 ottobre 2007 10.05 |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 3 and type the answer here:

Powered by: