<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: api getreport - sort list in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366781#M10921</link>
    <description>&lt;P&gt;THANKS!!!!!!&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 07:12:44 GMT</pubDate>
    <dc:creator>lenny76</dc:creator>
    <dc:date>2018-02-28T07:12:44Z</dc:date>
    <item>
      <title>api getreport - sort list</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366333#M10907</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've this function to get the list of report with API&lt;/P&gt;&lt;P&gt;and I put the list in a asp:dropdownlist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you help me to sort them alfabetically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Protected Sub GetReport(ByVal index As Integer)
        Dim request As System.Net.WebRequest = TryCast(System.Net.WebRequest.Create(String.Format("{0}/Reports", baseUri)), System.Net.HttpWebRequest)
        request.Method = "GET"
        request.ContentLength = 0
        request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken.Value))
        Using response = TryCast(request.GetResponse(), System.Net.HttpWebResponse)
            Using reader = New System.IO.StreamReader(response.GetResponseStream())
                Dim Reports As PBIReports = JsonConvert.DeserializeObject(Of PBIReports)(reader.ReadToEnd())
&lt;BR /&gt;                For Each r In Reports.value
                    elencoreport.Items.Add(New ListItem(r.name, r.id))
                Next

            End Using
        End Using
    End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Lenny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 16:37:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366333#M10907</guid>
      <dc:creator>lenny76</dc:creator>
      <dc:date>2018-02-27T16:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: api getreport - sort list</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366702#M10918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/56376"&gt;@lenny76&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.asp.net/t/1572309.aspx?Drop+Down+List+Item+Sorting" target="_self"&gt;Here&lt;/A&gt; is a similar thread in which some workarounds are mentioned. Could you go to check if it helps in your scenario?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, the code below is for your reference. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Protected Sub GetReport(ByVal index As Integer)
        Dim request As System.Net.WebRequest = TryCast(System.Net.WebRequest.Create(String.Format("{0}/Reports", baseUri)), System.Net.HttpWebRequest)
        request.Method = "GET"
        request.ContentLength = 0
        request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken.Value))
        Using response = TryCast(request.GetResponse(), System.Net.HttpWebResponse)
            Using reader = New System.IO.StreamReader(response.GetResponseStream())
                Dim Reports As PBIReports = JsonConvert.DeserializeObject(Of PBIReports)(reader.ReadToEnd())

                For Each r In Reports.value
                    elencoreport.Items.Add(New ListItem(r.name, r.id))
                Next
                &lt;STRONG&gt;List&amp;lt;ListItem&amp;gt; items = (from item in elencoreport.Items.Cast&amp;lt;ListItem&amp;gt;()
                                    orderby item.Text
                                    select item).ToList&amp;lt;ListItem&amp;gt;();
                elencoreport.Items.Clear();
                elencoreport.Items.AddRange(items.ToArray());&lt;/STRONG&gt;
            End Using
        End Using
    End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 06:08:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366702#M10918</guid>
      <dc:creator>v-ljerr-msft</dc:creator>
      <dc:date>2018-02-28T06:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: api getreport - sort list</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366781#M10921</link>
      <description>&lt;P&gt;THANKS!!!!!!&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 07:12:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/api-getreport-sort-list/m-p/366781#M10921</guid>
      <dc:creator>lenny76</dc:creator>
      <dc:date>2018-02-28T07:12:44Z</dc:date>
    </item>
  </channel>
</rss>

