I'm new to SSRS and find the syntax very difficult as well as the awful expression text box that makes it very hard to see where i've made errors.
I want to do IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null, then only print IS02Chars.value, else print both IS02Chars and TaxNumber.Value.
=IFF (First(Fields!TaxNumber.Value, "InvoiceHeader") = null ,
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader"),
": " & First(Fields!ISO2Chars.Value, "InvoiceHeader") & First(Fields!TaxNumber.Value, "InvoiceHeader"))
I don't see how my syntax is any different to IIF(Fields!ExitReason.Value = 7, 1, 0)
=IIF(IsNothing(First(Fields!TaxNumber.Value, "InvoiceHeader")), ": "
& First(Fields!ISO2Chars.Value, "InvoiceHeader") , ": " &
First(Fields!ISO2Chars.Value, "InvoiceHeader") &
First(Fields!TaxNumber.Value, "InvoiceHeader" ) )
Related
I'm working with an api that excecutes an aws Insights query. I check some business layers and then add filters to the query.
Those filters are from a list of errors that I can't change.
The trouble is that I cant make an standard function to add the filters. Now I'm using
public CWL_InsightsQuery NotLike(string field, string value, int index = -1) {
if (index < 0) {
int Index = QSegments.FindIndex(x => x.StartsWith("filter"));
QSegments[Index] = QSegments[Index] + " and " + SetInternalField(field) + " not like /"" + value + "/" ";
} else {
QSegments[index] = QSegments[index] + " and " + SetInternalField(field) + " not like /"" + value + "/" ";
}
return this;
}
QSegments stands for the construction of the query.
In simple terms, I ended up with an string like
|filter Data not like "value here lol"
this IS working, and its fine. The trouble starts when value has quotation marks, or different special characters.
So, Value can be this "is a" very 'unique' value /and i hate it/
so, I cant use '', neither / or " to declare the filter string.
Is there any escape character, as # in C#?
Would need something in CloudWatch Log insights like
#"I love how ""this query"" works 'every' time /i/ need it"
Thank you very much!
How can I get the email addresses from PR_TRANSPORT_MESSAGE_HEADERS using VBA?
I have been trying some regular expressions but I never worked with it and I am having some problems.
I need to retrieve the email address from "To:" and "From:" and "CC:"
The macro below gets bigger every time I want to investigate a new mail item property. I add the new property or properties, comment out those I do not need today, select a few relevant emails and run the macro. I can then examine the desktop file “DemoExplorer.txt” at my leisure.
I have added all the “non-standard” properties that seem relevant to your requirement. Most seem duplicate of “standard properties”. The only one that seems useful is the “To:” line of PR_TRANSPORT_MESSAGE_HEADERS. The email addresses have been stripped out of the standard To property but they are present in the “To:” line.
Hope this helps.
Public Sub DemoExplorer()
' Outputs selected properties of selected emails to a file.
' ??????? No record of when originally coded
' 22Oct16 Output to desktop file rather than Immediate Window.
' Various New properties added as necessary
' Technique for locating desktop from answer by Kyle:
' http://stackoverflow.com/a/17551579/973283
' Source of PropertyAccessor information:
' https://www.slipstick.com/developer/read-mapi-properties-exposed-outlooks-object-model/
' Needs reference to Microsoft Scripting Runtime if "TextStream"
' and "FileSystemObject" are to be recognised
Dim AttachCount As Long
Dim AttachType As Long
Dim FileOut As TextStream
Dim Fso As FileSystemObject
Dim Exp As Outlook.Explorer
Dim InxA As Long
Dim InxR As Long
Dim ItemCrnt As MailItem
Dim NumSelected As Long
Dim Path As String
Dim PropAccess As Outlook.propertyAccessor
Path = CreateObject("WScript.Shell").SpecialFolders("Desktop")
Set Fso = CreateObject("Scripting.FileSystemObject")
Set FileOut = Fso.CreateTextFile(Path & "\DemoExplorer.txt", True)
Set Exp = Outlook.Application.ActiveExplorer
NumSelected = Exp.Selection.Count
If NumSelected = 0 Then
Debug.Print "No emails selected"
Else
For Each ItemCrnt In Exp.Selection
With ItemCrnt
FileOut.WriteLine "--------------------------"
FileOut.WriteLine "From (Sender): " & .Sender
FileOut.WriteLine "From (Sender name): " & .SenderName
FileOut.WriteLine "From (Sender email address): " & .SenderEmailAddress
FileOut.WriteLine "Subject: " & CStr(.Subject)
FileOut.WriteLine "Received: " & Format(.ReceivedTime, "dMMMyy h:mm:ss")
FileOut.WriteLine "To: " & .To
FileOut.WriteLine "CC: " & .CC
FileOut.WriteLine "Recipients: " & .Recipients(1)
For InxR = 2 To .Recipients.Count
FileOut.WriteLine Space(12) & .Recipients(InxR)
Next
'FileOut.WriteLine "Text: " & Replace(Replace(Replace(.Body, vbLf, "{lf}"), vbCr, "{cr}"), vbTab, "{tb}")
'FileOut.WriteLine "Html: " & Replace(Replace(Replace(.HtmlBody, vbLf, "{lf}"), vbCr, "{cr}"), vbTab, "{tb}")
'AttachCount = .Attachments.Count
'FileOut.WriteLine "Number of attachments: " & AttachCount
'For InxA = 1 To AttachCount
' AttachType = .Attachments(InxA).Type
' FileOut.WriteLine "Attachment " & InxA
' FileOut.Write " Attachment type: "
' Select Case AttachType
' Case olByValue
' FileOut.WriteLine "By value"
' Case olEmbeddeditem
' FileOut.WriteLine "Embedded item"
' Case olByReference
' FileOut.WriteLine "By reference"
' Case olOLE
' FileOut.WriteLine "OLE"
' Case Else
' FileOut.WriteLine "Unknown " & AttachType
' End Select
' ' I recall PathName giving an error for some types
' On Error Resume Next
' FileOut.WriteLine " Path: " & .Attachments(InxA).PathName
' On Error GoTo 0
' FileOut.WriteLine " File name: " & .Attachments(InxA).FileName
' FileOut.WriteLine " Display name: " & .Attachments(InxA).DisplayName
' ' I do not recall every seeing a parent but it is listed as a property
' ' but for some attachment types it gives an error
' On Error Resume Next
' FileOut.WriteLine " Parent: " & .Attachments(InxA).Parent
' On Error GoTo 0
' FileOut.WriteLine " Position: " & .Attachments(InxA).Position
'Next
Set PropAccess = .propertyAccessor
FileOut.WriteLine "PR_RECEIVED_BY_NAME: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0040001E")
FileOut.WriteLine "PR_SENT_REPRESENTING_NAME: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0042001E")
FileOut.WriteLine "PR_REPLY_RECIPIENT_NAMES: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0050001E")
FileOut.WriteLine "PR_SENT_REPRESENTING_EMAIL_ADDRESS: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0065001E")
FileOut.WriteLine "PR_RECEIVED_BY_EMAIL_ADDRESS: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0076001E")
FileOut.WriteLine "PR_TRANSPORT_MESSAGE_HEADERS:" & vbLf & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E")
FileOut.WriteLine "PR_SENDER_NAME: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0C1A001E")
FileOut.WriteLine "PR_SENDER_EMAIL_ADDRESS: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0C1F001E")
FileOut.WriteLine "PR_DISPLAY_BCC: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E02001E")
FileOut.WriteLine "PR_DISPLAY_CC: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E03001E")
FileOut.WriteLine "PR_DISPLAY_TO: " & _
PropAccess.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E04001E")
Set PropAccess = Nothing
End With
Next
End If
FileOut.Close
End Sub
I am using a for loop for getting data from the user in command prompt using python 2.7. Then storing the data in a text file in certain format. I am looking for a method to get the data from the user and store it in a list and use it where required.
for Input_Number in range(Number_Of_Inputs):
Input_Number = Input_Number+1
GUI_Parameter = str(raw_input("Please enter input parameter " + str(Input_Number) + " :"))
GUI_Parameter_Name = str(raw_input("Enter the GUI name for the parameter " + str(Input_Number) + " :"))
Store_GUI_Parameter(Opened_File, GUI_Parameter, GUI_Parameter_Name)
I would like to use this data to store it in a specific location in a text file according to required syntax. The above code stores the data in the text file. But the problem is it doesn't store it at the required place.
def Store_GUI_Parameter(Opened_File, GUI_Parameter, GUI_Parameter_Name):
GUI_Description = "| " + '"'+ GUI_Parameter_Name + '"' + " |$" + GUI_Parameter.title() + " |"
Write_Data(Opened_File, GUI_Description)
print "GUI parameters written to NDF file"
return
The data storage is done using the above function...
I tried this, but unfortunately this also is not working
GUI_Parameter= []
GUI_Parameter_Name = []
for Input_Number in range(Number_Of_Inputs):
Input_Number = Input_Number+1
GUI_Parameter[Input_Number] = str(raw_input("Please enter input parameter " + str(Input_Number) + " :"))
GUI_Parameter_Name[Input_Number] = str(raw_input("Enter the GUI name for the parameter " + str(Input_Number) + " :"))
Using it outside the loop in the same function...
GUI_Description(Opened_File, GUI_Parameter_Name[Input_Number], GUI_Parameter[Input_Number])
The function implementation:
def GUI_Description(Opened_File, GUI_Parameter_Name[Input_Number], GUI_Parameter[Input_Number]):
Iteration = 0
while Iteration < Input_Number:
Iteration += 1
GUI_Description = "| " + '"'+ GUI_Parameter_Name[Input_Number] + '"' + " |$" + GUI_Parameter[Input_Number].title() + " |"
Write_Data(Opened_File, GUI_Description)
print "GUI parameters written to NDF file"
return
But it shows syntax error at the def GUI_Description
C:\Users\padmanab\Desktop>python CtoN.py File "CtoN.py", line 173
def GUI_Description(Opened_File, GUI_Parameter_Name[Input_Number], GUI_Parameter[Input_Number]):
^ SyntaxError: invalid syntax
The syntax error in the function GUI_Description is caused by your input arguments. 'GUI_Parameter_Name[Input_Number]' is not a valid input argument. Since your function requires both 'GUI_Parameter_Name' and 'Input_Number' they should be separate input arguments. The code snippet below would solve this syntax error:
def GUI_Description(Opened_File, Input_Number, GUI_Parameter_Name, GUI_Parameter):
...
The code below will give an 'index out of range' error since the lists 'GUI_Parameter' and 'GUI_Parameter_Name' have zero length.
GUI_Parameter= []
GUI_Parameter_Name = []
Number_Of_Inputs = 1
for Input_Number in range(Number_Of_Inputs):
Input_Number = Input_Number+1
GUI_Parameter[Input_Number] = str(raw_input("Please enter input parameter " + str(Input_Number) + " :"))
GUI_Parameter_Name[Input_Number] = str(raw_input("Enter the GUI name for the parameter " + str(Input_Number) + " :"))
If you want to add items to the arrays you should append them:
GUI_Parameter.append(raw_input())
I try to find a specific String in a Text File.
The file looks like this:
2, 1, 'Ausbau der techn. Anlagen'
2, 2, 'Extension des installations techniques'
2, 3, 'Estensione delle istallazioni tecniche'
I try to find the text between the '' signs.
//Will be set automaticly after implementation.
int project = 2
int languageInteger = 1
String findings = new File(usedPath)?.eachLine {
it.substring((project+ ", " + languageInteger + ", "))
}
This doesn't work. I've also tried with FindAll Closure or find. But I make some mistakes.
What should I do to find the text?
I found a Solution.
It will not be the best, but it works.
new File(usedPath)?.eachLine {
if(it?.toString()?.startsWith(project+ ", " + languageInteger + ", ")){
findings = it?.toString()?.split(project+ ", " + languageInteger + ", ")?.getAt(1)
}
}
I have some C++ datatypes for which I would like to improve the debugging experience in my team. I therefore want to create a custom visualizer in the autoexp.dat file. The [AutoExpand] section doesn't seem sufficient, so I started to look at [Visualizer]. I found this website with some explanations, but is there any comprehensive reference/manual/tutorial? I don't get the difference between $c and $e, for example. I already succeeded in displaying some basic information, but I feel like there's so much more to know...
Do you know any good resource?
Thanks!
Appears this is already commented above but someone coming to this question would not necessarily read the comments and so might miss the great tutorial available on the boost site:
https://svn.boost.org/trac/boost/wiki/DebuggerVisualizers
Also
http://mariusbancila.ro/blog/2007/04/06/tweaking-autoexpdat-for-custom-types-in-vs2005/
http://www.idigitalhouse.com/Blog/?p=83
http://www.chromium.org/developers/how-tos/how-to-set-up-visual-studio-debugger-visualizers
http://www.virtualdub.org/blog/pivot/entry.php?id=172
Below is an example of visualizer for boost::tuple. It should be fairly easy to follow:
boost::tuples::tuple<*>{
; Show as (11, 22, 33, ... })
preview (
#(
"("
, $e.head
, ", "
, $e.tail.head
, ", "
, $e.tail.tail.head
, ", "
, $e.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.tail.tail.tail.tail.head
, ", "
, $e.tail.tail.tail.tail.tail.tail.tail.tail.tail.head
, ")"
)
)
children (
#(
0: $e.head
, 1: $e.tail.head
, 2: $e.tail.tail.head
, 3: $e.tail.tail.tail.head
, 4: $e.tail.tail.tail.tail.head
, 5: $e.tail.tail.tail.tail.tail.head
, 6: $e.tail.tail.tail.tail.tail.tail.head
, 7: $e.tail.tail.tail.tail.tail.tail.tail.head
, 8: $e.tail.tail.tail.tail.tail.tail.tail.tail.head
, 9: $e.tail.tail.tail.tail.tail.tail.tail.tail.tail.head
)
)
}