Page 1 of 2
How to localize property-name?
Posted: Thu Apr 22, 2010 8:16 am
by stehwn
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
How to localize property-name?
Posted: Fri Apr 23, 2010 1:07 am
by Jan
Hello,
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?
At this moment you can use custom attribute
Stimulsoft.Report.Dictionary.StiAlias. Also next prerelease build (26 April) will support
DisplayName attribute.
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?
You can use two attributes to hide properties:
Code: Select all
[Browsable(false)]
[Stimulsoft.Base.Design.StiBrowsable(false)]
Thank you.
How to localize property-name?
Posted: Fri Apr 23, 2010 4:22 am
by stehwn
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???
How to localize property-name?
Posted: Mon Apr 26, 2010 12:08 pm
by Jan
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.
How to localize property-name?
Posted: Tue Apr 27, 2010 2:36 am
by stehwn
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
How to localize property-name?
Posted: Tue Apr 27, 2010 3:05 am
by Andrew
Ok!
Thank you.
How to localize property-name?
Posted: Thu Apr 29, 2010 9:35 am
by stehwn
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
How to localize property-name?
Posted: Fri Apr 30, 2010 12:55 am
by Jan
Hello,
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;
Thank you.
How to localize property-name?
Posted: Fri Apr 30, 2010 2:32 am
by stehwn
Perfect!
How to localize property-name?
Posted: Fri Apr 30, 2010 4:53 am
by Andrew
Please let us know if we may be of any further assistance.
Thank you.