Planet Jaspersoft

Filter by tags:

May 9, 2016

Hi,

D3 Chord diagram visualization example using CVC component in J.D.S 6.2 or 6.2.1 CE/Pro


Development Credits : Abhi 

Working with passionate guys  always fun and results best solutions :-) 

Sadakar Pochapmalli  

May 9, 2016

May 6, 2016

Hi,

D3 Pie Chart Visualization Example 


Populate SQL result set as JSON format using Java Script :
  
               var data = [];

               var series0 = instanceData.series[0];
              
                for (var index = 0; index < series0.length; ++index) {
                   
                             var record = series0[index];                  
                             data.push({label:record.testprop, value: record.testvalue});
                    }


Development Credits : Sadakar 

Sadakar Pochampalli 

May 6, 2016

Hi,

D3 Sankey Diagram Visualization example in Jasper Reports.


(Please click on image)


Example Development Credits : Abhi & Sadakar

Coming together is a beginning; keeping together is progress; working together is success. 

Yes, we did it using CVC component.

Special thanks to my senior & fellow buddy for continuous encouragement and guidance.

( Oopps..! Yet, I have to understand the java script)


- Sadakar Pochampalli 

May 6, 2016

Hi,

D3 three level Collapsible Tree View Visualization Example

(Please click on Image to get the original view of the screenshot)

Development Credits : Abhi & Sadakar

- Sadakar Pochampalli 

May 6, 2016

Hi,

D3 Tilford Tree 3 level visualization using CVC component.


(Please click on image for original screenshot view - that looks better)

Development Credits : Abhi & Sadakar

Coming together is a beginning; keeping together is progress; working together is success. 

Yes, we did it using CVC component.


(Ooops..!!, Yet I have to understand how 3rd level java script added in js file). 


Sadakar Pochampalli 

May 6, 2016

Hi,

Individual months Calendar View Visualization example using CVC component.

 1990 Data :(Please click on image to get the best view)

1991 Data :(Please click on image to get the best view)
  
Development Credits : Sadakar

Coming together is a beginning; keeping together is progress; working together is success. 

:-) knowledge transfer made me to develop this visualization :-)  





May 6, 2016

Hi,

Calendar View Visualization example in Jasper 6.2 CE/Pro Studio


(Please click on image for best view) 

(2008 -2010 data)


 (1990-1993 data)


Control report parameters using some cascading or some logic in default value expressions. 
If not it will generate empty blocks for the years. 




Coming together is a beginning; keeping together is progress; working together is success. 

Yes, we did it using CVC component.

Special thanks to my senior & fellow buddy for continuous encouragement and guidance.


Credits : Sadakar & Abhi. 

- Sadakar Pochampalli

May 6, 2016

May 1, 2016

Hi,
In this post you will see how to work with a basic oracle stored procedure.

Software Setup : 
1) Oracle SQL developer  Version 4.0.3.16
2) Japsersoft Design Studio 6.1 Professional
3) Jasperserver 6.2 professional 
4) Oracle Version : Express Edition

Aim of the report : Display employee data as a grid 

1) Connecting to XE schema in database client tool ( i.e., Oracle SQL developer)

NOTE :  Default username and password while installing Oracle Expression
USER NAME : SYS
PASSWORD : AS SYSDBA

conn sadakar/sadakar
Syntax : conn schemaName/Password

2) Writing Stored Procedure on "emp" table ("emp" table comes with oracle 11g installation). 


create or replace procedure "REF_CURSOR_SAMPLE"
(emp_cursor  IN OUT SYS_REFCURSOR)
as
begin
  open emp_cursor for
    select * from emp;
end ref_cursor_sample;


Execute Stored Procedure in Oracle SQL developer:
NOTE : Make sure set serveroutput on (i.e., run this command in SQL developer before trying to print the SP result set)


VARIABLE emp_data REFCURSOR;

EXECUTE REF_CURSOR_SAMPLE(:emp_data);

PRINT :emp_data;





3) Create a simple JRXML and in the Query editor change the language type to "plsql" and call the above stored procedure as follows 
{       call REF_CURSOR_SAMPLE($P{ORACLE_REF_CURSOR}       } 

Syntax : { call procedureName(param1,param2,$P{ORACLE_REF_CURSOR})}

 4) Create a parameter called "ORACLE_REF_CURSOR" in parameters Outline section and write its type as java.sql.ResultSet

5) In the query editor manually type the field names and provide types to them as shown in below image

  
NOTE : If you click on "Read fields" button you may see or stop with below error message
net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query:

{call REF_CURSOR_SAMPLE($P{ORACLE_REF_CURSOR})}


Caused by: java.sql.SQLException: Invalid column type: 2000 

 6) Design the report and save then preview it. 



7) Japsersoft Design studio preview  of the report. 

Report output in Jasper server:

Configure PL/SQL for Japserserver (5.5 or later)
It can be found at http://community.jaspersoft.com/wiki/config-stored-procedures-jasperreports-server-55

After successful configuration publish the report to the server and check the output.



NOTE : Create oracle "XE" data source connection before publishing the report.  Sample connection is shown in below image. 


Download : 
Sample JRXML : click me.!

References : 
1) http://community.jaspersoft.com/wiki/ireport-calling-stored-procedures
2) http://community.jaspersoft.com/wiki/how-execute-oracle-stored-procedure-jasper-report-ireport-editor-environment
3) http://community.jaspersoft.com/wiki/calling-microsoft-sql-stored-procedures-ireport

Learn more about SP's here :
1) http://www.mkyong.com/oracle/oracle-stored-procedures-hello-world-examples/
2) https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6009.htm
3) https://docs.oracle.com/cd/B28359_01/appdev.111/b28843/tdddg_procedures.htm 

