Localization of Reporting Services-Reports (.rdl / .rdlc-Files)

怎甘沉沦 提交于 2019-12-06 01:07:49

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)

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!