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

Pass Culture to report by a parameter

1 Answer 128 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Nuno asked on 02 Aug 2017, 04:05 PM

I need to pass the culture by parameter to a report (TypeReportSource), in the code behind (server side).
From the report side (server side) I need to get the culture passed by report parameter to the report itself.

I tried to to do this with the following code:
Dim cultureInfo As Globalization.CultureInfo = New Globalization.CultureInfo("pt-PT")
Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo Threading.Thread.CurrentThread.CurrentCulture = cultureInfo
 This works before the 'InitializeComponent()' function as expected, but I have no way of retrieving the report parameters at this stage because they weren't initialized yet.

The main idea is to replace "pt-PT" with the report parameter sent when the report was invoked.

The following code shows how I invoke the report and pass it the required parameters:
Dim clientReportSource As New Telerik.ReportViewer.Html5.WebForms.ReportSource clientReportSource.IdentifierType = Telerik.ReportViewer.Html5.WebForms.IdentifierType.TypeReportSource clientReportSource.Identifier = "SIC.UI." & report & ", SIC.UI, Version=, Culture=neutral, PublicKeyToken=null" clientReportSource.Parameters.Add("P1", p1) clientReportSource.Parameters.Add("P2", "pt-PT") reportViewer1.ReportSource = clientReportSource reportViewer1.Page.Title = report

I'm trying to do exactly what you guys have in this demo, but so far unsuccessfully.
I've been digging through the forums and documentation for a few days now and i just can't get this to work.

Any help would be greatly appreciated.

Thanks in advance,

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 03 Aug 2017, 09:35 AM
Hello Nuno,

are mapped by key to report parameters. You need to make sure that the name of the parameter matches the name of the corresponding Report Parameter.

The settings of the ProductCatalog report can be reviewed locally, this report is copied in Telerik Reporting installation folder: [installation folder]\Telerik\Reporting [version]\Examples\VB\ReportLibrary\ProductCatalog.
In this report you can see how the report's Culture property is bound to the value of report parameter (report's Bindings collection).
For more details check Bindings help article.

In case the issue persists send us the report in a support ticket so we can review its settings and provide you further suggestions.

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
General Discussions
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question