Click here to Skip to main content
15,996,429 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When create model from data source if that data source on root folder on server then model successfully created but if data source located in sub folder then it will give me below error.

The item '/NewDTrends' cannot be found. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemNotFoundException: The item '/NewDTrends' cannot be found.


here NewDTrends is data source:


below code i have use:
C#
<pre>protected void btnOk_Click(object sender, EventArgs e)
       {
           string dataSourceName = Request.QueryString["ItemPath"];
           string parent = "/";
           ReportService.DataSourceDefinition dsd = new RxBILegal.ReportService.DataSourceDefinition();
           ReportService.ReportingService2005 rs = new RxBILegal.ReportService.ReportingService2005();
           RxBILegal.ReportService.Property[] properties = null;

           rs.Credentials = new System.Net.NetworkCredential(TrippleDES.Decrypt(ConfigurationManager.AppSettings["crisscross.FixedSsrsUsername"]), TrippleDES.Decrypt(ConfigurationManager.AppSettings["crisscross.FixedSsrsPassword"]), TrippleDES.Decrypt(ConfigurationManager.AppSettings["crisscross.FixedSsrsDomain"]));
           dsd.Enabled = true;
           dsd.EnabledSpecified = true;
           dsd.Extension = "SQL";
           dsd.ImpersonateUserSpecified = false;
           dsd.Prompt = null;
           dsd.WindowsCredentials = false;
           //rs.GenerateModel('/'+dataSourceName, txtName.Text.Trim(), parent, properties,out error);
           //rs.GenerateModel('/' + dataSourceName, txtName.Text.Trim(), parent, properties);



           rs.GenerateModel("/"+dataSourceName, txtName.Text.Trim(), parent, properties);

       }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900