changing table to view...
Posted: Wed Aug 08, 2007 6:40 am
We design reports aginst sql tables. But when we render it programmatically we want to change all those reports to use Views. But it is not working, here is how my code looks like,
StiDataSourcesCollection collectionDS = stiReport1.Dictionary.DataSources;
foreach (StiDataSource ds in collectionDS) {
if (ds.Name.ToLower() == "asset") {
ds.Name = "v_Asset1998011";
}
if (ds.Name.ToLower() == "location") {
ds.Name = "v_Location1998001";
}
I get all kinds of error. Can someone help me how to do this.
Note: Table and View are having exact columns and everything..
Thanks
StiDataSourcesCollection collectionDS = stiReport1.Dictionary.DataSources;
foreach (StiDataSource ds in collectionDS) {
if (ds.Name.ToLower() == "asset") {
ds.Name = "v_Asset1998011";
}
if (ds.Name.ToLower() == "location") {
ds.Name = "v_Location1998001";
}
I get all kinds of error. Can someone help me how to do this.
Note: Table and View are having exact columns and everything..
Thanks