I'm still not able to bind data from MVC.
I've imported an ObjectDataSource, linked to my ViewModel's RegistrationsViewModels. Here's the code:
ReportRegistration reportRegistration = new ReportRegistration();
reportRegistration.DataSource = registration; // current ViewModel, contains data, such as BusinessName = "MyAgency"
string fileName = @"C:\ReportRegistration.pdf";
ReportProcessor reportProcessor = new ReportProcessor();
InstanceReportSource instanceReportSource = new InstanceReportSource();
instanceReportSource.ReportDocument = reportRegistration;
RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
using (FileStream fs = new FileStream(fileName, FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
}
It renders correct the PDF, but the data when rendering is not available, and "= Fields.BusinessName" print "". Where am I wrong please?