Hi,
I'm within an MVC project, and I'd like to generate a PDF with the data contained into my Model. So I've created a Report using Telerik Reporting, and now I'd like to link it with my MVC Model.
The render is easy:
ReportRegistration reportRegistration = new ReportRegistration();
string fileName = @"C:\ReportRegistration.pdf";
ReportProcessor reportProcessor = new ReportProcessor();
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.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);
}
but how do I bind data in that model to the designer? For example, in Attach the Designer I have. I'd like to use the data inside BusinessName member variabile inside my Model. Tried ObjectDataResorce but when I double click, Visual Studio crash.
Thanks