Custom names in the dictionary
Custom names in the dictionary
Hi
I use a List as data source to teh report. The directory's visible datasource is a view of the properties of the objects in the list. I would like to be able to rename the visible names for the user.
Does anyone know how to do this?
Thank you.
I use a List as data source to teh report. The directory's visible datasource is a view of the properties of the objects in the list. I would like to be able to rename the visible names for the user.
Does anyone know how to do this?
Thank you.
Custom names in the dictionary
You can use the Alias property for the columns in the Datasource.
Custom names in the dictionary
i do the following but nothing changes.
Do I need to refresh the data or somthing?
public string FixAlias()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < Dictionary.DataSources.Count; i++)
{
for (int j = 0; j < Dictionary.DataSources.Columns.Count; j++)
{
Dictionary.DataSources.Columns[j].Alias = "hurra";
sb.AppendLine(Dictionary.DataSources.Columns[j].Alias);
}
}
return sb.ToString();
}
Do I need to refresh the data or somthing?
public string FixAlias()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < Dictionary.DataSources.Count; i++)
{
for (int j = 0; j < Dictionary.DataSources.Columns.Count; j++)
{
Dictionary.DataSources.Columns[j].Alias = "hurra";
sb.AppendLine(Dictionary.DataSources.Columns[j].Alias);
}
}
return sb.ToString();
}
Custom names in the dictionary
After you register your Datasource, try calling Synchronize on the Dictionary of the report:
You can also Set Aliases through the Report Designer by Right clicking the Column in the Datasource tree and choosing Properies.
The Alias names will be saved with your report.
Code: Select all
StiReport report = new StiReport();
report.RegData(myTableData);
report.Dictionary.Synchronize();
foreach(Stimulsoft.Report.Dictionary.StiDataSource dSource in report.DataSources)
{
foreach(Stimulsoft.Report.Dictionary.StiDataColumn col in dSource.Columns)
{
col.Alias = "My Custom Alias";
}
}
report.Design();
You can also Set Aliases through the Report Designer by Right clicking the Column in the Datasource tree and choosing Properies.
The Alias names will be saved with your report.
Custom names in the dictionary
Thank you for the help now I get a complete list of "My Custom alias"
Custom names in the dictionary
I found that myself:
Thank you for the help.
Code: Select all
StiOptions.Dictionary.ShowOnlyAliasForData = true;
StiOptions.Dictionary.ShowOnlyAliasForDatabase= true;
StiOptions.Dictionary.ShowOnlyAliasForDataColumn= true;
StiOptions.Dictionary.ShowOnlyAliasForDataRelation= true;
StiOptions.Dictionary.ShowOnlyAliasForDataSource = true;
StiOptions.Dictionary.ShowOnlyAliasForVariable= true;
Thank you for the help.