Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
HI
I've this function to get the list of report with API
and I put the list in a asp:dropdownlist
can you help me to sort them alfabetically?
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
End Using
End Using
End Sub
thanks
Lenny
Solved! Go to Solution.
Hi @lenny76,
Here is a similar thread in which some workarounds are mentioned. Could you go to check if it helps in your scenario?
In addition, the code below is for your reference. ![]()
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
List<ListItem> items = (from item in elencoreport.Items.Cast<ListItem>()
orderby item.Text
select item).ToList<ListItem>();
elencoreport.Items.Clear();
elencoreport.Items.AddRange(items.ToArray());
End Using
End Using
End Sub
Regards
Hi @lenny76,
Here is a similar thread in which some workarounds are mentioned. Could you go to check if it helps in your scenario?
In addition, the code below is for your reference. ![]()
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
List<ListItem> items = (from item in elencoreport.Items.Cast<ListItem>()
orderby item.Text
select item).ToList<ListItem>();
elencoreport.Items.Clear();
elencoreport.Items.AddRange(items.ToArray());
End Using
End Using
End Sub
Regards
THANKS!!!!!!![]()
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |