Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Grouping on data in Scripted Data source
bokya
Hi all<br />
Actually i am using Scripted data source ,<br />
i want data should like the below....<br />
<strong class='bbc'>Vendor code Vendor Address Rating Trade Gropup </strong> abc <br />
xyz <br />
sas <br />
1 23 dasa 0 sasdd <br />
dsfd <br />
fdfd <br />
BCDII <br />
dsds <br />
2121 dsdsds 232.4 dfd <br />
gfgfgfg <br />
v gff <br />
<br />
<br />
But problem is what since i am using Scripted data source i am takin data from classe in the form of list.<br />
so i need to assign those list values to the columns mentioned above in the table format.<br />
here in this case vendor code,address rating is one to one correspondence but Trade group can be multiple.I am having list which contains data for 4 colums... so i have to apply groping for those columns....<br />
and the next task is to print this Report also .... so please anybody help me in that...
Find more posts tagged with
Comments
bokya
Hi all
Actually i am using Scripted data source ,
i want data should like the below....
Vendor code Vendor Address Rating Trade Group
But problem is what since i am using Scripted data source i am takin data from classe in the form of list.
so i need to assign those list values to the columns mentioned above in the table format.
here in this case vendor code,address rating is one to one correspondence but Trade group can be multiple.I am having list which contains data for 4 colums... so i have to apply groping for those columns....
and the next task is to print this Report also .... so please anybody help me in that...
mwilliams
Can you just bring in your 4 columns in the dataSet and then do your grouping within a table in BIRT? Maybe I'm not understanding correctly?
bokya
hi ,
can u tell me how does grouping happen for any data?
because here in this rptdesign trade group are multiple corresponding to vendor code,name and address..
so i have coded in java class like for multiple trade group i am repeatating same vendor code,name and address for grouping purpose.... i have applied grouping on Vendor code then on Vendoe name and then on vendor address because this values are repetating for multiple trade group... so i have grouped vendor code, name and address .but while printing this report its showing many row since i have grouped 3 things..
mwilliams
Can you show me what your data looks like in your dataSet and what you want it to then look like in your report? If you can modify your scripted dataSource to contain a small sample of data that you define in your open method so that I can run the report, that would be great.
bokya
Hi mwilliams,
Actually i am taking data from Web Services through java classes, here i am showing the data printed on Eclipse console as,
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=9201219
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=4333434
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=5232322
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=0343232
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=3236299
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=4303172
Vendor Code=>1 Vendor_Name=aaa Vendor_Address=xyz Trade_Group=3986326
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=3423238
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=3277734
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=2323673
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=6463838
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=3463643
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=6327636
Vendor Code=>2 Vendor_Name=abc Vendor_Address=pqr Trade_Group=3283287
Vendor Code=>3 Vendor_Name=fdf Vendor_Address=dsds Trade_Group=3283287
Vendor Code=>3 Vendor_Name=fdf Vendor_Address=dsds Trade_Group=3283287
Vendor Code=>3 Vendor_Name=fdf Vendor_Address=dsds Trade_Group=3283287
Vendor Code=>3 Vendor_Name=fdf Vendor_Address=dsds Trade_Group=3283287
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=3232131
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=5453232
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=343
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=23287
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=0
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=0
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=0
Vendor Code=>4 Vendor_Name=vfd Vendor_Address= Trade_Group=33287
this is the sample of data .It is in list object and i am assigning this Object values to perticular column on the fetch script of Scripted data set like,
row["VendorAddress"]=lstTradeRating.get(cntRate).getVendorAddress();
row["VendorName"]=lstTradeRating.get(cntRate).getVendorName();
row["VendorCode"] =lstTradeRating.get(cntRate).getVendorCode();
row["TradeGroup"]=lstTradeRating.get(cntRate).getTradeGroup();
plese see in the attachment rptdesign
thanks
mwilliams
If you have the 4 columns dataSet, you can simply drag the dataSet into your report layout and have the 4 column table. From there, if you select your table and right click on the detail row tab, you can insert a group and group by whatever field you want. If you need multiple groups, you can do that as well. You'll just need to make sure the groups are in the correct order. With groupings in your table, you'll have the ability to aggregate over your group rather than the entire table, so you can find group totals, etc and put them in your group header/footer. If you need an example. Let me know how you want these 4 fields to look like in your final table and let me know your BIRT version, and I'll take your actual data and create a sample report for you.
bokya
hi ,
Version: 2.6.2.r262_v20101008-9iF7A9JGHMBCRz-R8tbxRel8kQrI
Build id: v20110214-1523
This is my BIRT propertis. Please make for me sample Report According to my need and my data. But please use Scripted data source ,because i am able to do groping by using Classical model Data Source.
and also very imp thing is that i want to print this Rport,so plase check whether is good for printing..
thank you very much
mwilliams
Sorry for the delay. I was out most of this week at JavaOne. What is the output supposed to look like given the above data, so I know how to group your report. Thanks!