wich create a RtTrend dynamically
I'm having trouble trying to understand what you mean by that, do you mean that the RtTrend does not exist on the WebPart Page until you click on something in your custon webpart?
There is not a property in Rttrend that defines a tag list or a single tag.
To pass the RtTrend a list of tags your custom webpart needs to implement the "IParametersOutProvider" but, instead of sending just one tag, send out a list of tags separated by ';' and the trend will be able to see them as different tags.
Connect your webpart as a parameter provider to the RtTrend. Then go to the RtTrend and click on the lighting bolt and add the value that has all the tags listed and you should be good to go.
You can see how to implement IParametersOutProvider in a custom web part in this tutorial.
Thank you for you reply.
I already did a custom webpart that implements the "IParametersOutProvider" and it works very well with a RtTrend. it also send a list of tags seperated by ";". it works exactly sama as you have exaplained.
In fact, what i am doing is :
i have a custom webpart that contain a Button (for example). When i click the button it will add dinamically a RtTrend and will display on the RtTrend a list of tags. i am using reflection to do that.
I can add the RtTrend dynamically but i am not able to assign the list of tags to it because I thought that there is a property in the RtTrend that take a list of tags. (There is not a property in Rttrend that defines a tag list or a single tag.)
do you think that i can assign a list of tags dynamically to RtTrend?
I have not tried this, but lemme do a little research on the topic.
I have tried to assign dynamically the appropriate values to those properties (by using reflection) :
OSIsoft.RtWebParts.Common.RtWPDataQuery rtwebpartDataquerylist = new OSIsoft.RtWebParts.Common.RtWPDataQuery;
OSIsoft.RtWebParts.Common.RtWPDataQuery rtwebpartDataquery = new OSIsoft.RtWebParts.Common.RtWPDataQuery();
rtwebpartDataquery.ColumnNames = new string;
rtwebpartDataquery.dataQueryType = OSIsoft.RtWebParts.Common.RtWPDataQuery.DataQueryType.PI;
rtwebpartDataquery.ClientDataResultKey = "PI Tags";
rtwebpartDataquery.dataQueryState = OSIsoft.RtWebParts.Common.RtWPDataQuery.DataQueryState.Configured;
rtwebpartDataquery.ViewName = "PI Tags";
OSIsoft.RtWebParts.Common.RtWPDataQueryParameter rtwpdataqueryparameter2 = new OSIsoft.RtWebParts.Common.RtWPDataQueryParameter();
rtwpdataqueryparameter2.CurrentValue = taglist;
rtwpdataqueryparameter2.DefaultValue = taglist;
rtwpdataqueryparameter2.ParameterType = OSIsoft.RtBaseline.Services.Common.DataViewParameterType.PITag;
rtwebpartDataquery.ICEParameters = new OSIsoft.RtWebParts.Common.RtWPDataQueryParameter;
rtwebpartDataquery.ICEParameters = rtwpdataqueryparameter2;
But with no success. I think i have to assign values to other properties in the RtTrend!!
Do you have any suggession?
If you can provide me only the list of properties (in the RtTrend) that i have to assign values, it will help me to resolve my issue.
Hi Hassan, I have asked Paul Kaiser to provide some insight on the topic. :)
We only have three supported ways to determine what traces appear in a trend. The first is to add them to the Selected Data toolpart in the trend tool pane. The second is to pass them in via a web part connection. The third (coming in PI WebParts 3.0) is to pass them in through a querystring parameter in the URL. We don't document a programmatic interface, so I can't guarantee that anything you might get to work will continue to do so in a future release.
I think that there is a mean to assign value to a property in RtTrend dynamically by using reflection.
I managed to assign values to two properties in the RtTrend :
1- ColumnNames = tags;
But The RtTrend do not display the graphe!!
I did some verifcations on the RtTrend: I edited the RtTrend property and i am able to see the values of the tags that i have assigned dynamically.
See the photo below:
This might be a little off-topic already, but wouldn't it be an option for you to use the Ad-Hoc trend instead? It would show the trend in an additional window but might be sufficient for your requirements.