Page 1 of 1

Insert alias in Datasource

Posted: Mon Oct 15, 2018 1:59 pm
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?

Re: Insert alias in Datasource

Posted: Sat Oct 20, 2018 9:44 am
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.

Re: Insert alias in Datasource

Posted: Tue Oct 23, 2018 8:53 am
by jserret
Hi,

thanks, but not exist any other opcion por insert alias with DataTable similar to Caption?

Re: Insert alias in Datasource

Posted: Wed Oct 24, 2018 12:41 am
by Ivan
Hello,

Please try to use the DisplayExpression property of the DataTable.

Thank you.

Re: Insert alias in Datasource

Posted: Thu Oct 25, 2018 7:44 am
by jserret
Thanks has worked

Re: Insert alias in Datasource

Posted: Fri Oct 26, 2018 4:22 am
by Andrew
Hello,

Thank you for letting us know about this.

Have a nice day!

Re: Insert alias in Datasource

Posted: Tue Dec 11, 2018 9:14 am
by jserret
Hello!

Another question, is it possible through .NET code to make only the alias visible?

Re: Insert alias in Datasource

Posted: Tue Dec 11, 2018 8:15 pm
by Lech Kulikowski
Hello,

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

Thank you.