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

Datasource Help

1 Answer 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff Kershner
Top achievements
Rank 1
Jeff Kershner asked on 07 Dec 2015, 09:55 PM

I am creating a reporting application for a client that does not use the designer but rather a table based report that allows for drilling in.  I am using the HTML5 MVC and I have a working report in my website that displays the Sample Report.trdx.

 

What I need is a way to pass in a report ID to the page and have the ability to generate a data source that gives the user interactive access to all the metrics that are behind the data.

 

I have searched through the documentation and I am a little confused how I can get my data into a format that the Telerik Reporting can use and how exactly to pass it to the report control (I assume through the ReportSource field).

 

        @(Html.TelerikReporting().ReportViewer()
            // Each report viewer must have an id - it will be used by the initialization script
            // to find the element and initialize the report viewer.
            .Id("reportViewer1")
            // The URL of the service which will serve reports.
            // The URL corresponds to the name of the controller class (ReportsController).
            // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
            .ServiceUrl(Url.Content("/api/reports/"))
            // The URL for the report viewer template. The template can be edited -
            // new functionalities can be added and unneeded ones can be removed.
            // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
            // .TemplateUrl(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-9.2.15.1126.html"))
            // Strongly typed ReportSource - TypeReportSource or UriReportSource.
            .ReportSource(new UriReportSource() {Uri = "SampleReport.trdx"})
            //.ReportSource(Model)
            //.ReportSource("73", new Dictionary<string, object>() { { "parameter1", "value1" }, { "parameter2", "value2" } })
            // Specifies whether the viewer is in interactive or print preview mode.
            // PrintPreview - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
            // Interactive - Displays the report in its original width and height with no paging. Additionally interactivity is enabled.
            .ViewMode(ViewMode.Interactive)
            // Sets the scale mode of the viewer.
            // Three modes exist currently:
            // FitPage - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
            // FitPageWidth - The report will be zoomed in or out so that the width of the screen and the width of the report match.
            // Specific - Uses the scale to zoom in and out the report.
            .ScaleMode(ScaleMode.Specific)
            // Zoom in and out the report using the scale
            // 1.0 is equal to 100%, i.e. the original size of the report
            .Scale(1.0)
            // Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback).
            // The session is stored in the browser’s sessionStorage and is available for the duration of the page session.
            .PersistSession(false)
            // Sets the print mode of the viewer.
            .PrintMode(PrintMode.AutoSelect)
        )

Where can I find an example on how to figure out what I want to do?

 

Thanks,

--Jeff

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 10 Dec 2015, 11:30 AM
Hello Jeff,

Passing the report data source from the client to the server is not recommended. Instead, you can use an ObjectDataSource and pass a parameter value from the report to the data retrieval method. Based on the data source parameter value you can extract different data in the data retrieval method. For more information, please refer to the ObjectDataSource Component help articles.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jeff Kershner
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or