Insert alias in Datasource

Stimulsoft Reports.WEB discussion
Post Reply
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Insert alias in Datasource

Post by jserret »

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?
Attachments
3.png
3.png (33.1 KiB) Viewed 3010 times
2.png
2.png (7.01 KiB) Viewed 3010 times
1.png
1.png (6.94 KiB) Viewed 3010 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Insert alias in Datasource

Post by Lech Kulikowski »

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.
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Re: Insert alias in Datasource

Post by jserret »

Hi,

thanks, but not exist any other opcion por insert alias with DataTable similar to Caption?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: Insert alias in Datasource

Post by Ivan »

Hello,

Please try to use the DisplayExpression property of the DataTable.

Thank you.
Attachments
DisplayName.PNG
DisplayName.PNG (31.58 KiB) Viewed 2958 times
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Re: Insert alias in Datasource

Post by jserret »

Thanks has worked
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Insert alias in Datasource

Post by Andrew »

Hello,

Thank you for letting us know about this.

Have a nice day!
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Re: Insert alias in Datasource

Post by jserret »

Hello!

Another question, is it possible through .NET code to make only the alias visible?
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Insert alias in Datasource

Post by Lech Kulikowski »

Hello,

You can use the following options:
StiOptions.Dictionary.ShowOnlyAliasFor...

Thank you.
Post Reply