Reportbuilder showing the same like WPF - wpf

So I'm programming and I want to show my first name and last name but i want my last name on a new line. Of course I use the function \n right after my first name. In WPF it shows it like how it should be shown:
first name
last name
If I now want to show this through a report with SSRS this will not work cause my report will show first name \n last name. Is there anyway that report builder will understand this function and give me the same representation like in WPF?

I don't think it will ever understand "\n". Instead of "\n", use "vbcrlf" - that sticks in a carriage return and drops the text to a new line.
You can just encase the field with your text with the below:
=Replace(Fields!<<fieldname>>.Value, "\n", vbcrlf)
Make sure the text is not set to interpret tags as HTML and you'll be fine.

Related

Place plaintext right beside variables (without whitespace) in VS Code User Snippets

I would like to create a User Snipper in VS Code that is a combination of variables and plaint text. This can typically be achieved by combining variables and plain text with a whitespace between then. But I would like to ad a variable next to a text without a whitespace.
For Example, I would like to create the current timestamp like this:
2022-02-19T21:02:24-0530
Below is what I tried
$CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATET$CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND-0530
Notice the T in between $CURRENT_DATE & $CURRENT_HOUR
OUTPUT:
2022-02-CURRENT_DATET21:06:12-0530
You can add $ symbol before the plain-text you want to add.
In this case, you need at add $T instead of T
$CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE$T$CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND-0530
Note that $T will get considered as a placeholder, and it will be the last item selected while tabbing through the inserted snippet.

If a line of text is separated into multiple text leaves in the accessibility tree, is it still accessible well?

Below is a picture of my current accessibility tree. You can see that the 4 text leaves in it are separated, but it still forms only one line of content. Is this still accessible well ("well" meaning screen readers can detect that they form one complete sentence), or should all of the text leaves be combined into one leaf?
If they should be combined, how can you concatenate variables into the text in React, while keeping it as one single leaf? This is my current code: <p>{cloudiness}% ({cloudinessDescription})</p>
How they are read aloud depends on the screen reader being used. VoiceOver reads it as one phrase, but that doesn't mean others will. Having it split up wouldn't be a nice experience, but it doesn't mean it's not accessible.
If you really want to make sure it's read as one phrase but don't like the noise of the template literal inside the JSX (I agree), why not define the string somewhere else until you are able to test on multiple screen readers?
const cloudinessSummary = `${cloudiness}% (${cloudinessDescription})`;
return <p>{cloudinessSummary}</p>;

Standard multiline textbox, would like every line bulleted automatically

I have a multi-line textbox in which I'd like every newline to also include a bullet character and a space before the next line of characters. Chr(149) AKA hex 95 looks good with the font I'm using. Further, the first line should have a bullet which appears automatically upon adding any text.
Basically, I want a textbox that's nothing but a list of bulleted items. I don't want to give the user the ability to italicize or anything else, so no Richtextbox.
I can handle this upon loading data into the textbox with a simple replace, but I'd like it to happen on-the-fly, while typing or while pasting from the clipboard, with bullets added automatically after every [Enter] keystroke or upon pasting text with linebreaks, and without the text cursor jumping around inappropriately.
Since I often see replies with "Why would you do this?" I'll explain: The user will use this textbox to enter a few brief points about a particular customer, such as "Gate code #1234" or "Customer doesn't like garlic." or "Make sure to mention her dog." It could be almost anything, and occasionally it's a few sentences, but each "point" (even if it's a paragraph) should stand out as visually distinct. I don't want a blank line eating up screenspace to separate paragraphs, but bullets will make each "entry" distinctively obvious as its own point. This is especially valuable when a given point ends near the right side of the textbox, so the next point doesn't appear to be part of the preceding point.
My code below "kinda starts to work" and it could be improved by placing the text cursor back where it was while typing (using Selstart) instead of jumping to the beginning, but I haven't gotten that far because it also creates issues when deleting the bullet, and when pasting or cutting. It could also be improved by adding a bullet before the first line. Those things are easy.
I'd like a simple "linebreak = linebreak and bullet" algorithm that works on the fly with cutting, pasting, typing, deleting and I suspect it already exists somewhere but I haven't found such code.
Or, if there's a simple way to give the textbox a "custom font" in which the linebreaks actually include a visible glyph that looks like a big dot, that would work too.
Thanks for reading my question.
Private Sub tbOfficeNotes_TextChanged(sender As Object, e As EventArgs) Handles tbOfficeNotes.TextChanged
Static MakingChanges As Boolean = False
If MakingChanges Then Exit Sub
Dim s As String = Replace(Replace(tbOfficeNotes.Text, vbCrLf, vbLf), vbCr, vbLf)
'The line above replaces any form of newline with LF only.
s = Replace(s, Chr(149) & " ", "")
MakingChanges = True
'Avoids a recursive loop as the next line would force this event to trigger from itself.
tbOfficeNotes.Text = Replace(s, vbLf, vbCrLf & Chr(149) & " ")
MakingChanges = False
End Sub

extJS didnt see too big text with many <br>'s

extJS didnt see too big text with many <\br>'s..
If i write text something like "lalal lalalal lsadsdhas afjhjhj";
Its okei, works.
If i write text with \n (<\br>) something like:
"hello,
my name
is Polly!";
ExtJS didnt see those lines. How i can avoid this?
Thank you!
This is because Javascript doesn't allow multi-line strings. If you want a linebreak in your string, it has to be coded with an escape sequence like '\r\n'. So,
alert("hello, \r\nmy name\r\nis Polly!");
will display as 3 lines. If the string is going into an html element, then insert '<br />' in place of the '\r\n'.
finally, if you need a long string with lots of blank spaces between the words, for some reason, you can either keep typing on the same line, or break it up into several lines and combine the lines with the '+' operator, like this:
var longstring =
'hello \r\n'
+'my name \r\n'
+'is Polly!';

Show progress bar when sending pages to the printer (WPF)

I am creating printouts in WPF using flow documents. These printouts are set in separate window where DocumentViewer is placed.
When user clicks print I would like to show a progress bar that informs about current page that is sending to the printer. How can I do this?
I'm not sure exactly where your print code is, or where you want the progress bar, but I did something similar to this recently. This will be in VB.net.
First of all, create a new progressbar in the same class as the code you use to send the page to the printer. Then, we're going to take advantage of the "top-down" order in a block of code to change the progress bar.
The progress bar's value should be set to "0" be default. Now, in the code for sending the page to the printer, you're going to increase the progressbar's value (such as with the code "MyProgressBar.Value = MyProgressBar.Value + 1"). Put this code in between each line of the code you want to show progress for.
I would change the "+ 1" part of the code, however, to another value, so your progress bar progresses equally after each step. If you have three lines of code, then use "+ 33" (100\3), four lines use "+ 25", etc.
Finally, at the end of the code, set "MyProgressBar.Value = 100"
This only works, however, if you have access to a code longer than one line. For one line of code, I'm not sure how this works, unless you can get to the block of code that line points to.
If you have to use code from another class, you may need to do something like...
Dim MyWindowWhereProgressIs As New MyWindowWhereProgressIs
And then, each time you need to change the value, try...
MyWindowWhereProgressIs.MyProgressBar.Value = MyWindowWhereProgressIs.MyProgressBar.Value + 1
I'm not entirely sure whether or not those last two lines of code will work, as I'm away from Visual Studio right now, but it is worth a shot.

Resources