Skip to content

Commit cbc45c3

Browse files
author
TanyaEf
committed
Updated README.md
1 parent c0eb68e commit cbc45c3

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ ReportExecutionRequest request = new ReportExecutionRequest();
237237
request.setReportUnitUri("/reports/samples/StandardChartsReport");
238238
request
239239
.setAsync(true) //this means that report will be run on server asynchronously
240-
.setOutputFormat(ReportOutputFormat.HTML);; //report can be requested in different formats e.g. html, pdf, etc.
240+
.setOutputFormat(ReportOutputFormat.HTML); //report can be requested in different formats e.g. html, pdf, etc.
241241

242242
OperationResult<ReportExecutionDescriptor> operationResult =
243243
session //pay attention to this, all requests are in the same session!!!
@@ -247,6 +247,14 @@ OperationResult<ReportExecutionDescriptor> operationResult =
247247
reportExecutionDescriptor = operationResult.getEntity();
248248
```
249249
In the above code we've created `ReportExecutionRequest` instance and sent it to JR server through the `newReportExecutionRequest` method. As a response we've got `OperationResult` instance which contains HTTP response wrapper and instance of `ReportExecutionDescriptor` which we can get with `operationResult.getEntity()`.
250+
Also you can set output format as String:
251+
```java
252+
ReportExecutionRequest request = new ReportExecutionRequest();
253+
request.setReportUnitUri("/reports/samples/StandardChartsReport");
254+
request
255+
.setAsync(true)
256+
.setOutputFormat("html");
257+
```
250258
####Requesting report execution status:
251259
After you've got `ReportExecutionDescriptor` you can request for the report execution status:
252260
```java

src/integration-test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/ReportingServiceIT.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,25 @@ public void should_return_proper_entity_without_numbers_of_pages() {
144144

145145
}
146146

147+
@Test
148+
public void should_return_proper_entity_with_page_range() {
149+
150+
/** When **/
151+
OperationResult<InputStream> result = session
152+
.reportingService()
153+
.report("/organizations/organization_1/adhoc/topics/Cascading_multi_select_topic")
154+
.prepareForRun(ReportOutputFormat.PDF)
155+
.parameter("Cascading_state_multi_select", "CA")
156+
.parameter("Cascading_name_single_select", "Adams-Steen Transportation Holdings")
157+
.parameter("Country_multi_select", "USA")
158+
.run();
159+
160+
InputStream entity = result.getEntity();
161+
/** Then **/
162+
Assert.assertNotNull(entity);
163+
164+
}
165+
147166
@Test
148167
public void should_return_proper_entity_in_async_mode() {
149168

0 commit comments

Comments
 (0)