May 1, 2016

April 19, 2016

Hi ,

This post is a re-blogging on how to get data in a pop-up like tool tip when clicking on a text field or image field or a graph slice or bar.

Here is the actual reference for the example :
http://community.jaspersoft.com/blog/executing-javascript-functions-jasperreports-within-jasperreports-server

Example Environment : 
TIBCOJapsersoft Design Studio Professional 6.1
Japser Server 6.2 Professional
PostgreSQL database.

Example explained in below PPT - Visit download section in this page.

Sample Screenshots : 

Image-1 : Sample Code to come in PopUp:
(Please click on images for best view of content available on it)

 Image-2 : Sample output : Perform click action on customer_id=6 field as shown below
(Please click on images for best view of content available on it)
 Image-3 : Sample output : Perform click action on customer_id=2 field as shown below
(Please click on images for best view of content available on it)

Download :
1) Presentation 
2) JRXML
3) Report zip extract from Server
4) Original source code
5) source js file.

Click me to download 

Direct link : 
https://drive.google.com/folderview?id=0BymV_QP4TGBEWEZwYk9aYUxLQjg&usp=sharing

I hope this re-blog helps someone in the community..!

Regards,
Sadakar Pochampalli 

April 19, 2016

April 14, 2016

Hi,

This post will talk about how to create topics from Japsersoft Design Studio.

Software used for this example : 
1) Jaspersoft Design Studio 6.2 Professional
2) Japsersoft 6.2 Professional Server
3) Foodmart database - PostgreSQL database server

Few Questions : 
1) What are topics ? What is the usage ?
2) What are the types of topics ? When to go for which type ?
3) What is the difference between regular report or studio based topic ?

Jaspersoft offical documentation references : 
1) Creating Topics :
http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/creating-topics
2) Topics - Domains :
http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/creating-topics-domains
3) Jaspersoft Domains & topics references
http://community.jaspersoft.com/wiki/jaspersoft-domains-and-topics-reference

 Basic understanding of  Studio based topics : 


Example : Step by Step Procedure : 
1) File -> New -> JapserReport -> FoodmartTopic.jrxml
2)  SQL 

 3) Points to note down 
#) This is a parameterised JRXML which will be populated while creating the Ad-Hoc view
#) i.e., pre-filter the data at SQL level and the same will be asked while creating ad hoc view.
#) Parameter Name : param_Gender and type is : java.lang.String
#) Need not to design anything here in JRXML but you can use $R{} report object to localize.

4) Changing Label names in JRXML level for Studio based topics
#) In above image, you can observe the field names are like "state" , "occupation"  and etc.
#) You can change "state" as "Store State" as label name. 
#) For doing this you need to add "adhoc.display" property in the JRXML
#) Example : change state to "Store State"

    <field name="state" class="java.lang.String">
     <property name="adhoc.display" value="Store State"/>
     </field>

#) remove / for > in first line , and write end tag for it </field> , in between write the property. 

5) Save the JRXML and now its time to send/publish it the server. 

6)  Uploading JRXML as JasperReport (This will become Topic when creating ad-hoc view)
Name of the Report/Topic : FoodMartTopic 

I am taking "Topics" folder available in under /public/adhoc/topics for keeping/publishing the JRXML created.
 If it is organize specific you may see Topics folder under /organizations/organization_1/adhoc/topics

What I observed, when I keep it in some other folder it is not populating as ad-hoc view when we create. 

Step-1 : As shown in below figure, navigate to JasperReport from Public -> Topics -> Add Resource -> Jasper Report



Step-2 : Browse for the JRXML as shown below image




Step-3 : Edit the Data source
 Step-4: Add the input control (param_Gender)
NOTE: We are taking a filtered JRXML for topic and it should be available while creating the view.



 Thats all, we are done with uploading JRXML that will become as "Topic".

Now, its time to create "Ad Hoc View" then "Ad Hoc report" on top of it.

7) Creating Ad Hoc View and Ad Hoc Report
Step-1: From Jasperserver menu bar click on "Create" -> "Ad Hoc View"
Step-2 : Select the "FoodmartTopic" as shown in below image. 
Step-3: When we click on "OK" it will open Ad Hoc editor with "Input Controls" window popup. 
#) By default it will display "NULL" in input control as we set the type as "Static Text" while creating input control for the topic. You can change it to "Single Select" query or to other types.
#) Type "F" value in filter as shown in below image then click on "OK" button.

(Click on Image to get the best view of content in it)

Step-4 : Select the type of Ad hoc view ( Lets take cross tab type) and drag and drop the "Dimensions" and "Measures" of your choice. 
A sample is shown in below image. 


(Click on Image to get the best view of content in it)

Step-5: Save this ad Hoc view as View as well as Report. 





Step-6 : Running the Report created 

Observe the view & Report ( I took same folder to keep both)
Now, running the report (Select the report and click on "Run" button).

This way one can work with Studio based topics for Ad Hoc views and Ad Hoc Reports. 

Download Examples and Setup : 
1) JRXML
2) Server Project Zip file (There are other examples in zip - Go with the images that you see in this post)
3) Deployment procedure : Import the zip file in Professional or Enterprise Server and point out to foodmart database to Topic, View and Report.

Click Me to Download

IMP NOTE : 
#) View is like Report. Don't get confuse with the Type because uploading a normal JRXML as a report will have same type . i.e., "Report" 

I hope this will help someone in the community. If you find it useful, please hit on google share button and help the other. 

Thank you for visiting this page. 

Until Next..
Sadakar Pochampalli 

April 14, 2016

Pages

Feedback
randomness