This topic contains 1 reply, has 0 voices, and was last updated by JohnCCole 7 years, 7 months ago.

  • Author
    Posts
  • #1858

    johnsongilpp

    Has anyone been able to successfully use an advanced pdf/html template with the render module ( I have tried loading the file obj and pulling the contents but that doesn’t work either)? Also has any been able to add search results with the render module. These two functions aren’t working for me. I’m able to create an xml string and create a pdf with it but I can’t get the other two functions working. The documentation isn’t any help either. Please see my code below.

    for the add search piece

    var xmlStr = “n”

    + “n”

    + “n” + “n”

    + “n” + “n”

    + “

    n”

    + “

    + “n” + ““;

    var rs = search.create({

    type: search.Type.TASK,

    columns: [‘title’, ‘status’, ‘startdate’],

    filters: []

    }).run();

    var results = rs.getRange(0, 1000);

    var renderer = render.create();

    renderer.templateContent = xmlStr;

    renderer.addSearchResults({

    templateName: ‘exampleName’,

    searchResult: results

    });

    var newfile = renderer.renderAsPdf();
    This is a cached copy. Click here to see the original post.

  • #1859

    JohnCCole

    Not sure if you just omitted it in your sample but I don’t see you using the search results in the template content you provided. When you call addSearchResults the templateName is the name you wish to use when referencing those search results in the template content. So I expected to see in your template content again perhaps an omission in just the post. I can report I have used both the render call and addSearchResults with no issues.

You must be logged in to reply to this topic.