Insert alias in Datasource
Insert alias in Datasource
Hello.
We are trying to localize the report datasource during the creation and edition of a report. We are providing to the report, programmatically using the MVC components, Datasets as a source of data.
Depending of the user language we want to translate the names of tables and fields using alias but keeping the same internal names in order to reuse the reports(Attached 1 and 2).
We have seen that we can use the properties “name” and “caption” for fields but we can’t find how to do the same for the tables (“Datos Personales” & “Personal Data” in the attached screen-caps).
Please, can you give as an example of how we can obtain this functionality using code?
We are trying to localize the report datasource during the creation and edition of a report. We are providing to the report, programmatically using the MVC components, Datasets as a source of data.
Depending of the user language we want to translate the names of tables and fields using alias but keeping the same internal names in order to reuse the reports(Attached 1 and 2).
We have seen that we can use the properties “name” and “caption” for fields but we can’t find how to do the same for the tables (“Datos Personales” & “Personal Data” in the attached screen-caps).
Please, can you give as an example of how we can obtain this functionality using code?
- Attachments
-
- 3.png (33.1 KiB) Viewed 3033 times
-
- 2.png (7.01 KiB) Viewed 3033 times
-
- 1.png (6.94 KiB) Viewed 3033 times
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Insert alias in Datasource
Hello,
Unfortunately, there is no option Caption for DataTable.
As a way, you can set Alias property for StiDataSource
report.Dictionary.DataSources["xxxxxx"].Alias = "Alias";
Thank you.
Unfortunately, there is no option Caption for DataTable.
As a way, you can set Alias property for StiDataSource
report.Dictionary.DataSources["xxxxxx"].Alias = "Alias";
Thank you.
Re: Insert alias in Datasource
Hi,
thanks, but not exist any other opcion por insert alias with DataTable similar to Caption?
thanks, but not exist any other opcion por insert alias with DataTable similar to Caption?
Re: Insert alias in Datasource
Hello,
Please try to use the DisplayExpression property of the DataTable.
Thank you.
Please try to use the DisplayExpression property of the DataTable.
Thank you.
- Attachments
-
- DisplayName.PNG (31.58 KiB) Viewed 2981 times
Re: Insert alias in Datasource
Thanks has worked
Re: Insert alias in Datasource
Hello,
Thank you for letting us know about this.
Have a nice day!
Thank you for letting us know about this.
Have a nice day!
Re: Insert alias in Datasource
Hello!
Another question, is it possible through .NET code to make only the alias visible?
Another question, is it possible through .NET code to make only the alias visible?
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Insert alias in Datasource
Hello,
You can use the following options:
StiOptions.Dictionary.ShowOnlyAliasFor...
Thank you.
You can use the following options:
StiOptions.Dictionary.ShowOnlyAliasFor...
Thank you.