Change selection after inserting xml text in Word Interop App - office-interop

I have a word addin that creates a list of fields that can be place in a word document. When you select a field either by drag and drop or doubleclick, it places that field on the document and an xml part is creaed inside the document. That works fine. What I want to do is move the selection position in word to be after the xml part that was just inserted. So if the field said "date created", I want to move the selection point to be the following line after "date created". Any ideas on how to do this? Thanks.

I am assuming you are using a range to insert the field?
if so you can collapse to the end of the range then add what you want.
Example:
// Move to the end
myRange.Collapse(Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseEnd);
// Now add something behind the table to prevent word from joining tables into one
myRange.InsertParagraphAfter();
//to move to the end again
myRange.Collapse(Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseEnd);

Related

Google sheets formula to fill a cell only if the content in another cell is matching a particular word

I have a sheet with raw data, let's call it "raw". I want to filter data based on the content in 1 cell and move the data in another sheet with a name "data". Basically, if one cell in the "raw" sheet says "yes" I want to move another cell's content to the "data" sheet.
Appreciate your help as I totally messed up :)
Try to include a demo sheet and the things you have tried to make it easier for people to help you.
=FILTER(raw!A1:G, raw!B1:B="yes")
This should work for what you want, change the B column to the column you have "yes" in and change the A1:G to the data you want to be returned.
or:
=QUERY(raw!A:B; "where B = 'yes'"; 0)

Add notes & footnotes to table

I have a report where I need to add a note/number where a record has data in a particular column. I then need to add a reference to that to the bottom of the table, much like a footnotes section you would see in a book.
I've tried adding the rownumber but it pulls in the actual rownumber and not the record count. I'm using oracle for my db.
In my report, if the record has a value for the column RETURN_NOTE (not shown), then concatenate an int tot he end of the TASK_NAME column. Then underneath the table, add the int from above with the RETURN_NOTE value.
You can see the red numbers and their description in the image below.
Thanks
The best way to go here is when you add a calculated field to your dataset where you put your footnotes into the expression. Lets assume your footnotes depend on the Fields!Task.Value and lets call this calculated field Footnotes:
'Name: Footnotes
=Switch(Fields!Task.Value = "Prepare for Coordinator", 1, Fields!Task.Value = "Ready for Closeout", 2)
Now add another column to your tablix and put the field Fields!Footnotes.Value in this column.
Then add a rectangle or another tablix somewhere in your report (put in the values which explains the footnotes). Then go to the properties of this tablix/rectangle (pane on the right) and under Other > Bookmark write in a bookmark code (for example: FootnotesExplained).
Go back to your textbox with the Fields!Footnotes.Value in it and right click on this textbox and go to Text Box Properties > Action and check the Go to bookmark option and write below your bookmark code from before FootnotesExplained.
When you click now on one of the value in the column where the footnotes are the report will jump to the tablix/rectangle where your footnotes descriptions are.

How do I link two fields to the same table in ServiceNow?

Forgive my ignorance for the proper terminology, but let me try to explain what I want to happen.
I have two custom fields on the incident table/form. I have created a custom table with 2 columns. I have figured out how to reference the table in one of the fields, allowing me to search the entries. Now I want to link the field selection to the other field via the custom table I made. When I make a selection in field A, I want field B to populate with the other column on the same row Field A pulled from in the first place. How would I do that?
Sounds like you want what's commonly referred to as a "derived field" or a dot-walked field.
You have a reference field which stores the reference to the other table, and want a second field on the form that shows another field on that referenced table. You don't actually need to create a new element, you just need to add a dot-walked form element.
Once you have the reference field added, go to Personalize/Configure the form layout.
In the slushbucket of available fields, you'll notice that reference
fields show up in green text with a little [+] next to them.
Select your reference field and a little button will show up between the two
lists, just above the "Add" button
Click that button and the left-side available fields will show the fields available on that reference field's table.
From here, select that second field that you want to display on your form, and bring it over to the right side where you want it.

how to fill another text item

I am very new in oracle forms so my mind is very very confused. I have 2 text items in the begining and at the end of the form i have multi text item like grid view. When i push the button the system should get and add the information to the grid view but my programme is working like that. it gets the information and add the information in the first place of the grid view, when i add second information it deletes the first row and add it in the first place. it should keep the last situation.
If for example BLOCK_NAME is your multi text item, TEXT_ITEM1 is your first text item and TEXT_ITEM2 is your second text item, you can write the following code in when-button_pressed:
go_block('BLOCK_NAME');
first_record;
:BLOCK_NAME.COLUMN1 := :TEXT_ITEM1 + :BLOCK_NAME.COLUMN1;
last_record;
:BLOCK_NAME.COLUMN1 := :TEXT_ITEM2 + :BLOCK_NAME.COLUMN1;
commit;
good for two items only
if the items are more then 2 then better user these command with in loop
and use next_record instead of last record
and check for :system.last_record true
if true then exit
else
continue working

How do I change the top value name in a text box on a Cognos Report?

The default value for the first item in a drop down list is the name of the database field. I need to change it to a more user friendly name. How do I change the value?
add a HTML Item onto the prompt page and add the following as an HTML item:
Example:
<script>
document.formWarpRequest._oLstChoicesMyList[0].text = '--SELECT A CITY--';
</script>
Replace 'MyList' with the name of the component.
from: link text
In Cognos 10, you can specify prompt text of your choice in Report Studio.
Select the value prompt
In Properties pane, under 'Prompt Text' section, the 'Header Text' property will be set to Automatic. Click the ellipsis button next to it and Header Text Dialogue opens.
Select 'Specified Text' choice. Click ellipsis.
Provide the text of your choice and click ok.
Run the report and you will see text that you provided will appear as first item in the drop down list.
I have provided a Screen shot for a better understanding.
You have a couple of options. First, you can rename the data item's name from database field name to a more friendly name in the Framework Manager metadata.
Second, you can rename the item in Report Studio. However, if you do this you will notice that it is still using the database name. You actually need to perform a calculation in the item expression for it to use your name instead of the default name. So say you are pulling in the string field [Namespace].[Unfriendly Name] and you named your report data item "Friendly Name." The top selection will still read "Unfriendly Name." However, if you replace the data item with the following:
[Namespace].[Unfriendly Name] || ''
It will see that there is a calculation involved and use your friendly name. In the case of a number field you have to add zero instead of concatenating ''.
This is also the case with report column headers (which you can replace with text instead of using this calculation method).
Convoluted? Yes.
Within the dataitem in the query.. you could do a ..
IF ( [dataitemA] = 'some text' ) THEN
( 'new text' )
ELSE
( [dataitemA] )
i try to avoid using javascript and html items becuase they dont generally work in pdf or excel outputs.
just a thought..
cheers!

Resources