some suggestion about column caption

Stimulsoft Reports.NET discussion
Post Reply
progame
Posts: 46
Joined: Sat Nov 25, 2006 9:12 am
Location: china

some suggestion about column caption

Post by progame »

I use regdata to pass a dataset for report, and i have localized datacolumn caption for those tables, but in designer, still show column name. it's not friendly for end-user.

progame
Posts: 46
Joined: Sat Nov 25, 2006 9:12 am
Location: china

some suggestion about column caption

Post by progame »

oh, it's my fault, stireport can show column caption, but why not show relation name in dictionary?

now my table named A has serveral self relation, in dictionary it shows:
A
A
A1
A2
Field1
Field2
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

some suggestion about column caption

Post by Edward »

Now the Relation has three different names:

NameInSource - this is the 'real' name of the Relation in the DataSet.
Name - it is the Name of the Relation itself as a Dictionary's component.
Alias - this property is shown in the Dictionary and as name of the Relation for connecting Parent and Child DataSources in the name of the filed, e.g.:

{ChildSource.AliasOfTheRelation.ParentSource}

This option can be activated/deactivated with "Use Aliases" checkbox in the Dictionary.

Thank you.
progame
Posts: 46
Joined: Sat Nov 25, 2006 9:12 am
Location: china

some suggestion about column caption

Post by progame »

m_StiReport.RegData(m_Data);

// change relation name
foreach (StiDataRelation r in m_StiReport.Dictionary.Relations)
{
var name = r.NameInSource.ToLower();
name = name.Replace(r.ParentSource.Name.ToLower(),string.Empty).Replace(r.ChildSource.Name.ToLower(),string.Empty);
r.Name = name;
r.Alias = name;
}

i need to change relation name by code, but after regdata, not any relation is dictionary, why?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

some suggestion about column caption

Post by Edward »

RegData method doesn't adds new DataSources to the Dictionary. It only registered them in DataStore of the report.

Please add the following method call after RegData:

Code: Select all

m_StiReport.Dictionary.Synchronize();
Also all relations must have unique name in the Dictionary.

Thank you.
progame
Posts: 46
Joined: Sat Nov 25, 2006 9:12 am
Location: china

some suggestion about column caption

Post by progame »

thanks.

it seems nameindatasource must be unique in whole diction, name and alias just be unique in current datasource?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

some suggestion about column caption

Post by Edward »

The limitation is for Name property only. It must be unique for the whole Dictionary.

Thank you.
Post Reply