cancel
Showing results for 
Search instead for 
Did you mean: 

Print from Syclo Client using Jasper Reports

Former Member
0 Kudos

Hi Friends,

I am trying to Integrate Jasper reports with Syclo, My Requirement is to Print the Objects/data from Syclo by using Jasper Reports.But am facing few issues that i listed below

I followed below steps in Both Agentry as well as Jasper Report.

1. Create an Edit Transaction for Service order object, that contains Item collection and Product Description

2. In Transaction update step, am calling a java steplet to fetch data from transaction and fill the data to jrxml [ jasper report]  file

3. This Transaction has mapped under Action, This action will be executed when i click the Popup menu from UI

4. I have created a Jasper Report with Product Description field.

When i click the print button in Items screen and click transmit am getting following exception. But am able to fetch the [ Product Description ] data  from CRM [ see below ],

java.awt.HeadlessException

ZACC_PrintJasperReport::Product Description  isLABOUR |

ERROR#com.sap.mobile.platform.server.agentry.console##anonymous#Agentry Borusan Worker Thread###Exception: 17:53:52 03/16/2015 : 20 (Agentry3), JavaBackEndError (java.awt.HeadlessException)

I Searched through lot of websites and found that this exception is due to

HeadlessException

Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse.

I tried following options, but still it is not resolved

1. Set following lines in props.ini [ smp Server Path ]

-Djava.awt.headless=true

2. Set following lines in Java Steplet

System.setProperty("java.awt.headless", "true");

log.info("Headless mode :"+java.awt.GraphicsEnvironment.isHeadless());

3. Set the environment variables in SMP Server [ setenv.bat ]

set JAVA_OPTS=”-Djava.awt.headless=true"

i appreciate and thankful if anybody give me an idea to resolve this issue.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member208808
Active Participant
0 Kudos

Hi Vignesh,

I think you are trying to achieve following if i am not mistaken it...

If yes then i think that is going to error out being Headless

Instead try creating a file on server side with your information and try to print it using

DocPrintJob (Java Platform SE 7 )

Regards,

AK

Former Member
0 Kudos

Thanks AK K,

i followed your approach to create the file from server end and try to Print, But in this option i am not able to write data in file

I folllowed below steps to achieve this

1. Created a New JRXML file [ Jasper Reports ], in this JRXML file i have added 3 Fields, they are Item id, Product id and description.

2, In Syclo, i have created a Action button that will call 1st Action [ service order object ]

3. 1st action contain sub action and command line

Sub action : It will loop over Item collection [ in Service order object ] and call 2nd action,

Command Line: am calling a java code by java -jar "xxxx.jar". This java code will get runtime data from csv file and fill the data in jrxml [ jasper report file ] and finally display the values in Jasper report

and PDF [ export ] file.

4. 2nd action contain command Line. In this command line, We are using rules to write Item objects [ Item id, Product id and description ] in csv file.

But here i am not able to write data into csv file by using Rules in Windows cmd line. Java part is working fine even if i hardcode the data in csv file, jasper report is displaying with hardcoded values

But Rule is not working correctly. Please let me know if am missing anything ?

former_member208808
Active Participant
0 Kudos

Hi Vignesh,

What client you are using to test this,

it may not work on WPF client.

But it is working for ATE client for me....

Below is my rule for comandline and also file in which output is written

For Flight Application :


1)Rule structure

2)Here is file content after i run this step



Just make sure you have done following correctly

1)First action -->its target is SalesOrder which has items Collection

   it has loop over collection to loop on this Item Collection

   it will call second action

2)Second action -->Its target is Item Object

   it has windows command step with command line targeting above shown rule...


*************************************************************

Also you may want to take a look at following

Agetry Reports,

Just go to modules->,

Go to reports

Add a report as following

1)Create a report for your collection to print

2) Configure Collection/other properties for that as shown below

3) Add Columns to that report by selecting object property for that object (Collection object) as shown below....

4) After Following above steps Just create one action

    ->Add action step Print Report

    ->Give your report name here as shown below

  

Hope this helps,

Regards,

AK