Sunday, March 11, 2012

Custom Property

Hi,
I am trying to set MS reports custom property from C#. I have tried code specified in the help i.e
Property[] props = new Property[1];
Property setProp = new Property();
setProp.Name = "Description";
setProp.Value = "Sales by quarter and product category.";
props[0] = setProp;
string itemPath = "/SampleReports/Company Sales";
rs.SetProperties(itemPath, props);
But this is working only for "Description" property which is report property. how can I add user defined custom proprty?
Thanks & regards
PrakashYou should be able to add a custom property using the exact same code. Just
change the Name to whatever you want the property to be called. How exactly
is it not working? Is there an error you are seeing returned?
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Prakash" <Prakash@.discussions.microsoft.com> wrote in message
news:0B18AE53-1C47-4EDB-998C-263F360909FE@.microsoft.com...
> Hi,
> I am trying to set MS reports custom property from C#. I have tried code
specified in the help i.e
> Property[] props = new Property[1];
> Property setProp = new Property();
> setProp.Name = "Description";
> setProp.Value = "Sales by quarter and product category.";
> props[0] = setProp;
> string itemPath = "/SampleReports/Company Sales";
> rs.SetProperties(itemPath, props);
> But this is working only for "Description" property which is report
property. how can I add user defined custom proprty?
>
> Thanks & regards
> Prakash
>

No comments:

Post a Comment