I am trying to show or hide fields and their identifying static field based on if the field in Salesforce is blank or not. My IF statment is shown below:
`{{ IF {{OPPORTUNITY_LINEITEM_CREATIVE_SIZES}} <> “” “Creative Sizes: {{OPPORTUNITY_LINEITEM_CREATIVE_SIZES}}” “” }}`
Image of what the entire block looks like.
Unfortunately even if the "Creative Sizes" field is blank it will still pull in the bolded static text identifier. Please help! I've been trying different things for almost 4 hours now and I'm going insane!
I am building an Angular test preparation app (with Laravel 5.1 API). One of the requirements is to allow the user to print a certificate of achievement.
The client wants the person's name and credentials interpolated into the document (e.g., highlighted below). Here is a snapshot of the PDF template they sent:
The way I'm handling PDF viewing is simply by storing the file on S3 and giving them a link to that file.
Interpolating information into a PDF doc doesn't seem trivial and I haven't found much information on programmatically allowing this, but there are tools like DocHub, that allow you do edit while viewing the PDF.
I'm interested in learning:
is doing this programmatically trivial?
are there 3rd party tools I'm unaware of?
would I even be able to send this information along to the S3 link to interpolate in the first place?
Using PDF as a format for editing is usually a bad choice. If you have a form with fixed fields, then it's easy. Create a PDF template with an interactive form. In this form, based on AcroForm technology, you'll define fields with fixed coordinates, and a fixed size. You can then add content to these fields.
One major disadvantage with this approach is the lack of flexibility. Did you notice that I used the word "fixed" three times in the previous paragraph? If text doesn't fit the predefined field, you're out of luck. If the field is overdimensioned, you'll end up with plenty of white space. This approach is great if you can predict what the data will be like. A typical use case is a ticket or a voucher. For instance: the empty form is a really nice page, with only a couple of fields where an automated system can put a name, a date, a time, and a seat number.
This isn't the best approach for the example you show in your screen shot. The position of every line of text, every word, every character is known in advance. If you want to replace a short word with a long word (or vice-versa), then all those positions (of each line, of the complete page, possibly of the complete document) need to be recalculated. That's madness. Only people with very poor design skills come up with such an idea.
A better idea, is to store the template as HTML. See for instance chapter 5 of iText's pdfHTML tutorial, where we have this snippet of HTML:
<html>
<head>
<title>Invitation to SXSW 2018</title>
</head>
<body>
<u><b>Re: Invitation</b></u>
<br>
<p>Dear <name>SXSW visitor</name>,
we hope you had a great SXSW film festival experience last year.
And we would like to invite you to the next edition of SXSW Film
that takes place from March 9 until March 17, 2018.</p>
<p>Sincerely,<br>
The SXSW crew<br>
<date>August 4, 2017</date></p>
</body>
</html>
Actually, it's not really HTML, because the <name> tag and the <date> tag don't exist in HTML. All HTML processors (browsers as well as pdfHTML) ignore those tags and treat their content as if the tag was a <span>:
It doesn't make much sense to have such tags in the context of pure HTML, but it does make a lot of sense in the case of pdfHTML. With pdfHTMLL, you can configure custom tags, and have a result that looks like the PDFs shown below:
Look at the document for "John Doe" and compare it with the document for "Bruno Lowagie". The name "John Doe" is much shorter than my name, hence more words fit on that first line. The text flows nicely (we could also have chosen to justify the text on both sides). This "flow" is impossible to achieve with your approach, because you will never get a PDF template to reflow nicely.
OK, I get it, you probably say, but what about the practical aspects? You talk about a Java / .Net library, but I am working with Laravel and Angular.js. First, let me tell you that I don't think you'll find any good PDF tools for Laravel or Angular.js, because of the nature of PDF and those development environments (in my opinion, those technologies don't play well together). Regardless of my opinion, this shouldn't be much of a problem for you because you work in an Amazon environment. AWS supports Java, and the Java code needed to get pdfHTML working is minimal. Most of the code samples I wrote for the pdfHTML tutorial are shorter than 15 lines. So why not try Java and pdfHTML?
If you're already using Amazon services, why not use an amazon lambda function, in combination with iText7 (java), to generate the pdf on demand?
That way, you are guaranteed that the pdf is correct, and has nice layout every time.
Generating the pdf can either be done by:
converting HTML,
programmatically creating your entire document,
filling and flattening an XFA form.
I think for your use-case, either option 1 or 2 are the most sustainable.
I've a taxonomy menu block. I want to show it in a Node/content. I googling and tried
http://www.ostraining.com/blog/drupal/placing-a-drupal-block-inside-a-node/
but not working for me. How can I do?
Can you explain the "Not working" status? Mean there is no block shown or there is an error?
If you have access to the php code text format (admin/config/content/formats) you can put the block using php code. See example here:
https://snipt.net/ivan747/add-block-to-node/
If you are using Display Suite you can create a Block Field and display it anywhere in your content as a field.
Take a look at this screencast by Kristof De Jaeger:
http://www.youtube.com/watch?v=mvFP16PJt4c
I have a form which accepts varchar2(5000). It is basically a description field. Now when users enter spces after paragraphs, they are all combined into on paragraph, and not multiple as it is entered.
Why? Ex - This is one paragraph.
This is another paragraph.
Here is what is happening -
This is one paragraph.This is another paragraph.
Are you displaying this data on a webpage or via HTML in some way? If so, then white-space is not handled in a straightforward fashion and that might be causing confusion.
Update - it appears that this is being displayed on a webpage.
You need to do one of several things:
Display your text inside a <pre> element on your page
OR
Replace carriage returns in your text with <br/> chars before sending to the webpage
(You might also need to do something with spaces too, if you need to have multiple of them displayed accurately).
This is nothing to do with databases and only to do with how HTML is displayed.
Have a look at this answer Rendering Plaintext as HTML maintaining whitespace – without <pre>
I have a report that needs different header text on pages depending on the content of the page. Is there a way change the text in the header based on a piece of information on a page?
Page 1 header: ITINERARY
Page 2 header: ITINERARY
Page 3 header: FARE RULES
Page 4 header: RECEIPT
The other issue is that each section of information may be one or more pages long.
At the moment I've had to set out my report spacing out the pages and putting a dummy header at the start of each section.
What is the best way to do this?
Melissa,
You might be able to dynamically render the header content by using the Expression part of the header. Your logic might go something like this:
If ReportItems!Textvalue = "this", do "that"
When I mean the Expression part, right click on the textbox (assuming that's what you're using in the header) and change the expression from there. You also might want to look at the IIF (Immediate If) function too.
For example:
Dim i As Integer = 0
IIf(i = 0, "I am zero", "I am not zero")
Hopefully that should get you in the right direction as I employed a similar situation with Reporting Services last year.
coson
Maybe you can find some info here: http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html (scroll down to see more header-related links)
Or is this what you are looking for? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252
What you could do is create each report section in its own separate report, then create a "Master" report that has all of the other reports as sub reports. Then all you'd have to do is put the headers on the master page.