Private Sub Page_Loaded(sender As Object, e As RoutedEventArgs)
' Copy the SQLite database file from app's Assets to LocalFolder - in a .FLXR report def,
' it can be referenced as ?(SpecialFolder.SystemDefault):
' Data Source=?(SpecialFolder.SystemDefault)\C1NWind.db
' When designing the report, ?(SpecialFolder.SystemDefault) refers to Environment.SpecialFolder.MyDocuments, so you can
' put the report database file in your MyDocuments folder to conveniently design and test run your reports:
Dim dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "C1NWind.db")
If Not File.Exists(dbPath) Then
File.Copy("Assets\C1NWind.db", dbPath)
End If
' Create and load the report:
Dim report As New C1FlexReport()
Using fs As Stream = File.OpenRead("Assets/ProductsUWP.flxr")
report.Load(fs, "ProductList")
End Using
' Assign the report to the viewer's DocumentSource - it will be generated automatically
' (asynchronously by default) when the viewer shows it:
Me.flexViewer.DocumentSource = report
End Sub