Page 1 of 2
					
				Rename DataSource Items
				Posted: Thu May 28, 2009 10:46 pm
				by saidin
				Hi
Suppose that we have some tables in database and one of them is Table1 and we want to send table1's data to Stimulsoft report
when I do that in dictionary segment I can see  DataSource >>Table1 and the columns of Table1(Col1,Col2) but I want to Rename The Table and column  Titles in dictionary segment for example instead of Table1  see CustomerTable and instead of Col1 see CustCol1
thanks:grinder: 
			 
			
					
				Rename DataSource Items
				Posted: Fri May 29, 2009 6:06 pm
				by Edward
				Hi,
There is an Alias property in the DataSource and Columns as well. Just click in the 'Use Aliases' check box in the Dictionary panel in the designer and you will see aliases instead of the real names.
Thank you.
			 
			
					
				Rename DataSource Items
				Posted: Tue Jun 02, 2009 8:44 am
				by saidin
				Hi Edward
No! No!:brick: 
I mean that programmer(by source code) change the main names for exp column1 to colName that when user opens a report designer see the colName instead of column1
thanks 
			 
			
					
				Rename DataSource Items
				Posted: Wed Jun 03, 2009 1:00 am
				by Jan
				Hello,
You can change Name property of datasource and datacolumn. For example:
NameInSource: Table1
Name: CustomerTable
Thank you.
			 
			
					
				Rename DataSource Items
				Posted: Thu Jun 04, 2009 2:20 am
				by saidin
				Hi  Jan
My question is how we can do that? but you said you can do
please say how rename items by code(help , code or sample)
thanks
			 
			
					
				Rename DataSource Items
				Posted: Thu Jun 04, 2009 7:21 pm
				by Edward
				Hi.
Here you are:
Code: Select all
report.Dictionary.DataSources["MyDataSourceName"].Alias = "NewAliasforDataSourceName";
report.Dictionary.DataSources["MyDataSourceName"].Columns["MyDataColumnName"].Alias = "MyNewAliasForColumn";
Thank you.
 
			 
			
					
				Rename DataSource Items
				Posted: Mon Jun 08, 2009 2:09 am
				by saidin
				Hi Edward
I cant use the code 
there is one DataSet:DsGlobal
there is one Table:table1
there is some columns of Table1
the following code has error:  Object reference not set to an instance of an object.
 Report.RegData(DsGlobal)
 Report.Dictionary.DataSources("DsGlobal").Alias = "aaa"  '<<Error Line
thank you
			 
			
					
				Rename DataSource Items
				Posted: Mon Jun 08, 2009 6:03 am
				by Edward
				Hi,
Please modify your code as follows:
Code: Select all
Report.RegData(DsGlobal)
Report.Dictionary.Synchronize()
Report.Dictionary.DataSources.Item("MyDataSourceName").Alias = "NewAliasforDataSourceName"
Report.Dictionary.DataSources.Item("MyDataSourceName").Columns.Item("MyDataColumnName").Alias = "MyNewAliasForColumn"
Thank you.
 
			 
			
					
				Rename DataSource Items
				Posted: Tue Jun 09, 2009 8:52 am
				by saidin
				Hi,
There is a problem.
1- when we use following code:
       Report.Dictionary.DataSources.Item("Personal").Alias = "NewPersonalName"
       Report.Dictionary.DataSources.Item("Personal").Columns.Item("Code").Alias = "NewPersonalCode"
In Report Design we have:
           Personal[NewPersonalName]
           Code[NewPersonalCode]
2- when we use following code:
       Report.Dictionary.DataSources.Item("Personal").Name = "NewPersonalName"
In Report Design we have:
           NewPersonalName[Personal]
but I want user see just :
          NewPersonalName
Thank you very much
			 
			
					
				Rename DataSource Items
				Posted: Tue Jun 09, 2009 9:12 am
				by Jan
				Hello,
Use following code:
Report.Dictionary.DataSources.Item("Personal").Name = "NewPersonalName"
Report.Dictionary.DataSources.Item("NewPersonalName").NameInSource = "Personal"
Thank you.