Jasper Reports Tips & Tricks

 

Logo/Image
=========

java.awt.Image


1. Go to Basic Elements and take "Image"

2. Go to Properties

--> Click Image and Expression Select $F{LOGO} --- (Column Name)


3. Go to Query Editor

--> Class Type -- java.awt.Image

----------------------------------------------------------------------

Print When Expression
===============

যদি ORIGIN_BANK এ ডাটা থাকে তাহলে To the order of লেখাটা থাকবে নতুবা থাকবে না।

তাই NVL2 ব্যবহার করে query তে 'Y' ও 'N' ফালাচ্ছি। 

--> NVL2 (get_bank_info('N',M.ORIGIN_BANK),'Y','N') SHIPPER_BANK_ADD_YN,

তারপর TO THE ORDER OF এ  Print when Expression এ কাজ করেছি...

$F{SHIPPER_BANK_ADD_YN}.equals("Y") ?   true : false

নোট - Print when Expression এর কাজ করতে হলে অবশ্যই query তে 'Y' এবং 'N' ফালাতে হবে। 'Y' হলে True আর 'N' হলে  false

-------------------------------------------------------------------------------------


প্রতিটা বক্সে "টিক চিহ্ন" ছবি দিতে হবে। তারপর Print when Expression করতে হবে। কিন্তু ডাটাবেইজে PAYMENT_INS কলামে collect এ সময় 1 পরে এবং pre-paid এর সময় 2 পরে। তাই case করে 'Y' ও 'N' ফরমেটে আনতে হবে।

--> case when PAYMENT_INST = 1 then 'Y' else 'N' end COLLECT,

--> case when PAYMENT_INST = 2 then 'Y' else 'N' end PRE_PAID,


$F{COLLECT}.equals("Y") ?   true:false

$F{PRE_PAID}.equals( "Y" ) ?   true:false 

================================================

sum/count
=======



step-1 : 


At first create Summary Band. And put Text Field & Static Text

step-2 : 



Create variable. (For example)

--> Name : Total Pieces

--> Value Class Name : java.lang.integer / java.lang.float (output-2.25)

--> Calculation : sum

--> Expression : Pieces (Column name)

--> Increment type : None


step-3 :


--> Take new Text Field .  And Select Variable Expression



--> Double click this Text Field and select your the variable "Total Pieces"

-------------------------------------------------------------------------------------

TABLE ROW ADJUSTMENT :
=================

Step - 1 : 

Text Field : 

Text Adjust : StretchHeight



Step - 2 : All row select 

Appearance :

Stretch Type : Relative To Band Height (deprecated)


Date To Date Report Condition:

AND TO_DATE(TO_CHAR(A.BOOKING_DATE,'DD-MON-RRRR'),'DD-MON-RRRR') BETWEEN  '30-DEC-22' AND '02-JAN-23'

AND TO_DATE(TO_CHAR(A.BOOKING_DATE,'DD-MON-RRRR'),'DD-MON-RRRR')        BETWEEN    nvl( $P{V_FDATE},A.BOOKING_DATE) 
            AND    nvl( $P{V_TDATE},A.BOOKING_DATE) 

AND  A.BOOKING_DATE BETWEEN nvl(:P90_START_DATE,A.BOOKING_DATE)AND nvl(:P90_END_DATE,A.BOOKING_DATE)


Decimal Number Formate:



Select Field : (as Like CBM , KG)
Pattern :  #,##0.00#;#,##0.00#-
Class Type : java.math.BigDecimal

==============================================================


Print Preview :

Single Parameter :

javascript:var myWindow = window.open('http://jasper.maxapex.net:8090/JasperReportsIntegration/report?_repName=A234280/AIREXP_COURIER/SALES_INVOICE/SALES_INVOICE_MST&_repFormat=pdf&_dataSource=RAI_A234280_1961&INV_ID=&P408_INV_ID.')

Multiple Parameter :

javascript:var myWindow = window.open('http://jasper.maxapex.net:8090/JasperReportsIntegration/report?_repName=A234280//Report/HAWB_Dumy_copy/HAWB_dumy&_repFormat=pdf&_dataSource=RAI_A234280_1961&V_COM=&P96_COM_ID.&HAWBID=&P96_HAWB_ID.')



=========== Jasper Connect from Database ===============

Step 1:
=====

Create Data Adapter 






Step 2:
=====




--->jdbc:oracle:thin:@HOST:PORT/SERVICE NAME


Step 3:
=====




Post a Comment

Previous Post Next Post