Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
To add a Completed page where users can view all completed reports. For scheduled or long-running reports, the navigation menu would link users straight to the latest completed report.
API Prerequisites
Before using the API, ensure the following:
Your account has the API role in WebReports.
A secure connection (Establish Connection & Store Cookie) is established.
Completed Reports Endpoint
| Endpoint URL |
|---|
| /extapi/APIWebReport/CompletedReports |
Structure
Public Class CompletedReports
Public Property UserName As String
End Class
Public Class ServiceCompleted
Public Property CreationDate As DateTime
Public Property Name As String
Public Property ID As String
Public Property ConnectionProfile As String
Public Property URL As String
Public Property Type As String
Public Property IsDownloadable As Boolean
Public Property File As Byte()
Public Property ExportType As String
End ClassExample: VB.NET Implementation
Private Sub BtnGetCompletedReports_Click(sender As Object, e As EventArgs) Handles BtnGetCompletedReports.Click
Dim CReports As New CompletedReports With {
.UserName = TxtUsernameReports.Text
}
Dim Params As StringContent =
New StringContent(
JsonConvert.SerializeObject(CReports, Formatting.Indented),
Encoding.UTF8,
"application/json"
)
TxtBodySentReports2.Text =
"RequestURL:" & server & route & "/" & controller & "/CompletedReports" &
vbCrLf & vbCrLf &
"Body Sent:" & vbCrLf &
Params.ReadAsStringAsync().GetAwaiter().GetResult()
Dim openResponse =
client.PostAsync(
server & route & "/" & controller & "/CompletedReports",
Params
).GetAwaiter().GetResult()
If openResponse.IsSuccessStatusCode Then
Dim result =
JsonConvert.DeserializeObject(Of List(Of ServiceCompleted))(
openResponse.Content.ReadAsStringAsync().GetAwaiter().GetResult()
)
TxtResultsReports2.Text =
openResponse.Content.ReadAsStringAsync().GetAwaiter().GetResult()
Else
' Handle error response here
End If
End Sub
Comments
0 comments
Please sign in to leave a comment.