Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Crystal Report viewer Object Not Disposing properly

Hello guys i have one problem i have one crystal report and using vb.net.

I write code where as below

VB
For i=0 to 15 

Try

    Dim vRep As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    vrep.export()


Catch


Finally 

      vrep.close()
      vrep.dispose()

end try

NEXT



Problem occurs when vrep.export raise exception then in next loop step i want be able to dispose vrep.close()
and vrep.dispose()
Posted
Comments
Marc Gabrie 2-Oct-13 11:35am    
what is the error you get there???

1 solution

Don't put that way. Put those(Dim, close, dispose) outside of loop(export also should be outside but not sure). Solved.
And check this Tip/Trick
Crystal Reports: Fix for "Load report failed" error.[^]
 
Share this answer
 
Comments
KK shah 5-Oct-13 7:14am    
I already try that also but not able to solve in that way thanks for prompting reply..
thatraja 5-Oct-13 8:09am    
Tried all 3 solutions? still not working?
KK shah 5-Oct-13 9:17am    
yes
thatraja 7-Oct-13 14:17pm    
Share more code, so that I could spot something

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900