Showing posts with label model. Show all posts
Showing posts with label model. Show all posts

Wednesday, March 28, 2012

How to save item description?

Those anybody know how to save description of any item (report, model or datasource) programmatically without saving directly to ReportServer DB in Catalog table? I'm working with RS Web Service but i can't find solution for saving only item description.

You can create a property with the name "Description" and include that in the set of optional properties when you publish the report using CreateReport():

ReportingService2005 rs2005 = new ReportingService2005();

rs2005.UseDefaultCredentials = true;

Property description = new Property();

description.Name = "Description";

description.Value = "This is a super cool report!";

byte[] reportDefinition = File.ReadAllBytes(@."e:\testreports\r1.rdl");

rs2005.CreateReport("r1", "/", true, reportDefinition, new Property[] { description });

Monday, March 26, 2012

How to save a Database project using DTE?

Hi All,

How can we save a Database project (not a SQL Server project) using Application Object Model? I was able to save a SQL Server project using the DTE like this:

Project project = null;
Solution solution = _applicationObject.Solution;
foreach (Project prj in solution.Projects)
{
if (prj.Name.Equals(projectName))
{
project = prj;
break;
}
}
if (project != null)
{
project.Save(project.FileName);
}

But for an Oracle Database project it gives an exception saying that Save() method is not implemented in DTE. A similar kind of problem occured for me when I tried to add an item to a Oracle Database project using DTE.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=495993&SiteID=1

Can anybody give me a hint to find a solution for this?

Best regards,
Imesh

Sorry, generic database projects don't implement DTE.

However, there is a workaround using the base ide. in your macro code, you need to make the solution explorer that active tool window, and then navigate down to the project node and select it. Then run

DTE.ExecuteCommand ("File.SaveSelectedItems")

That should do it.

|||Thanks Kenneth! I will try that out..!

Best regards,
Imesh