def getReportTable (self):

        pid = self.getProjectID()
        reporttype = self.setReportType()
        reportQuery =self.getFinalReportTableQuery()
        connector = HouseholdIncome()
        reportTable = connector.getReportTable(reportQuery,pid,reporttype)
        return reportTable
    def getHouseholdIDsQuery(self):
        '''Get query for generating a list of households that match a users selection criteria'''

        projectid = self.getProjectID()
        selectedHChars = self.getSelectedHouseholdCharacteristics()
        selectedPChars = self.getSelectedPersonalCharacteristics()
        selectedhouseholds = self.getHouseholdsSelection()
        connector = HouseholdIncome()
        householdIDsQuery = connector.buildReportHouseholdIDsQuery(projectid,selectedhouseholds,selectedPChars,selectedHChars)
        return householdIDsQuery
 def getReportHouseholdIDs (self):
     '''Get a list of households that match a users selection criteria -i.e Household names + Personal Characteristics and Household Characteristics'''
     
     selectedids = []
     householdIDsQuery =self.getHouseholdIDsQuery()
     connector = HouseholdIncome()
     householdIDs = connector.getReportHouseholdIDs(householdIDsQuery)
     for hid in householdIDs:
         selectedids.append(str(hid[0]))
     return selectedids
    def getFinalReportTableQuery(self):

        projectid = self.getProjectID()
        householdIDs = self.getDISortedHouseholdIDs()
        cropdetails = self.getCropReportDetails()
        employmentdetails = self.getEmploymentReportDetails()
        livestockdetails = self.getLivestockReportDetails()
        loandetails = self.getLoansReportDetails()
        transferdetails = self.getTransfersDetails()
        wildfoodsdetails = self.getWildFoodDetails()
        reporttype = self.setReportType()
        
        connector = HouseholdIncome()
        householdIDsQuery = connector.getFinalIncomeReportTableQuery(reporttype,projectid,householdIDs,cropdetails,employmentdetails, livestockdetails,loandetails,transferdetails,wildfoodsdetails )
        return householdIDsQuery