on 08-11-2014 1:52 PM
In a large WPF application using Crystal Report for Visual Studio 13.0.10, i detect that instances of CrystalReporViewer and ReportDocument are not released. I reproduce this in this small code :
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared Class MainWindow
Private Sub buPreview_Click(sender As Object, e As RoutedEventArgs) Handles buPreview.Click
'Création des données
Dim listPerson As New List(Of Person)
listPerson.Add(New Person With {.Name = "Denis", .PhoneNumber = "0473"})
listPerson.Add(New Person With {.Name = "Laurent", .PhoneNumber = "0473"})
listPerson.Add(New Person With {.Name = "Fred", .PhoneNumber = "0473"})
listPerson.Add(New Person With {.Name = "Jean", .PhoneNumber = "0473"})
'Création du report
Dim R As New reportdocument
R.Load("CrystalReport1.rpt")
R.SetDataSource(listPerson)
'Aperçu
Dim wCR As New WindowPreview
wCR.CRV.Owner = Window.GetWindow(wCR)
wCR.CRV.ViewerCore.ReportSource = R
wCR.ShowDialog()
'Nettoyage
wCR.CRV.Dispose()
wCR = Nothing
R.Close()
R.Dispose()
R = Nothing
End Sub
End Class
I try a lot of thing without success and memory profiler indicates instances number increase after each preview Can you help me please ?
Message was edited by: Don Williams Formatted the code - Copy it into Notepad and then paste it in and it removed the formatting tags.
Message was edited by: denis chatelain new fact : I try the same thing in a Windowsforms application and it works. No instances of reportdocument or crystalreportviewer stays in memory.
Hi Denis
This may be an issue with CR - we'd have to test that and see. Before I do have a look, I want to confirm that this indeed is a WPF app, not a winform app using the WPF viewer?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.