Jump to content
  • 0

Adding a table of wording to a Details Data Page


JKSGT

Question

Hi,

I am building a dynamic document that comprises of  first page one followed by several pages of wording and a last page.

The first page and last page get data from multiple fields in Table A.  The wording pages get data from a multiple records in Table B, but only from a single field (ie. each record in the wording table represents a paragraph that is marked up in html for formatting). 

Ultimately I want my users to be able to download the complete document as a single PDF. I found the Details Data Page works well for to PDF the first and last page as I can add some calculated values and set page breaks where I want to be using the PDF option. I also found that a table data page works well for the wording as I can query the wording table and display all the paragraphs as a table. However I’m struggling to combine the two that results in a usable PDF.

I tried using two data pages (Details and Table) with an iframe to embed the wording from the Table within the Details Data Page. This worked to a point but I struggled to dynamically size the iframe when the wording went over a page but more crucially the iframe split some of the sentences in half when I created the PDF as it treated the iframe content like an image rather than lines of text. So I stopped this approach.

I found when I added all the paragraphs manually to a Text(64000) field I can get the wording to display correctly. 

So my question is - does anyone know if it’s possible to combine the contents of the same field from multiple records in the same table into a single Text(64000) field? Either using a triggered action or a virtual field?

I think if I can do this then I can probably create PDF documents that include my fields plus the table content.

Many thanks for your thoughts

Jay

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi,

Thank you for your response. I got distracted by another problem... Going back to this one, I did try a virtual field approach using the SELECT statement below:

SELECT Wording FROM tab_Wording WHERE Record_ID = target.[@field:Responses_Record_ID]

However Caspio only returns the first record in the Wording table not all matching records. 

Secondly where my wording contains html markup tags such as paragraphs </p> or line items </li> I get double line spacing for some reason. This does not happen when I display the content of the fields directly just as a html field.

Which is why I was asking if it’s possible to combine the contents of the same field from multiple records in the same table into a single Text(64000) field? Either using a triggered action or a virtual field and display it on my PDF that way.

Many thanks

Jay

Link to comment
Share on other sites

  • 0

The solution (courtesy of Caspio support):

REPLACE(REPLACE(REPLACE(STUFF((SELECT ' ' + CAST(Wording AS nvarchar(MAX)) FROM tab_Endorsements WHERE Quote_ID=target.[@field:P0002_Responses_Quote_ID] FOR XML PATH ('')), 1, 1, ''),'&lt;', '<'),'&gt;','>'),'&amp;nbsp;',' ')

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...