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

Telerik reporting MVC .net

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rosbel
Top achievements
Rank 1
Rosbel asked on 27 Mar 2020, 06:34 AM

Good evening,

I'm trying to create a report with .net in MVC but the data comes from a soap WSDL, so I pass the query result to an Object Data Source in the controller and assign it to the report Viewer in the view but not displays the report.

 

  <div class="container">

            // Creating a new report

            Telerik.Reporting.TypeReportSource reportsource = new Telerik.Reporting.TypeReportSource() { TypeName = "ReportLibrary.OdioEsteProyecto, ReportLibrary" }; //
            Telerik.Reporting.ObjectDataSource datasSource = Model.ods; //this ods is a  ObjectDataSource variable who came from the model 

            if (datasSource != null)
            {
                <telerik:ReportViewer ID="MyReportViewer"
                                      ReportSource=reportsource
                                      ObjectDataSource=datasSource
                                      runat="server"
                                      High ="100%"
                                      Width="100%"
                                      DocumentMapVisible="False"
                                      ParametersAreaVisible="False"
                                      ShowDocumentMapButton="False"
                                      ShowHistoryButtons="False"
                                      ShowNavigationGroup="True"
                                      ShowParametersButton="False"
                                      ShowPrintPreviewButton="False"
                                      ShowRefreshButton="False"
                                      Skin="WebBlue"
                                      Visible="True">

                </telerik:ReportViewer>
          }

    </div>

 

HELP

1 Answer, 1 is accepted

Sort by
0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 31 Mar 2020, 06:47 PM

Hi Rosbel,

Unfortunately, from the what I can see, this may require a Custom Report Resolver. Although, there isn't enough information provided to fully understand the scenario. However, there could be a couple of options to try. Let me review them below. 

Option 1. Use the ObjectDataSource within the Report Library to consume a WCF Service. This implementation is described in the Connecting Telerik Reporting to OData Feeds blog post.

- This option allows the report processor to do the necessary work and can be tested within the Report Designer. Note that this may require converting the WSDL file to a WCF Service. Attached is a sample that shows how to consume a WCF Service as an ObjectDataSource from within the report.

Option 2. If the ObjectDataSource does work with the Report. Implement a Custom Report Resolver with the Reporting REST Service.

- This option is a little more decoupled and more involved but would require creating the report like in option 1 to use the ObjectDataSource. Note that from the provided code, it appears the Report is being created within a Razor Page file which won't work due to the Report Lifecycle. Creating the Report and assigning the ObjectDataSource would need to be in the Custom Report Resolver of the ReportsController. Depending on the report, it may also require Programming Parts of the Report Definition.

In order to run the attached sample, ensure the Telerik NuGet Feed is Configured in Visual Studio.

Please let me know which of these options work for you. Thank you for using the Reporting forums.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Rosbel
Top achievements
Rank 1
Answers by
Eric R | Senior Technical Support Engineer
Telerik team
Share this question
or