Rename DataSource Items

Stimulsoft Reports.NET discussion
saidin
Posts: 8
Joined: Thu May 28, 2009 10:28 pm

Rename DataSource Items

Post by saidin »

Hello Jan,

There is not any property like NameInSource

Report.Dictionary.DataSources.Item("NewPersonalName").NameInSource = "Personal" >>Error For NameInSource

Thank you.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Rename DataSource Items

Post by Jan »

Hello,

Please convert data source to Stimulsoft.Report.Dictionary.StiDataStoreSource. Base type StiDataSource does not have NameInSource property.

Thank you.
saidin
Posts: 8
Joined: Thu May 28, 2009 10:28 pm

Rename DataSource Items

Post by saidin »

Hello,

There is not any property like StiDataStoreSource! :brick:

Thank you
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Rename DataSource Items

Post by Edward »

Hi

Please modify the code as follows:

Code: Select all

TryCast(report.Dictionary.DataSources.Item("NewPersonalName"),Stimulsoft.Report.Dictionary.StiDataStoreSource).NameInSource = "Personal"
Thank you.
saidin
Posts: 8
Joined: Thu May 28, 2009 10:28 pm

Rename DataSource Items

Post by saidin »

Hello,
Your code:

Report.Dictionary.DataSources.Item("Personal").Name="NewPersonalName"
TryCast(report.Dictionary.DataSources.Item("NewPersonalName"),Stimulsoft.Report.Dictionary.StiDataStoreSource).NameInSource = "Personal"

Result is :
NewPersonalName[Personal]
But I want:
NewPesonalName

Thank you
Arthur
Posts: 16
Joined: Tue Jun 02, 2009 11:53 am
Location: San Antonio, Tx

Rename DataSource Items

Post by Arthur »

If you have access to the dataset before you pass it to the dictionary you can name the dataset and table using the dataset properties

dataset.DataSetName = "NewDSName"
dataSet.Tables(0).TableName = "NewTableName"
dataSet.Tables(0).Columns(0).ColumnName = "NewColumnName"

Then when you pass the dataSet to the dictionary it has everything named already.

Hope this helps.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Rename DataSource Items

Post by Jan »

Hello,
saidin wrote:Hello,
Your code:

Report.Dictionary.DataSources.Item("Personal").Name="NewPersonalName"
TryCast(report.Dictionary.DataSources.Item("NewPersonalName"),Stimulsoft.Report.Dictionary.StiDataStoreSource).NameInSource = "Personal"

Result is :
NewPersonalName[Personal]
But I want:
NewPesonalName

Thank you
You need also change Alias to NewPersonalName.

Thank you.
miguel
Posts: 14
Joined: Tue Apr 21, 2009 10:32 am
Location: sinaloa

Rename DataSource Items

Post by miguel »

hello as would be this line in c #

TryCast(report.Dictionary.DataSources.Item("NewPersonalName"),Stimulsoft.Report.Dictionary.StiDataStoreSource).NameInSource = "Personal"
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Rename DataSource Items

Post by Edward »

Hi

Here you are:

(report.Dictionary.DataSources.Item("NewPersonalName") as Stimulsoft.Report.Dictionary.StiDataStoreSource).NameInSource = "Personal"

Thank you.
Post Reply