8 Replies Latest reply on Dec 21, 2009 9:28 AM by andreas

    Set tags list to a RtTrend dynamically

    ztelo

      Hi,

       

      I have a custom web part wich create a RtTrend dynamically.

       

      I also want to send to the RtTrend a list of tags dinamically.

       

      What is the name of the property in RtTrend that is responsible for setting a tags list.

       

       

       

      thank you in advance.

        • Re: Set tags list to a RtTrend dynamically
          cescamilla

          Hassan Salman

          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.

            • Re: Set tags list to a RtTrend dynamically
              ztelo

              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?

               

              Thank you.

                • Re: Set tags list to a RtTrend dynamically
                  cescamilla

                  I have not tried this, but lemme do a little research on the topic.

                    • Re: Set tags list to a RtTrend dynamically
                      ztelo

                      I have tried to assign dynamically the appropriate values to those properties (by using reflection) :

                       

                      string 
                      taglist =\\\\serverName\\pv124;\\\\serverName\\pv125;\\\\serverName\\pv126;
                      OSIsoft.RtWebParts.Common.RtWPDataQuery[] rtwebpartDataquerylist = new OSIsoft.RtWebParts.Common.RtWPDataQuery[1];
                      OSIsoft.RtWebParts.Common.RtWPDataQuery rtwebpartDataquery = new OSIsoft.RtWebParts.Common.RtWPDataQuery();
                      rtwebpartDataquery.ColumnNames = new string[3];
                      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.ParameterName= "TagNamesX";
                      rtwpdataqueryparameter2.ParameterType = OSIsoft.RtBaseline.Services.Common.DataViewParameterType.PITag;
                      rtwebpartDataquery.ICEParameters = new OSIsoft.RtWebParts.Common.RtWPDataQueryParameter[3];
                      rtwebpartDataquery.ICEParameters[2] = 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.

                       

                      Thank you.