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

IReportResolver for subreports

1 Answer 166 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
Scott Waye asked on 09 Oct 2015, 05:37 PM

Hi,

 I use a custom IReportResolver in combination with the ReportConnectionStringManager and it works well.  However my next requirement is to support subreports where the ReportSource property is set to a parameter, e.g. = Parameters.invoiceReport.Value.   This is a problem when attempting to update the connection string on the subreport, the name is given as the expression, not the evaluation of the expression.  It seems that I can evaluate the expression myself with a bit of work and checking the Http context request referrerUrl property, but looks a bit fragile.

 

If you look at the code for ReportConnectionStringManager you can see that it assumes here:

using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))

that the Uri is already evaluated, but it's not, it is the string "= Parameters.invoiceReport.Value".   Do you have any suggestions other than evaluating the expression myself?

 

Thanks,

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 12 Oct 2015, 08:49 AM
Hi Scott,

Expressions can be evaluated only once the report processing is started.

My suggestion is to test settings the SubReport.ReportSource via binding and a custom function in which the sub report is obtained, modified and returned in an InstanceReportSource.


To design reports with user functions in the Standalone Report Designer tool, functions will have to be created in an external assembly extending the tool's configuration - Extending Report Designer (there are tutorials linked at the bottom).
On a side note, you can also use a custom data access layer in which you can specify the connection string in code. Then this data access layer can be used on designing and deploying reports.


I hope the provided information is helpful.

Regards,
Stef
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
Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Stef
Telerik team
Share this question
or