When there were long string in the list showing in front end, we'd like to truncate it and end with "...".
Like:
"A list"
"item 1"
"item too looooooooooooooooooooooooong" => "item too loo..."
"item 2"
When QA trying to automate this feature, it seems it is not possible to get the truncated string with ellipsis(""item too loo..."").
The html innerText is showing the full string rather than with ellipsis
How could we get the truncated string with ellipsis so we could verify it in the automation test?
Thanks for any suggestions.
The example in codesandbox
Related
Basically, I go to "Layout" > "Page Setup" > "Margins" > "Custom Margins" then selected the "Orientation" as "Landscape" then "Apply to:" > "This point forward", this changes the orientation of the pages for the rest of the document from where the blinking cursor sits, then I repeat the process with the cursor on the next page but choose the "Orientation" to "Portrait". This is how I make a specific page in a word document landscape. When this happens it sections that landscape page as "Section 2" and the pages after that "Section 3". The problem comes with the header and footer, in each section the header and footer is different. This is especially problematic with page numbers, as each new section starts as its own thing and says it is page one at the start of that section.
I have tried "Header & Footer" > "Navigation section" > "Link to previous" for "Section 2" to "Section 1", this would not display any information at all from "Section 1" to "Section 2". For some reason when I did the same for "Section 3" to "Section 2", "Section 3" would display the information of "Section 2", this does not solve the page numbering issue though because "Section 3" starts off as page 1. So it is weird to me how the "Link to previous" feature worked only on "Section 3" and not "Section 2".
If anyone has any method of fixing this I would be grateful :D, I will also be grateful for any dodgy ways of getting around it but I will not mark it as an answer.
I would add this as a comment but am new and not allowed to comment.
This would be better handled on the Microsoft Answers site as it about general Word features rather than programming.
That said, what happened was when you created a new section, likely before you did the orientation shift, you told Word to restart numbering at 1. Word took that as the way to start new sections. You can manually go to each new section and use the format page number dialog to tell word to continue from previous.
It sounds as if you may also have "different first page" set. This is a setting that continues into new sections as well. Header/footer settings with multiple sections and their interactions get complex. It is summarized here: Header/Footer Settings Recap.
You can download an Add-In from my site that will do this for you. Continuous Page Numbers Add-In. That uses a macro to do this.
Sub ContinuousPageNumbersMacro()
'
' ContinuousPageNumbersMacro Macro
' This macro makes page numbering continuous througout document. This is for multisection documents where it may be hard to find page breaks and figure out page numbering changes.
'
' Jay Freedman
' http://answers.microsoft.com/en-us/office/forum/office_2007-word/page-numbers-are-all-fouled-up-in-my-large/d188687e-9663-43e0-a450-1dbadc47f09f
' Can be used as straight macro or attached to keyboard shortcut
' modified to preserve track changes status - idea from Graham Mayor 25 Oct 2017
'
Dim secNum As Long
Dim btnCancel ' give user chance to cancel
Dim bTrackChanges As Boolean
Dim strVersion As String
strVersion = ThisDocument.CustomDocumentProperties("Version").Value
btnCancel = MsgBox(prompt:="Do you want to reset all of the page numbers in this document to number continuously?", _
Title:="Continuous Page Numbering Version " & strVersion & " Are you sure?", _
Buttons:=vbYesNo)
If btnCancel = vbNo Then
MsgBox prompt:="Reset of continuous page numbering cancelled by user!", Buttons:=vbExclamation, Title:="Page Number Reset Cancelled!"
Exit Sub
End If
' Proceed with reset
bTrackChanges = ActiveDocument.TrackRevisions 'Graham Mayor
ActiveDocument.TrackRevisions = False ' Graham Mayor
With ActiveDocument
For secNum = 2 To .Sections.Count
.Sections(secNum).Headers(wdHeaderFooterPrimary) _
.PageNumbers.RestartNumberingAtSection = False
Next
End With
ActiveDocument.TrackRevisions = bTrackChanges 'Graham Mayor
MsgBox prompt:="The Continuous Page Numbers macro has run.", Title:="Page number reset macro finished!"
End Sub
I have an Access database (Screenshot is attached) in which the text of an editor is stored line by line in the DB (called StoryLine column). I have the problem that URLs are stored as hypertext "URL" display names. Sometimes only hyperlinks are displayed in one line and the "URL" goes over several lines and then the display name is displayed.
Thank you very much for your help and hints.
I have merged all entries (with Formula) that are assigned to the same entry (all connected texts have the same StoryID). The problem is that the formatting is completely lost.
Only the display text of the URL should be displayed, if it exists, otherwise the complete URL.
HYPERLINK "http://votetandem.org" votetandem.org
should be
voteandem.org (formatted as Hyperlink)
and
HYPERLINK enter link description here
Acquista ora i
biglietti!
should be
Acquista ora i biglietti! (formatted as Hyperlink)
If I understand your question correctly, the below should work for you;
Create a Formula and type the desired text and hyperlink using the HTML tag like:
Insert the Formula Field on the report. Right click on the "Formula Field" inserted on the report, and select "Format Field"
In the "Format Editor" window, select the tab "Paragraph". For the option "Text Interpretation", select "HTML Text"
Note that the SAP Hyperlink text displayed above is the actual hyperlink and selectable by the user. In your case, it may be a matter of just doing option 3 from above on the required fields. I don't know your current structure of the report to give you an exact answer.
Concat Strings
Create a formula with something as such. I haven't tested this so it may need some tweaking.
if {Command_Main.StoryLinesK} in ['45','46','47', '48',''49] then {Command_Main.StoryLine} & "" & {Command_Main.StoryLine}
Please excuse the stupid question, but I am an absolute freshman in Crystal Reports.
I would like to add a plaintext to Crystal Reports. The problem is, if a hyperlink has been inserted that contains a display text, it will be displayed as follows:
HYPERLINK "http://google.de/https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD " google.com
I just want the hyperlink to be displayed within "
The result should be https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD
However, it is also possible that "hyperlinks" that do not contain a hyperlink may occur.
My professor has created an Access database that contains texts and hyperlinks and I have to display the hyperlinks correctly.
Some lines of the database:
HYPERLINK "http://votetandem.org/" votetandem.org
HYPERLINK "https://app.votetandem.org/"votetandem.org
Sometimes there is a space between "URL" display text and sometimes not
Use the REPLACE() function. Hit F1 for online help.
I found a solution for my problem. I created a formular field. chr(34) is " in ASCII
If InStr({TABLE},"HYPERLINK " & chr(34)) > 0 Then
Split({TABLE},chr(34))[2]
else
{TABLE}
the URL is the second entry. The first is Hyperlink, second real URL and the third the displayed name.
I have an SSRS report that has Spanish and English text boxes. If the dataset row is a Spanish speaking person, an expression in each Spanish textbox shows that and hides the English textbox. These textboxes are exactly placed over each other.
My boss wants me to use SSRS to generate an Excel spreadsheet from the dataset(this is not hard) and use Word template for a mail merge. However, I am having trouble trying to figure out if I can hide all English when row is a Spanish row and vice versa. These are health clients of Spanish and English nationality.
I can do mail merges attached to a Recordset, I can do one in English, one in Spanish. I am trying to avoid this and have it all in one Mail Merge.
Areas marked in red will change to Spanish translation and/or date format. The dates are a no-brainer I can use a conditional IIF, however the formatted body I have no solution for, based on value in Field "CL_Language" which is either "Spanish" or "English".
====================================
The merge fields for dates and greeting are easy. There is no merge field for the text. And yes, only option might be for 2 separate reports with different Recordsets.
It's not clear what the actual issue is but...
Instead of hiding textboxes, which could cause problems when exporting etc., why not set a single textbox to the correct language text using an expression?
Something along the lines of
=IIF(Fields!Language.Value = "English", Fields!MyEnglishText.Value, FieldsMySpanishText.Value)
I found a solution. But it could be very difficult for the client to create. It involves hitting Ctrl + F9 which will create curly brackets {}.
Inside those curly brackets an IF statement is placed and I just pasted the whole Spanish formatted body in the true area, and the whole English body in the false area.
{IF "CL_Language" = "Spanish" "spanish body text here" "english body text here"}
Very strange syntax and you need to right click on the area to see choices like "Toggle Field Codes" (IF statement get's hidden), "Edit Field", and "Update Field". With Edit Field and Update Field you get a popup with the fields in your recordset.
If you saw the examples in my question, you can see that is some big clunky text AND . . .inside of it is a merge field that works! The Excel recordset comes already with the month name in correct language for each row.
Since it is not smart to include links that might expire, I am including the Google text I used to find this solution. Then I took a chance on a huge formatted chunk of text with a merge field inside of it.
Google this: "If Merge Field then"
Now is this a viable solution for the client versus just having a Word template for each language?
I think this is too difficult and I even duck when running it. Also, once it's working, if I look at the toggled code, the Conditional field no longer says the field name, but the value in the field, go figure.
{IF "Spanish" = "Spanish" or {IF "English" = "Spanish" instead of {IF "CL_Language" = "Spanish" or {IF "CL_Language" = "English"
Here is how to access the fields using right click. (remember, your curly brackets HAVE to be created with Control + F9).
"Heading 2" style in French is "Titre 2": how to get "Titre 2" knowing "Heading 2" ?
I searched on Google and found this
https://msdn.microsoft.com/en-us/vba/word-vba/articles/style-namelocal-property-word
Unfortunately that's not what I want.
When working with the built-in styles always use the enumeration. The code below will print the localized name of Heading 2 to the Immediate window.
Debug.Print ActiveDocument.Styles(wdStyleHeading2).NameLocal
https://msdn.microsoft.com/en-us/vba/word-vba/articles/wdbuiltinstyle-enumeration-word
Also, when your document is going international, and you are using chapter names in the header or footer, don't use
{ StyleRef "Heading 1" }
because when the document is shown in a German MS Word, it wouldn't understand "Heading" but expect "Überschrift" instead.
However, there's an international version, too. Just use
{ StyleRef 1 }
without quotes around the heading number.
You can't reference "Titre 2" as "Heading 2". Instead, see 'WdBuiltinStyle Enumeration'. Knowing these constants for the most part means you don't need to know the local names and, when you do, you can retrieve them via .NameLocal.
See also 'WdListNumberStyle Enumeration', 'WdCaptionNumberStyle Enumeration', 'WdNoteNumberStyle Enumeration', 'WdApplyQuickStyleSets Enumeration', and 'WdStyleType Enumeration' in the Word VBA help file.