Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Data is not coming to the DataSet in eclipse Birt(DataSet is empty after writing script)
Data is not coming to the DataSet in eclipse Birt [message #1385767] Wed, 11 June 2014 06:22
Jeet Chatterjee is currently offline Jeet ChatterjeeFriend
Messages: 1
Registered: June 2014
Junior Member
I am using eclipse Birt for reporting an application which is built is apache ofbiz. I want to report some information in a table format and want to get the output in a pdf format,that is my purpose.I am posting the class which is getting the data from the source ..


public static void getReport(HttpServletRequest request, HttpServletResponse response){
Delegator delegator = (Delegator) request.getAttribute("delegator");
String reportType = request.getParameter("reportType");
String compId = request.getParameter("companyId");

List empTaskLists = FastList.newInstance();

//check employee position
try {
//use Company Id from global context
List<GenericValue> partyList = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationshipAndDetail", UtilMisc.toMap("partyIdFrom", compId)));
//child
for( GenericValue party : partyList) {
GenericValue partyInfo=delegator.findByPrimaryKey("PartyAndPerson", UtilMisc.toMap("partyId", party.get("PartyId")) );
String partyName = partyInfo.get("firstName") +" "+partyInfo.get("lastName");

List<GenericValue> taskList = delegator.findList("WorkEffortAndPartyAssign", EntityCondition.makeCondition(UtilMisc.toMap("partyId", party.get("partyId"), "currentStatusId", "PTS_CREATED" , "statusId", "PAS_ASSIGNED")), null, null, null, false);

for( GenericValue task : taskList) {

Map taskMap = FastMap.newInstance();
String taskName=task.getString("workEffortName");

taskMap.put("empId", party.get("partyId"));
taskMap.put("empName", partyName);
taskMap.put("taskName", taskName);
taskMap.put("start", task.get("estimatedStartDate"));
taskMap.put("end", task.get("estimatedCompletionDate"));

empTaskLists.add(taskMap);
}


}


} catch (Exception e) {
e.printStackTrace();
}



This class is responsible for populating the data to the birt.And Under Birt i have a dataset which is getting empty.i am posting the open and fetch script
open script



var compId= "DemoScrumCompany";
emptaskList = FastList.newInstance();

partyList = delegator.findList("PartyRelationshipAndDetail", EntityCondition.makeCondition(UtilMisc.toList("partyIdFrom",compId)),null, null, null, false);

//child
for( party in partyList) {
partyName = PartyHelper.getPartyName(party, true);
var conds = FastList.newInstance();
conds.add(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, party.get("partyId")));
conds.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "PTS_CREATED"));
conds.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAS_ASSIGNED"));

taskList = delegator.findList("WorkEffortAndPartyAssign", EntityCondition.makeCondition(conds), null, null, null, false);
for( task in taskList) {
taskMap = FastMap.newInstance();
taskName=task.get("workEffortName");
//taskName="Task1";
taskMap.put("empId", party.get("partyId"));
taskMap.put("empName", partyName);
taskMap.put("taskName", taskName);
taskMap.put("start", task.get("estimatedStartDate"));
taskMap.put("end", task.get("estimatedCompletionDate"));
//taskMap.put("empId", "EMp01");
//taskMap.put("empName", "EMP1");
//taskMap.put("taskName", taskName);
//taskMap.put("start", "2014-05-21");
//taskMap.put("end", "2014-05-31");
emptaskList.add(taskMap);
}

}
totalRow = 0;
countOfRow = 0;

if (emptaskList.size()> 0 ) {
totalRow = emptaskList.size();
}


fetch script


if (countOfRow < emptaskList.size()-1) {

var emptaskMap =emptaskList.get(countOfRow);
row["employeeId"] = emptaskMap.get("employeeId");
row["employeeName"] = emptaskMap.get("employeeName");
row["taskName"] =emptaskMap.get("taskName");
row["startDate"] = emptaskMap.get("startDate");
row["endDate"] = emptaskMap.get("endDate");
countOfRow++;
return true;
}

return false;


these i have done to have the data .is it enough????.I also have a dataset which i have attached in the picture.I need the dataset to be populated with the data
  • Attachment: Untitled1.png
    (Size: 25.65KB, Downloaded 120 times)
Previous Topic:BIRT Report Viewer - JS Bug? (Chrome - TOC)
Next Topic:Employment Opportunity: Lead Open Source BIRT Developer @ Actuate
Goto Forum:
  


Current Time: Fri Apr 26 20:57:25 GMT 2024

Powered by FUDForum. Page generated in 0.02991 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top