How to localize property-name?
How to localize property-name?
Hi,
I'm using report.RegBusinessObject(...) to localize the names of my businessobjects.
But how can I localize the names of their properties?
I have a custom attribute derived from DisplayNameAttribute to localize my properties but it seems to be ignored.
Any ideas?
And is it possible to hide properties (some are unwanted at all and some do not always exist (==null) )?
Maybe also with a custom attribute?
Best Regards
I'm using report.RegBusinessObject(...) to localize the names of my businessobjects.
But how can I localize the names of their properties?
I have a custom attribute derived from DisplayNameAttribute to localize my properties but it seems to be ignored.
Any ideas?
And is it possible to hide properties (some are unwanted at all and some do not always exist (==null) )?
Maybe also with a custom attribute?
Best Regards
How to localize property-name?
Hello,
Thank you.
At this moment you can use custom attribute Stimulsoft.Report.Dictionary.StiAlias. Also next prerelease build (26 April) will support DisplayName attribute.I'm using report.RegBusinessObject(...) to localize the names of my businessobjects.
But how can I localize the names of their properties?
I have a custom attribute derived from DisplayNameAttribute to localize my properties but it seems to be ignored.
Any ideas?
You can use two attributes to hide properties:And is it possible to hide properties (some are unwanted at all and some do not always exist (==null) )?
Maybe also with a custom attribute?
Code: Select all
[Browsable(false)]
[Stimulsoft.Base.Design.StiBrowsable(false)]
How to localize property-name?
Thanks a lot!
I'm looking forward to use my localized DisplayAttribute to change the property-name instead of showing an additional alias.
One thing:
If I create BO-hierachy like this:
//company
MoviNeo.MainModule.PrintingObjects.CompanyPrint printMe = new MoviNeo.MainModule.PrintingObjects.CompanyPrint(companyId);
report.RegBusinessObject(Properties.Resources.Firma, printMe);
//company-address
report.Dictionary.Synchronize();//hierachical
StiBusinessObject businessObject = report.Dictionary.BusinessObjects[Properties.Resources.Firma];
StiBusinessObject child = new StiBusinessObject();
child.Name = "Address";
child.Alias = Properties.Resources.Anschrift; //setting by attribute doesn't seem to work for objects
businessObject.BusinessObjects.Add(child);
report.Dictionary.Synchronize();
The sti-alias-attribute on Company.Address seems to be ignored. This is no problem because the alias can be set in code.
But when DisplayAttribute will get also ignored on objects how could I rename it (not alias)?
If Display-Attribute on objects would work, would this also mean that referencing the child.Name would also be by DisplayName?
Best Regards
UPDATE:
Renaming of child-names: After building the hierachy I just change the names and sync again. But all of the localized child-objects are showing empty alias-brackets and runtime failes because its searching for the wrong name.
But maybe there's a better way to do it.
UPDATE 2:
It seems that report-runtime-creation always fails when declaring child-BOs in code???
I'm looking forward to use my localized DisplayAttribute to change the property-name instead of showing an additional alias.
One thing:
If I create BO-hierachy like this:
//company
MoviNeo.MainModule.PrintingObjects.CompanyPrint printMe = new MoviNeo.MainModule.PrintingObjects.CompanyPrint(companyId);
report.RegBusinessObject(Properties.Resources.Firma, printMe);
//company-address
report.Dictionary.Synchronize();//hierachical
StiBusinessObject businessObject = report.Dictionary.BusinessObjects[Properties.Resources.Firma];
StiBusinessObject child = new StiBusinessObject();
child.Name = "Address";
child.Alias = Properties.Resources.Anschrift; //setting by attribute doesn't seem to work for objects
businessObject.BusinessObjects.Add(child);
report.Dictionary.Synchronize();
The sti-alias-attribute on Company.Address seems to be ignored. This is no problem because the alias can be set in code.
But when DisplayAttribute will get also ignored on objects how could I rename it (not alias)?
If Display-Attribute on objects would work, would this also mean that referencing the child.Name would also be by DisplayName?
Best Regards
UPDATE:
Renaming of child-names: After building the hierachy I just change the names and sync again. But all of the localized child-objects are showing empty alias-brackets and runtime failes because its searching for the wrong name.
But maybe there's a better way to do it.
UPDATE 2:
It seems that report-runtime-creation always fails when declaring child-BOs in code???
How to localize property-name?
Hello,
It is better to get sample project for your request. Is it possible? Sample project will help us solve this problems more quickly.
Thank you.
It is better to get sample project for your request. Is it possible? Sample project will help us solve this problems more quickly.
Thank you.
How to localize property-name?
Hi,
I'll try to create a repro-project(can't send the real one) in the next days using the new pre-release-version.
Best Regards
Steffen
I'll try to create a repro-project(can't send the real one) in the next days using the new pre-release-version.
Best Regards
Steffen
How to localize property-name?
Ok!
Thank you.
Thank you.
How to localize property-name?
Hi,
it seems that DisplyAttribute doesnt change the property's displayname but adds an alias(like the Sti-Attribute) in the designer.
Is this intendet? If it is - is it possible to let the designer just show the alias (maybe without the braces) - or maybe change the order so that alias is before the property-name.
90% of my future end-users will not understand english and might get confused by my property-names.
Best Regards
it seems that DisplyAttribute doesnt change the property's displayname but adds an alias(like the Sti-Attribute) in the designer.
Is this intendet? If it is - is it possible to let the designer just show the alias (maybe without the braces) - or maybe change the order so that alias is before the property-name.
90% of my future end-users will not understand english and might get confused by my property-names.
Best Regards
How to localize property-name?
Hello,
Yes that correct behavior. You can hide Names with help of following static options:
Thank you.
Yes that correct behavior. You can hide Names with help of following static options:
Code: Select all
StiOptions.Dictionary.ShowOnlyAliasForBusinessObject = false;
StiOptions.Dictionary.ShowOnlyAliasForComponents = false;
StiOptions.Dictionary.ShowOnlyAliasForData = false;
StiOptions.Dictionary.ShowOnlyAliasForDatabase = false;
StiOptions.Dictionary.ShowOnlyAliasForDataColumn = false;
StiOptions.Dictionary.ShowOnlyAliasForDataRelation = false;
StiOptions.Dictionary.ShowOnlyAliasForDataSource = false;
StiOptions.Dictionary.ShowOnlyAliasForPages = false;
StiOptions.Dictionary.ShowOnlyAliasForVariable = false;
How to localize property-name?
Perfect!
How to localize property-name?
Please let us know if we may be of any further assistance.
Thank you.
Thank you.