Display Checked Checkbox in PDF converted from reportviewer - reportviewer

I am displaying Checkboxes in report viewer using this line:
=IIf( Fields!Field1.Value, Chr(254), Chr(168))
But when I convert it in PDF, the checkboxes that are Checked are not displaying in the PDF.
Did anyone solve it?
I use Wingdings font because other fonts are not supported for example Wingdings2 after install app.
Thanks a lot.

Apparently this is a common problem and is being fixed in the next release.
Perhaps you could use √ (221A in Unicode Hex) as a workaround.
Source: https://connect.microsoft.com/SQLServer/feedback/details/431057/ssrs-2008-sp1-ctp-pdf-export-of-wingdings-characters-above-char-127-fails

I am using this piece of code to render to PDF from RDLC.
var bytes = reportViewer.LocalReport.Render(
_reportRenderFormat, _deviceInfo, out mimeType, out encoding, out filenameExtension,
out streamids, out warnings);
A sure way to get the checkboxes shown is to go to Placeholder properties in the textbox and select HTML- Interpret HTML tags as styles.
Then, for checked checkbox use this Expression:
="<font face=""Wingdings 2"" color=""green"">" & Chr(81) &"</font>" & "some other text"
For unchecked use this expression
="<font face=""Wingdings 2"" color=""red"">" & Chr(163) &"</font>" & "some other text"

Related

Wrong barcode exported from Visual Basic Macro in MS Word to PDF

I am trying to export through a Macro in MS Word a String that has 4 numbers. The whole Macro runs just fine, but, when I open the resulting PDF, I see that the barcode displayed seems corrupt.
This is the result:
In the Macro, I select the text I want to format, and change the font to "Free 3 of 9 Extended".
I have tried wrapping this number with "*" characters without success. Also tried "!". None of this seems to work. The funny part is that, if I open a Word document and type the same numbers using the same font, a clear Barcode is displayed:
This is what I see when writing directly in MS Word the same characters using the same font,this is what I see (which is what I want to achieve in the PDF export).
My macro exports to PDF with the following code:
Public Function guardar(id As String) As String
Dim path As String
guardar = id
obj_Word.ActiveDocument.ExportAsFixedFormat OutputFileName:=guardar,
OptimizeFor:=wdExportOptimizeForPrint, UseISO19005_1:=True,
IncludeDocProps:=True, KeepIRM:=True, ExportFormat:=wdExportFormatPDF
End Function
Is it possible that the template you are given is setting the font weight to bold in that portion of the document in which you are introducing the barcode, thus modifying the way it is displayed?
I cannot think of any other reason. The code you are posting does not seem to be the culprit.

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:

Vbcr, vbNewLine in resx file

I have placed large text in resx file. The text contains Vbcr, VbNewLine for formatting options. When i display the text in label, it don't get formatted. How i format the text. I am using visual studio 2005.
Set AutoSize to true and play with the MaximumSize property of the label.

Convert Crystal Reports Text Object/Text box to HTML?

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.

Displaying a Downward Triangle in VB.NET ▼ (U+25BC)

Hey, I'm trying to figure out how to display the ▼ character properly in a .NET winform application.
I am creating a custom control, and for the button, I want this character to appear. I am able to set the text to this character, but it appears as a blank square.
Any ideas on what I need to do to make this character appear properly on my forms?
I am using Arial font, which is compatible with this symbol.
EDIT: It is currently being set as follows:
btnCalendarToggle.Text = "▼" 'Yes, it appears exactly like this in my code
More information on the character can be found here:
http://www.fileformat.info/info/unicode/char/25bc/index.htm
EDIT2: I tried adding some other Unicode characters, and got the following message:
"Some Unicode Characters in this file
cannot be saved in the current
codepage. Do you want to resave this
file as Unicode in order to Maintain
your data?"
After clicking YES on this message, it still didn't work. It appears that the encoding method may be wrong for the file... I don't know what to set it to. Has anyone else tried to display this character in a winform before?
There can often be issues (both with source control systes and diff tools) if you embed more complex unicode characters in source files.
It is often better to do it via an explicit escape sequence and keep the source file in a simpler encoding.
btnCalendarToggle.Text = "\u25BC";
If this works it is likely that the problem is instead the encoding settings for the source file.
Are you certain however that the font in question is Arial (try debugging and checking) since regardless of the above mentioned issues so long as the encoding is set to a legitimate Unicode one (and Visual Studio will convert the file for you if you embed such a character in it) this should have worked.
Can you post the code you are currently using ?
You can print out characters using the chr(int) function if you know the character code.
Dim i As Integer
For i = 0 To 255
txtTest.Text = txtTest.Text & Chr(i) & " -- " & i.ToString() & Environment.NewLine
Next i
Try that and see if your character prints out.