I currently have a text box within a table that displays multiple stores based on user parameter input. The problem that I am experiencing that I would like to have a hanging indent that will force the store name to indent once it wraps to the next line (see screenshot).
Is this possible? I am aware that I could put the "Stores:" in it's own textbox, however this makes it difficult when it comes to lining up report items to prevent hidden/merged cells/columns during export to Excel.
The code that I am currently using in the text box is ="<b>" & Microsoft.VisualBasic.Interaction.iif(Parameters!StoreKey.Count > 1, "Stores: ", "Store: ") & "</b>" & Microsoft.VisualBasic.Strings.Join(Parameters!StoreKey.Label, ", ")
The Textbox property you're looking for is called HangingIndent. Try setting it to -10pt.
You could use a table, in the first column you put "Stores: ", in the second the string value, set the borders to none and finally play a little with the alignment (First column top-right alignment & Second column top-left alignment, its your choice) to make it look as if it was all in a single text box.
Related
Below code works perfect but the inputbox show’s text as "Wind" with auto selecting in the inputbox.
Is there any option to show without selecting... I mean the cursor should be last character of "Wind"
mycode...
Dim Prefex
Prefex = "Wind"
sNewComputerName = InputBox ("enter data here", "Computer Name", Prefex , 30,30)
If sNewComputerName = "" then
End If
To summarize comments:
InputBox is a very limited function, and doesn't have any possibility regarding the way it is selecting the default value.
so you need to press the right arrow before typing.
No other way around!
if you want nicer things, as #Rubik suggested, you can generate a proper InputBox with another language, you would be able to manage it. But that's a lot of work (rewrite your code!) for a minor disagreement!
What are you trying to do?
A user can take Wind out of the box and it will not be returned. If you want to make sure a user entered text the return value can be tested for "" or Wind.
if you want the " displayed
chr(34) & "Wind" & chr(34)
If you just want to prefix everything with Wind I would do that after the text was retuned
Is it possible?
I would like to place the following inside a textbox:
There are =Count("MyDataSet") records found.
But if I place that in the expression on the textbox it just displays as above instead of getting the value.
Now I know if I were to split the above in two different textbox works ok but for spacing reasons it would be better if I could just use one?
Is that possible?
You need an expression in the textbox that specifies the text strings and concatenates these to your count value, something like:
="There are " & CountRows("MyDataSet") & " records found"
I am writting to an excel file from my vb code. The code goes as below
xlsheet3 = xlBook.Sheets.Add(After:=xlSheet)
With xlsheet3
.Columns(5).NumberFormat = "#"
.Cells(j + 1, 5) = someStringValue 'Here "j" is a row counter and this line is in a "for loop"
end with
After writing to excel, most of the cells in excel are correct. But some of the cell's text comes as ####### however if I click on the cell, formula bar shows the correct result. I have tried giving single code before adding the text still that did not help.
Please help me in resolving this.
Thank you
There is not any issue with your code. You need to increase the width of the column or have to use word wrap. In excel if your value is not fully visible it shows it is "######".
If widening and wrapping text doesn't work and the format is set to text which allows display of only 255 characters, try changing the format to general.
This just indicates that the cell is too small for showing the result: make it wider.
See https://superuser.com/questions/65556/excel-displays-for-long-text-whats-wrong for some common reasons why Excel displays "######" in cells.
Either the cell is too narrow to display the contents or the contents are over 256 characters.
Check what you're writing to the cell. If it's not too long then all you need to do is resize the column to fit the new contents.
This is simply what Excel does when the data in a column is too wide to be displayed in the current column width. Make the column slightly wider and you will see all your data.
To autosize the column so it is wide enough to display all its data, double click the column divider at the right edge of the column, in the header bar.
I have 4 stacked textboxes in the body of an SSRS report and am getting a stray space / extra line between textboxes 3 & 4.
This is for an address block - name / title / email / website. Can't put it in a single textbox with intervening vbcrlf tokens because the email and website are links. I've tried formatting it to remove vertical spacing; also calculated the exact position by taking top + height to calculate the position. And of course I've tried positioning it so there are exactly 0 pixels between the text boxes. If I reverse the position of #3 & #4 the rendering looks the same so it isn't stray formatting characters in the data fields.
The solution is to wrap the stacked boxes in a rectangle.
I had this problem as well. It blew my mind until I started over on another part of the form. The new boxes worked perfectly until I moved them to the right of another set of text boxes which had some word wrap in them. I realized the wordwrapped boxes were directly related to the gaps I was seeing the set of textboxes to the right. I guess there's some kind of poor markup going on that tries to line things up horizontally and enclosing the set of textboxes in a rectangle protects them from it.
good idea on putting the info into a table - jumping off that idea - I'm going to construct a dynamic string in my query and output the dynamic string into a textbox. thank you for the idea, I don't know why I didn't think to do that.
Simpler thing is to just check text alignment - the default is "default" which appears to be centered. Changing the text box to the right to "left" fixed this problem for me.
Reduce padding property of the textbox.
Once dragging the textbox one closer to the other the tooltip shows convergence points between two textboxes - make tooltip show 0 points
it is best I could do to control the spacing
I'm putting together a template in Word, using a form for the user to fill in to then populate some of the document.
The bit I'm currently stuck on is at the end of the document, where the cc's are listed.
The form has a multiline text box into which the user puts in their cc's, one per line.
I then want to add to the end of the document the contents of the text box, but in the right format. Specifically, it should look like:
cc: First CC contact
Second CC contact
so on and so forth
I attempted to do this using 2 bookmarks, so my code currently is:
' If 'CC' box has content, add it
If doc_CC.TextLength > 0 Then
.Bookmarks("CC").Range.Text = vbCr + "cc:"
.Bookmarks("CCs").Range.Paragraphs.Indent
.Bookmarks("CCs").Range.Text = doc_CC + vbCr
End If
However, when this is run, on the page it looks like:
cc: first contact
second contact
and so on
Realise that the 2 bookmark method is a bit messy but it seemed like a good idea at the time - obviously this is not the case! Have done some searching for a way to do it with Split but am not making much progress down this path - suspect I'm googling for the wrong thing.
How do I do this so that the formatting is as desired? Any help is greatly appreciated.
Try inserting a tab character? + Chr(9) or even + vbTab may work.
Have found a work around which, while doesn't answer the actual question of how to do it, does produce a result to the same effect.
Have used a 2 column table without no lines instead with contents of a1 being "cc:" and contents of a2 being whatever was entered into the multiline text box. If there is nothing in the text box, then the table is deleted.
I'll keep on eye on this question though so if some one does have the proper answer I can mark it accordingly.
Another possibility would be to format the cc paragraph with a hanging indent (like is used for bullets or numbering). Use a newline character - Chr(11) - instead of vbcr to separate each entry. The text should all line up,then...