HTML Tags and PDF Output

Stimulsoft Reports.PHP discussion
Post Reply
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

HTML Tags and PDF Output

Post by plantant »

I'm finding that the layout breaks when I output a PDF that has data fields with the HTML tags feature turned on. So right now, im outputting the address like this:

My Code:
{Supplier_Info.address1}{IIF(Supplier_Info.address2 + " " == " ", "", "")}{Supplier_Info.address2}
{Supplier_Info.city}, {Supplier_Info.state_ab} {Supplier_Info.companyzip}

Which is basically this:
address1
address2
city, state, zip

The after address1 is conditional based on if address 2 has data.

If PDFs do not support this feature, how can I add a conditional line break and achieve the same output that will carry over to a PDF?

On a side note, the only way I could see if the database field was an empty string, was to do it like this: {IIF(Supplier_Info.address2 + " " == " ", "", "")}. I had to add a space to it, and see if it is a space. Is there a cleaner way? I tried comparing it to an empty string and null.

Thanks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

HTML Tags and PDF Output

Post by Vladimir »

Hello,

If the AllowHtmlTags property of the text component is set to true, then, when exporting to PDF, HTML tags will be considered. We have checked an export of a report with the text you specified using the tag. Everything works properly.

Thank you.
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

HTML Tags and PDF Output

Post by plantant »

Thanks for your quick reply. You're right, the new version is outputting the formatted text as an image it the PDF. The issue I'm still having with this method is that the text comes with a white background so if i'm using it on an odd colored row, it has white. Is there another non HTML way to add a line break so that text is output to the PDF?

Thanks
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

HTML Tags and PDF Output

Post by plantant »

Hi Vladamir, I've solved my issue. Instead of using a and using the AllowHtmlTags property, I just hit the enter key in between my quotes and it works.

Example:
{Supplier_Info.address1}{IIF(Supplier_Info.address2 + " " == " ", "", "
")}{Supplier_Info.address2}
{Supplier_Info.city}, {Supplier_Info.state_ab} {Supplier_Info.companyzip}

So at the end of the first line, there is an enter, and the code continues to the second line. Now when I output a PDF, the break is there and it is text instead of an image.

Thanks again,

Danny
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

HTML Tags and PDF Output

Post by Vladimir »

Hello,

Unfortunately, on the current moment, HTML text is exported to PDF as an image. Your solution is acceptable, you can use it in this case.

Thank you.
Post Reply