Skip to Content
0
Former Member
Jun 11, 2009 at 10:21 PM

How to run a report out of the web container?

41 Views

Hi All,

<p>

Does anyone have tips on running a report outside of the web container? I'd like to be able to JUnit the scenarios I'm coding up without having an app server running. What is the ReportClientDocument expecting in the request, response, and context? The code as shown just returns the enclosed error.

<p>

All I'm really trying to do is have the report execute and be able to assert that the data is appropriately retrieved from the data source. If there's a way to do that without the Viewer, that would be cool, too.

<p>

Any tips would be much appreciated. Sorry about the poorly formatted code and error... the code tags don't seem to be working... 😔

<p>

Thanks,

<p>

Eric

<pre>public void testReportRunning() throws ReportSDKExceptionBase{

ReportClientDocument rcd = initReportClientDoc("./test/data/EBTest1.rpt");

assertTrue(rcd.isOpen());

CrystalReportViewer crv = new CrystalReportViewer();

crv.setReportSource(rcd.getReportSource());

String htmlContent = crv.getHtmlContent(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockServletContext());

System.out.println(htmlContent);

}

com.businessobjects.report.web.shared.WebReportingException---- Error code:0

at com.businessobjects.report.web.e.if(Unknown Source)

at com.businessobjects.report.web.e.a(Unknown Source)

at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)

at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)

at com.crystaldecisions.report.web.ServerControl.getHtmlContent(Unknown Source)

at com.tririga.crystalpoc.ReportAccessorTest.testReportRunning(ReportAccessorTest.java:82)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at junit.framework.TestCase.runTest(TestCase.java:164)

at junit.framework.TestCase.runBare(TestCase.java:130)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:120)

at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)</pre>

Edited by: Eric Batzdorff on Jun 12, 2009 12:24 AM

Edited by: Eric Batzdorff on Jun 12, 2009 12:24 AM

Edited by: Eric Batzdorff on Jun 12, 2009 12:25 AM