ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Formatting PDF output using code or formulas instead of Report Text tool?

5 - Atom

Hello Alteryx Community!


I'm building a workflow that will create a memo with up to 100 boilerplate paragraphs taken from a text input tool. The paragraphs will be included or excluded based on an earlier section of the workflow, and a header with the relevant country will be attached to each paragraph. 


My question is about formatting the country headers. This is how the report currently looks:


Alteryx Forums 1.PNG

My goal is to have each of the headers bold and centered like Canada (1), but they are currently being output without any formatting like Colombia (2). 


I'm using the report text tool's 'Available Fields' function to create the memo, and I'm currently formatting it like this:


Alteryx Forums 2.PNG

Now that's good and fine, but I want to avoid having to manually format over 100 of these '_Header' fields because it will  A.) be a huge time sink and B.) prevent on-the-fly formatting changes down the road if need be. What I'm looking for is a way to automate the formatting for these '_Header' fields either through an alteryx tool, HTML, or PCXML, or to at least make it a more efficient process.


I'm currently creating the line breaks for the paragraphs by converting HTML to PCXML, so I believe that is a possibility, but I just don't know what PCXML code I would use to bold and center the column headers. Please let me know if you have any experience with something like this, or have any thoughts. All ideas are welcome! I can upload a version of the workflow, but I will need to sanitize the input data first.


Thank you all so much!

17 - Castor
17 - Castor

Hi @cwkeegan 


If you arrange your data like this



you can use a couple of Report text tools and a Layout tool. 



The 1st Report Text formats the header column and the second formats the text.  Use a Layout tool in vertical mode to combine them into one snippet per record.  When output to PDF it looks like this 






5 - Atom

Hey @danilang 


Thanks for the advice! I tried your solution and it definitely helped with formatting the headers! However, because I am using PCXML to code in the line breaks, the final output is a bit wonky. I've attached a sanitized version of the earlier workflow in case you have a moment to check it out.