|
Re: Fiscal Report BIRT [message #1057747 is a reply to message #1055746] |
Wed, 08 May 2013 14:22 |
|
If you were to create computed columns in your dataSet, you could get what you're wanting. You'd just have to make a computed column for the "fiscal year" and also a computed column assigning values of 1-12 to April - March. Then, use these as your dimensions. That should help get you what you're wanting. Let me know.
Michael
Developer Evangelist, Silanis
|
|
|
|
|
Re: Fiscal Report BIRT [message #1057890 is a reply to message #1057764] |
Thu, 09 May 2013 15:11 |
|
In a scripted dataSet, you'd just define a couple new columns in your dataSet for "fiscal year" and "month" and in the fetch method of your dataSet, you'd simply check your date for what month/year it is and set values for your two fields appropriately. I'll gladly make an example if you still need one after this explanation. Let me know.
Michael
Developer Evangelist, Silanis
|
|
|
|
|
|
Re: Fiscal Report BIRT [message #1059638 is a reply to message #1055746] |
Tue, 21 May 2013 05:03 |
|
Take a look at this example. I create a few computed columns in the dataSet, then in the dataCube, I use the integer fields for sorting purposes. However, in the dataCube, I create a couple new bindings to display the attributes for each dimension. The attributes are added to the dimensions in the dataCube editor by double clicking on the dimension. For the year display, I passed a custom string field I created in the dataSet. For the month display, I passed the actual date as an attribute and used formatting to get it to display the month string.
Hope this helps.
Michael
Developer Evangelist, Silanis
|
|
|
Re: Fiscal Report BIRT [message #1060636 is a reply to message #1059638] |
Mon, 27 May 2013 12:30 |
dhruba kumar Messages: 51 Registered: September 2012 |
Member |
|
|
Hi Sorry for delay in reply.
Now my report is generating as per my expection .
The .rptdesign and Report is atttached.
In Month column I ve written the folowing expression to show the Heading "Apr", "May", "Jun" .."Mar":
BirtDateTime.month(BirtDateTime.date(1900,dimension["Year-Month"]["Month"]+2%12,1),3)+" '"+(new String(new Date(dimension["Year-Month"]["Year"]+dimension["Year-Month"]["Month"]/10,1,1).getFullYear())).substr(2,2);
And in "fetch" in DataSet written the following scriplet:
if(count < rowobj.size()){
rowval=rowobj.get(count).getAttrVector();;
row["ecnNo"]=rowval.get(0).toString();
row["reason"] = rowval.get(1).toString();
row["plant"] = rowval.get(2).toString();
stk= new Packages.java.util.StringTokenizer(rowval.get(3).toString(),"-");
odt = new Packages.java.text.SimpleDateFormat("yyyy/MM/dd").parse(stk.nextToken().toString());
row["creationDate"] = odt;
cal = new Packages.java.util.Calendar.getInstance();
cal.setTime(row["creationDate"]);
FiscalMonth = cal.get(Packages.java.util.Calendar.MONTH)+1;
FiscalYear=cal.get(Packages.java.util.Calendar.YEAR);
if(FiscalMonth<4){
FiscalMonth+=9;
FiscalYear=FiscalYear-1;
}
else
FiscalMonth-=3;
datestr1=FiscalYear+"/"+FiscalMonth+"/01";
row["creationDate"]= new Packages.java.util.Date(datestr1);
count++;
return true;
}
return false;
If possoble please incorporate this feature in OOTB BIRT.
Thanks for your help.
|
|
|
Re: Fiscal Report BIRT [message #1060638 is a reply to message #1059638] |
Mon, 27 May 2013 12:32 |
dhruba kumar Messages: 51 Registered: September 2012 |
Member |
|
|
Hi Sorry for delay in reply.
Now my report is generating as per my expection .
The .rptdesign and Report is atttached.
In Month column I ve written the folowing expression to show the Heading "Apr", "May", "Jun" .."Mar":
BirtDateTime.month(BirtDateTime.date(1900,dimension["Year-Month"]["Month"]+2%12,1),3)+" '"+(new String(new Date(dimension["Year-Month"]["Year"]+dimension["Year-Month"]["Month"]/10,1,1).getFullYear())).substr(2,2);
And in "fetch" in DataSet written the following scriplet:
if(count < rowobj.size()){
rowval=rowobj.get(count).getAttrVector();;
row["ecnNo"]=rowval.get(0).toString();
row["reason"] = rowval.get(1).toString();
row["plant"] = rowval.get(2).toString();
stk= new Packages.java.util.StringTokenizer(rowval.get(3).toString(),"-");
odt = new Packages.java.text.SimpleDateFormat("yyyy/MM/dd").parse(stk.nextToken().toString());
row["creationDate"] = odt;
cal = new Packages.java.util.Calendar.getInstance();
cal.setTime(row["creationDate"]);
FiscalMonth = cal.get(Packages.java.util.Calendar.MONTH)+1;
FiscalYear=cal.get(Packages.java.util.Calendar.YEAR);
if(FiscalMonth<4){
FiscalMonth+=9;
FiscalYear=FiscalYear-1;
}
else
FiscalMonth-=3;
datestr1=FiscalYear+"/"+FiscalMonth+"/01";
row["creationDate"]= new Packages.java.util.Date(datestr1);
count++;
return true;
}
return false;
If possoble please incorporate this feature in OOTB BIRT.
Thanks for your help.
|
|
|
Re: Fiscal Report BIRT [message #1061039 is a reply to message #1060638] |
Wed, 29 May 2013 15:58 |
|
You can request enhancements for BIRT in the bugzilla. If you post the report info in here, others who come across this thread with the same problem can vote for the enhancement.
Michael
Developer Evangelist, Silanis
|
|
|
Powered by
FUDForum. Page generated in 0.04312 seconds