Convert Crystal Reports Text Object/Text box to HTML? - sql

I want to convert the text from Crystal reports to HTML and so far I have noticed that if I simply add a text field, I am able to change it to HTML by formatting text option and then under Paragraph tab there is an option to change the text interpretation. The problem is that I have entered text box to enter some hard coded information along with the database driven field, so I would like to know if there is a way I can convert the text box data into HTML. I am currently using crystal reports XI and want going forward want to upload these reports in a website using visual studio 2010. Thank you for your help.

It appears that the 'Text Interpretation' is ONLY a property of these fields:
Database
Formula
Parameter
Group Name
I wasn't able to get the Text Object to act as HTML.
However, you could create a formula with static HTML text:
"<strong>this is bold text</strong>"
Or a formula that combines text w/ data:
"<pre>" + {table.html_field} + "</pre>"
You could also use a string parameter to display user-supplied, HTML text.

Related

Libre Office Labels don't show up as "AcroFields" in iTextSharp?

so I've been trying to generate a report. I've tried quite a few things already but there always seems to be problems. I'm currently trying iTextSharp 4.1.6.
My current strategy is to use LibreOffice to create a document with editable pdf fields, or I guess they are called "AcroFields". I'm not sure since I can't find a definition. But anyways, I assume that all of these are "AcroFields":
But if I put all of those into a form and export as pdf only some of them show up as AcroFields:
var reader = new PdfReader(File.ReadAllBytes("abc.pdf"));
foreach(var field in reader.AcroFields.Fields)
{
Console.WriteLine(((DictionaryEntry)field).Key);
}
> Text Box 1
Check Box 1
Numeric Field 1
Formatted Field 1
Date Field 1
List Box 1
Combo Box 1
Push Button 1
Option Button 1
Notice how Label Field 1 is not present. If it were present then doing a text replace might be easy. Except it's not present so it's looking like even iText can't do a simple text replace in a pdf. Is this true? How would you replace text in a pdf document using iTextSharp?
Notice how Label Field 1 is not present.
As there is no AcroForm form field type "label", form labels usually are drawn as regular page content in PDF files.
If it were present then doing a text replace might be easy. Except it's not present so it's looking like even iText can't do a simple text replace in a pdf. Is this true?
Indeed, in general there is no simple text replacement in a PDF.
How would you replace text in a pdf document using iTextSharp?
I would determine the bounding box coordinates of the text to replace using the iText text extraction feature with some extension that returns text plus coordinates. Then I'd remove that text by redaction using iText's PdfCleanUp... classes. Finally I'd add the replacement text as new text in the bounding box determined at start.
Unfortunately for you, both good text extraction and redaction are not present in your version 4.1.6; for this approach you should update at least to 5.5.x.
Alternatively, though, as you've been trying to generate a report, I assume the template design is in your hands. In that case you can put your labels into read-only text fields which you can change (they are read-only only to GUI users).

HTML Formatting tossing #error

I am attempting to format an expression in SSRS with an HTML code and am getting #Error tossed upon report preview. My expression looks as follows:
="<b>Region: </b>" + Fields!RegionID.Value
I have also ensured that HTML - Interpret HTML tags as styles has been selected under Placeholder Properties. Has anyone experienced this behavior before?
Thanks!
In SSRS 2008 and above, you can use placeholders to achieve this.
See Formatting Text and Placeholders for more details.
To give a quick example, in a textbox, enter some text then right click on the empty space to the right of the text:
You can set the placeholder properties to display your required field in the Value property:
You now have two distinct text parts in the textbox that can be formatted independently, e.g. one bold and one normal:

vb parse word from clipboard into html

I want to copy some word text with tables, links and images and paste it into a rich textbox in my vb project. Where I want to parse it to html.
The Questenion is, how can access the copied word in the clipboard. Using
My.Computer.Clipboard.GetText()
just returns text, without the structure for links, tables or images. But there have to be a way to access it, because my rich textbox seems to know the word format. When I paste it into it, tables, images and links are also displayed in there.
You can try to specify text format in GetText's parameter as follow :
Dim htmlText As String = Clipboard.GetText(TextDataFormat.Html)

Interpreting HTML Tags in RDLC

How can i interpret html tags like anchor tag and table in RDLC report. Is it really possible?
Or only text decorating styles tags are allowed in RDLC?
Yes, it is possible in VS 2010. Here's a related question, and the pertinent MSDN doc.
Basically, in the data section, click first to highlight the cell, then right click and the menu will contain a section with "Placeholder Properties". Then under General, there's a field "Markup Type" which you can set it to "HTML - Interpret HTML tags as styles"
VS 2005 and VS 2008 rdlc don't support any html formatting but I still found a way to format html tag in output as pdf file.
Instead of format, you can replace these special characters from output.
You can write an expression of any text box value which can be used as below:
=Replace(Replace(Replace(Replace(Fields!"your column name".Value,""",""""),"&","&"),"<","<"),">",">")
In above expression I have interpreted a few special characters, but you can add more or can keep less as per your requirement.

Text Object in Formula Editor (Crystal Report)

How can i get the text object so that i can use it in formula editor?
Text objects cannot be read or changed using the Formula Editor within Crystal Reports. If you want dynamic content that I would suggest using a Formula instead of a Text Object.
Rather bizarrely, you are able change a Text Object value at runtime using .NET
e.g.
rptObject.ReportDefinition.ReportObjects("Text1").Text = "Some dynamic content"