Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 Yesterday 21:51:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,538
Website GitHub

Re: Quote preparation into a formatted template

Circling back to this for completeness. I tried – and got very, very close – to implementing this in Txp with a modified version of aks_table and some CSS/HTML but it was just out of reach and wasn’t really very user friendly.

The embed-Excel-in-a-Word-doc would have been perfect except for the stupid high water mark row issue.

So in the end, I used Jools’ suggestion of doing it all in Word, using non-linked Sections to make front and rear pages, with content sandwiched between them. The graphics are added in the page header and set to full size with 0 margins on the front and rear document sections.

As for the tabular data, Word table calculations are annoyingly limited and require manual updating (F9 or CMD-SHiFT-OPT-U). A simple 3-line macro can do it, but that requires manual execution and causes all sorts of hassles such as requiring the document to be saved as a special type, and you have to agree to enable macros every time the document is opened, and you can’t email the doc to anyone because it’s blocked due to “potentially malicious embedded code” (a macro), yahde yahde. Yuk.

Triggering the macro from a button press that can be taken out of the document flow (i.e. hidden from Print) like is possible in Excel, would be amazing. But techniques for adding buttons don’t seem to exist any more in Office 365. All online resources and AI summaries state that it’s possible using Design Mode and clicking ActiveX / legacy controls or using Form design controls, but none of those options exist any more in the product. That’s progress.

So in the end, I agreed with the client to design out the macro. We just got rid of the totals column/row entirely so the tables can be built by hand in Word.

All in all, it looks pretty sweet. As long as the client remembers to set Margins:None in the Print dialog box prior to clicking Save to PDF, it works a treat, the images all bleed right up to the page edge and there are no ugly white borders.

Thank you so much for all the tidbits of help from everyone. And if anyone is interested in my modified aks_table plugin, with thead and tfoot support (for better styling) then let me know and I’ll publish it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB