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

HTML5 Report Viewer - Textbox action (Navigate to Report (object instance)) does not work

6 Answers 169 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jayson
Top achievements
Rank 1
Jayson asked on 07 Jul 2015, 09:14 AM

Need help. Textbox action (Navigate to Report (object instance)) does not work. Textbox is not clickable on html5 report viewer. It is working on web form report viewer (Same logic on creating the report.).

I'm using a custom report resolver where datasource is from a dataset and the report is from a xml file. 

code snippet:

        private void AssignSubreportDatasource(global::Telerik.Reporting.Report parent, DataSet ds)
        {
            var items = parent.Items.Find("textBox14", true); // contains NavigateToReportAction
            if (items != null)
            {
                foreach (var item in items)
                {
                    var sub1 = (((item as global::Telerik.Reporting.TextBox).Action
                        as global::Telerik.Reporting.NavigateToReportAction).ReportSource
                        as global::Telerik.Reporting.InstanceReportSource).ReportDocument
                        as global::Telerik.Reporting.Report;

                    var objds = sub1.DataSource as global::Telerik.Reporting.ObjectDataSource;
                    objds.DataSource = ds.Tables[0];
                }
            }
        }
///////

        public global::Telerik.Reporting.ReportSource Resolve(string reportId)
        {
            global::Telerik.Reporting.InstanceReportSource reportSource = new global::Telerik.Reporting.InstanceReportSource();

            System.Data.DataSet ds = DeserializeDataset(datafile);
            var report = (global::Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
            AssignSubreportDatasource(report, ds); //assigns navigate to subreport datasource
            AssignDataSource(report, ds); //assigns inline subreport datasourcereport.DataSource = ds;
            report.DataSource = ds;

            reportSource.ReportDocument = report;

            foreach (var telerikParam in reportSource.ReportDocument.ReportParameters)
            {
                telerikParam.Value = "0";

            }

            return reportSource;
        }


   

6 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 07 Jul 2015, 12:04 PM
Hello Jayson,

The custom report resolver should be able to resolve the data coming from the action to a valid report source. A possible approach is to pass the report ID via the navigate to report action using an expression and then resolve the report by that ID inside the custom report resolver.

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
0
Jayson
Top achievements
Rank 1
answered on 07 Jul 2015, 12:50 PM

That doesn't help. data source and report  where acheive to files. The above logic works properly on webform report viewer. (deserializing both data source and report, assigning the correct datatable to every datasource on the report including (Navigate to Report (object instance) datasource then render)

but does not work on html5 viewer. I could send you a test project with both viewer, for better understanding of the logic.

 

0
Nasko
Telerik team
answered on 07 Jul 2015, 01:59 PM
Hello Jayson,

The HTML5 Report Viewer does not work with report object instances (InstanceReportSource) by design. This is the reason why the HTML5 Report Viewer will not display the report while the legacy WebForms viewer works correctly.
The solution in the described scenario is to add code to the custom report resolver which will create the report object instance inside the custom resolver based on a report ID and return a valid InstanceReportSource wrapping the report object. The report ID can be passed to the custom resolver as a string from the action expression.

If you need further help open a support ticket where you can attach a test project demonstrating the issue.

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
0
prakash
Top achievements
Rank 1
answered on 23 Aug 2017, 11:04 AM

NavigateToReportAction  is not working 

I am using CustomReportResolver  to create InstanceReportSource is working fine with main report but Drill down report is not working I have give TypeReportSource on the ActionLink and add parameters om main  but  report only bring assembly name not the parameters see below function

 public ReportSource Resolve(string report) // report only bring assembly name not the parameters 
 {

}

Please let me know how to pass parameters to NavigateToReportAction. Parameters values are the field values.

I also try  with a report(drill down) that does not have any parameters .But we receive below mention error  on Telerik Reporting viewer 

Unable to get report parameters.
An error has occurred.
Invalid report type

0
prakash
Top achievements
Rank 1
answered on 25 Aug 2017, 07:22 AM

Hi Nasko 

Can you please revert on below mention

NavigateToReportAction  is not working 
I am using CustomReportResolver  to create InstanceReportSource is working fine with main report but Drill down report is not working I have give TypeReportSource on the ActionLink and add parameters om main  but  report only bring assembly name not the parameters see below function
 public ReportSource Resolve(string report) // report only bring assembly name not the parameters 
 {
}
Please let me know how to pass parameters to NavigateToReportAction. Parameters values are the field values.
I also try  with a report(drill down) that does not have any parameters .But we receive below mention error  on Telerik Reporting viewer 
Unable to get report parameters.
An error has occurred.
Invalid report type

 

 

0
Nasko
Telerik team
answered on 25 Aug 2017, 03:44 PM
Hi Prakash,

Once you implement the custom report resolver which works with InstanceReportSource, it will no longer work with TypeReportSource or UriReportSource.
The solution is to implement the custom report resolver code in such manner, that it handles all types of report sources.
Another solution is to leave the built-in ReportTypeResolver as it is, and add a fallback custom report resolver using the AddFallbackResolver Method:
static ReportsController()
{
    var resolver = new ReportTypeResolver()
        .AddFallbackResolver(new MyCustomResolver());


Regards,
Nasko
Progress 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
Jayson
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jayson
Top achievements
Rank 1
prakash
Top achievements
Rank 1
Share this question
or