问题
i need to localize a Reporting Services-report (.rdlc) and i would like to do it using a ressource-file (.resx).
I found pages like this and that and they use custom code to achieve their target.
But pages like Setting the Report Language Parameter in a URL give me the impression that localization in reports is possible without custom code.
So, it is possible to localize a Reporting Services-report without custom code ?
If so, is there a tutorial that explains how it's done?
回答1:
What in the report do you want to localize?
values from the database? Those should be retrieved from the database in the appropriate language already
fixed labels and textboxes on the report? I have not yet seen any compelling way to doing this - you can either have
- one report "skeleton" / template per language (and pick the one you need)
- if the number of elements is manageable, define report parameters which you can set from the calling code, to set the labels and texts
- use some custom .NET extension for handling localization
It's not really an awfully pretty picture, indeed - I'd be most interested in better solutions myself! (I typically need to support 3-4 languages for any report - and I'm using only server-based .RDL files, no .RDLC, so any localization that depends on client-side resource files is not usable in my case)
回答2:
I would add one method when it comes to labels and textboxes:
- Create a placeholder element within the textbox and use Expression field to use a Switch clause , switching on the Language parameter.
It's not superpretty, but also works pretty well for 3-4 languages
回答3:
I am passing parameters to the report for labels etc, and after adding the parameters to the report (using the menu option Report -> Parameters in VS2008) you can then use the values of these parameters to localise the labels. This is workiiing well enough, although it would be nicer to be abkle to refer to resource keys immediately from your form labels etc.
来源:https://stackoverflow.com/questions/1709082/localization-of-reporting-services-reports-rdl-rdlc-files