How to create rule for DOCX From Dynamic Template

Certified Senior Developer

Hi,

I have a requirement to create a dynamic table in pdf , now i am using plugins DOCX from Dynamic table 

for this how to create rule can anyone suggest,

thanks

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    a!localVariables(
      local!application: rule!GAI_getApplication(applicationId: ri!appId).data,
      local!projectInfo: rule!GAI_getProjectInfoDisplaySummary(appId: ri!appId),
      local!grantDocument: rule!GAI_getGrantDocument(applicationId: ri!appId, isactive: true()).data,
      local!programAssessmentChart: rule!GAI_convertPgmActvtyAssmntDataToTempData(
        pgmActvtyAssmnt: rule!GAI_getPrgmActvtyAssessmentByApplnId(applicationId: ri!appId).data,
        applicationId: ri!appId
      ),
      local!programActivity: rule!GAI_getRefProgramActivity(
        programActivityId: a!forEach(
          items: local!programAssessmentChart.fk_program_activity_id,
          expression: fv!item
        )
      ).data,
      {
        local!grantDocument,
        local!programAssessmentChart,
        local!programActivity,
        local!application,
        local!projectInfo,
        concat(
        "<dynamic>",
        a!forEach(
        items: local!programActivity,
        expression: concat(
        "<ctable activity='",
        fv!item.['recordType!{c1b3acd6-4f4f-401f-828d-b60dc3af6722}GAI Ref Program Activity.fields.{c6132d99-98ea-42d1-a06a-2c005c045e8e}activityName'],
        "'activityName='",
        "' />"
        )
        ),
        "</dynamic>"
        )
      }
    )

  • 0
    Certified Lead Developer

    The easiest way to create a table in a PDF is to generate a table in HTML (see here: https://www.w3schools.com/html/html_tables.asp) using an expression rule and convert to PDF using the PDF from HTML using the Smart Service in this plugin: https://community.appian.com/b/appmarket/posts/dynamic-document-generator

    If you want to generate a table in an already existing word document and then convert it to PDF, there is an example on how to create dynamic tables using this plugin in their documentation: https://community.appian.com/b/appmarket/posts/advanced-document-templating#

    Note that there is often a loss of fidelity when converting from DOCX to PDF. If you're starting from scratch, I would recommend the 1st option (HTML -> PDF)