I read through this blog (http://tknight.org/sdn/show/11649) by Ted Ueda to see how I should close a ReportClientDocument. I ran a quick test and I'm not seeing the behavior I expect. Specifically, even after I close the ReportClientDocument and dispose of the viewer, the ReportClientDocument.isOpen() still returns true.
Can you see if I'm doing something wrong? In the enclosed test, that last assertion fails because the rcd2.isOpen() is still returning true and the test expects it to be false.
Any tips would be appreciated.
Thanks,
Eric
public void testReportDisposal() throws ReportSDKExceptionBase{
ReportClientDocument rcd2 = new ReportClientDocument();
rcd2.setReportAppServer(ReportConstants.RAS_HOST);
rcd2.open("rassdk://c://temp//triPeople_triEmployee_FormReport_OneField.rpt", OpenReportOptions._openAsReadOnly);
assertTrue(rcd2.isOpen());
IReportSource reportSource = rcd2.getReportSource();
rcd2.close();
CrystalReportViewer crv2 = new CrystalReportViewer();
crv2.setReportSource(reportSource);
assertTrue("RCD expected to be open the viewer has not yet been disposed",
rcd2.isOpen());
crv2.dispose();
assertFalse("RCD expoected not to be open since the viewer was disposed",
rcd2.isOpen());
}