/** * @see * org.kuali.kra.questionnaire.print.QuestionnairePrintingService#printQuestionnaireAnswer(KewPersistableBusinessObjectBase, * java.util.Map) */ public AttachmentDataSource printQuestionnaireAnswer( KraPersistableBusinessObjectBase printableBusinessObject, Map<String, Object> reportParameters) throws PrintingException { AttachmentDataSource source = null; AbstractPrint printable = getQuestionnairePrint(); if (printable != null) { printable.setPrintableBusinessObject(printableBusinessObject); printable.setReportParameters(reportParameters); source = getPrintingService().print(printable); source.setFileName( "QuestionnaireAnswer" + reportParameters.get("questionnaireId") + Constants.PDF_FILE_EXTENSION); source.setContentType(Constants.PDF_REPORT_CONTENT_TYPE); } return source; }
/** * @see * org.kuali.kra.questionnaire.print.QuestionnairePrintingService#printQuestionnaire(org.kuali.kra.document.ResearchDocumentBase, * java.util.Map) */ public AttachmentDataSource printQuestionnaire( KraPersistableBusinessObjectBase printableBusinessObject, Map<String, Object> reportParameters) throws PrintingException { /* TODO : Questionnaire is a maintenance document. questionnaireId is generated when document is approved and * saved to DB. so, pk is not in doc xml content, and passing questionnaireid will not work. * Therefore, passing documentNumber, questionnaire can be retrieved from xml content by loaddocument. * This is what I think how offshore team can get questionnaire data to generate pdf. */ AttachmentDataSource source = null; AbstractPrint printable = getQuestionnairePrint(); if (printable != null) { printable.setPrintableBusinessObject(printableBusinessObject); printable.setReportParameters(reportParameters); source = getPrintingService().print(printable); source.setFileName( "Questionnaire-" + reportParameters.get("documentNumber") + Constants.PDF_FILE_EXTENSION); source.setContentType(Constants.PDF_REPORT_CONTENT_TYPE); } return source; }