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

HTML5 ReportViewer and Objectdatasource

1 Answer 175 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Youi
Top achievements
Rank 1
Youi asked on 18 Nov 2013, 04:18 AM
Is there an example of how to use the Html5 reportviewer with a objectdatasource

public class DashboardController : Controller
{
     public ActionResult Index()
    {
        var model = data.GetReportData()
 
        return View(model);
    }
}
@(Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
        .ServiceUrl("/api/reports/")
        .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.htmll")
        .ReportSource(new TypeReportSource{TypeName="MyReportLibrary, Dashboard"})
        .ViewMode(ViewModes.INTERACTIVE)
        .ScaleMode(ScaleModes.SPECIFIC)
        .Scale(1.0)
        .PersistSession(true)
)

How do I attached the model to the reportsource?

1 Answer, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 20 Nov 2013, 03:15 PM
Hello Youi,

It is important to understand that the report viewer has nothing to do with the data source you will be using. The data source is used only when creating reports. Once you have created your report you can use the report viewer to display it and print/export it, etc.

In the current code snippet that you have provided it is too late for the data source - it should be used when you are creating the report.

For more information please check our online help and Designing Reports help article and the related subarticles.

Regards,
IvanY
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Youi
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Share this question
or