For one I ran across, You can't have a '&' in your data.
In this text field on my PO, in the text field the user had typed "type 1 & 2 items"
that barfed when printing:
I can imagine using a REPLACE_PATTERN on the field before printing, BUT if its ALREADY html, then its going to be loaded with &s;
any URL with query parms will have a valid "&" inside the html.
Or consider a non-breaking space: (this could easily be inserted by someone when they are creating their verbage in the HTML editor)
How do we replace "Bob & Ted", or "Bob &Ted" and get "Bob & Ted"
and yet NOT transform or any number of other valid escaped thingies.
OK, so moving on, I just removed the 2 instances of "&" and got past that error.
We all know how much of a pain it is to build a string with embedded quotes.
Cleaner now with SQ() and DQ(), but it was doable before using SystemSettings.DQ
I usually get away with NOT putting double quotes around the style="color:red" types of html. Browser seems to parse it just fine. And since it was a lot of work to clutter the expression with SystemSettings.DQ, since it worked, I skipped it. But not in the HTLM Report now. Thats thing will complain.
I designed it using "class", but it ignores it. A lot more effort for inline styles. I just haven't removed the class descriptors.
And I wanted the option to format each element in the future, which is why they all got a class originally.
I'm building this string and had to add all the quotes tonight to get it working (although poorly).
HTML in a PDF Report
AND the parser in the new library is picky as hell
Last edited by Jaymer on Wed Apr 03, 2024 4:02 am, edited 2 times in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
STILL CANNOT DO MY ORIGINAL REQUIREMENT
because of the poor bitmapped fonts, I can't fit all my text in.
1st is 10 point, and then 8 to help it fit - but then not readable.
1st is 10 point, and then 8 to help it fit - but then not readable.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Why do it this way
Imagine having a floor plan of a building.
I have 42 offices.
I'm trying to put 11 pieces of into into each office slot.
Rather than having 462 fields on the report, I have 42.
I'm building a string of data for each slot.
This works now and is nice and readable. But I want to color some lines.
Not even sure how the report writer would handle 500 fields?
What if I need to add another piece of data to a slot? ... add another 42 fields and move everything around - OMG
With as finicky as selecting fields is in the RW I'd go crazy trying to do this.
Smart thing (I thought) was to test the 42 fields and building the file.
Easy. As well as building the 'plain text' string for the slots - although its not pretty.
Then to build the text in HTML is now where its broke down due to the visibility issues.
A loop build everything so changing the formatting is simple... but the whole thing is in jeopardy because of this HTML issue.
I also had planned to have HTML code to put a number in each slot - for easier viewing - like a "badge" format in the upper right. Again, what a pain to add another 42 fields inside the RW - whereas its just 1 more line in the HTML string.
I have 42 offices.
I'm trying to put 11 pieces of into into each office slot.
Rather than having 462 fields on the report, I have 42.
I'm building a string of data for each slot.
This works now and is nice and readable. But I want to color some lines.
Not even sure how the report writer would handle 500 fields?
What if I need to add another piece of data to a slot? ... add another 42 fields and move everything around - OMG
With as finicky as selecting fields is in the RW I'd go crazy trying to do this.
Smart thing (I thought) was to test the 42 fields and building the file.
Easy. As well as building the 'plain text' string for the slots - although its not pretty.
Then to build the text in HTML is now where its broke down due to the visibility issues.
A loop build everything so changing the formatting is simple... but the whole thing is in jeopardy because of this HTML issue.
I also had planned to have HTML code to put a number in each slot - for easier viewing - like a "badge" format in the upper right. Again, what a pain to add another 42 fields inside the RW - whereas its just 1 more line in the HTML string.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 2413
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: HTML in a PDF Report
That's disappointing.
I needed a solution in V8.8 so ended up displaying conditional images
I needed a solution in V8.8 so ended up displaying conditional images
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
![Image](http://imageshack.com/a/img922/5940/UmAdK9.png)
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
![Image](http://imageshack.com/a/img922/5940/UmAdK9.png)
Re: HTML in a PDF Report
MORE DISAPPOINTMENT
If you have a report field with the 'html' or html added (it actually doesn't matter if you use the quotes),
AND THE FIELD IS NULL (ie. UNDEFINED in Aware),
you'll get this runtime error and the report fails and will not execute.
In my case, I'm not even printing it - I added a switch to allow the user to use Plain Text vs. HTML (since the HTML is not respecting fonts and comes out ugly). I ATTACHED CONDITIONS in the report to print one or the other.
So I have TWO comment fields - a Plain Text and another Plain Text/HTML.
If they only enter into the Plain, then the HTML is UNDEFINED. And it won't print.
(of course, I'm handling it with a Rule - but I shouldn't have to. this new HTML Report library is a stinker.)
If you have a report field with the 'html' or html added (it actually doesn't matter if you use the quotes),
AND THE FIELD IS NULL (ie. UNDEFINED in Aware),
you'll get this runtime error and the report fails and will not execute.
In my case, I'm not even printing it - I added a switch to allow the user to use Plain Text vs. HTML (since the HTML is not respecting fonts and comes out ugly). I ATTACHED CONDITIONS in the report to print one or the other.
So I have TWO comment fields - a Plain Text and another Plain Text/HTML.
If they only enter into the Plain, then the HTML is UNDEFINED. And it won't print.
(of course, I'm handling it with a Rule - but I shouldn't have to. this new HTML Report library is a stinker.)
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: HTML in a PDF Report
OK, well this rule won't work:
If POInstall.Comment_HTML IS UNDEFINED Then
POInstall.Comment_HTML = ' '
Because then technically the HTML field STILL doesn't have anything in it and then you get this error: Of course, now you start putting data in fields that should be empty and other tests MAY fail (like checking for UNDEFINED).
I have to put a '.' (a period) in the field thats not going to print anyway just to get past the new Report Library issues.
If POInstall.Comment_HTML IS UNDEFINED Then
POInstall.Comment_HTML = ' '
Because then technically the HTML field STILL doesn't have anything in it and then you get this error: Of course, now you start putting data in fields that should be empty and other tests MAY fail (like checking for UNDEFINED).
I have to put a '.' (a period) in the field thats not going to print anyway just to get past the new Report Library issues.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL