SSRS 2008 R2 Tablix Goto URL Action Outlook - url

Reporting Services 2008 R2 Tablix Go to URL Action . . . I have the following expression . . .
="mailto:" & "email" & "?subject=" & "My Email Subject" & Fields!ReferenceNo.Value & "-" & Fields!ShortName.Value & "&body=" & "Hi," + vbcrlf + vbcrlf + "My Body Message" & Fields!ReferenceNo.Value & " - " & Fields!ShortName.Value & " " & "needs commentary." & vbcrlf & vbcrlf & "I'll be checking this later!" & vbcrlf & vbcrlf & System.Uri.EscapeDataString(""
which displays and opens an email message fine . . . however . . . replacing the "email" with Fields!Name.Value seems to make the action stop working. Any ideas?

It seems the answer to this is to start the expression as
="mailto://" & . . .

Related

How to run a Jenkins job from classic ASP?

I have searched all over but can't find VBscript examples and all my attempts have failed. I need to run a Jenkins job from a classic ASP web page (VBScript). I can submit the job with the code below, but it returns a 403 crumb error. What I need to do is provide the user/password (which I have) for this job but I don't know how to setup the authentication for Jenkins in VBScript. I know the crumb error is due to CSRF (I read that much and can't turn that off) and hope that authentication will resolve that. Any help is much appreciated. Thanks in advance.
Dim strJenkinsURL, HttpReq
strJenkinsURL = "http://<jenkinsmaster>/job/<myjob>/buildWithParameters?token=test&Description="& strDesc &"&TestEnv="& testEnv
Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.Open "POST", strJenkinsURL, False
HttpReq.Send
Response.Write "<br>Status: "& HttpReq.Status & vbNewline
Response.Write "<br>Response: "& HttpReq.responseText & vbNewline
EDIT:
Based on comments, I attempted to add the Jenkins login information but I am still getting the 403 crumb error from Jenkins. I've tried searching for solution to getting the crumb, but haven't found any VBScript examples. Here is the code and response I am trying now but I have no idea if the setRequestHeaders are correct for Jenkins and the Jenkins documentation hasn't been any help:
Dim strJenkinsURL
strJenkinsURL = "http://<jenkins master>/job/testjob/buildWithParameters?token=test&Description="& strDesc &"&TestEnv="& testEnv
Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.Open "POST", strJenkinsURL, False
HttpReq.setRequestHeader "UserName", "jenkinsuser"
HttpReq.setRequestHeader "Password", "userpassword"
HttpReq.setRequestHeader "Jenkins-Crumb", "<crumbvalue>"
HttpReq.Send
Response.Write "<br>Status: "& HttpReq.Status & vbNewline
Response.Write "<br>Response: "& HttpReq.responseText & vbNewline
Status: 403
Response: HTTP ERROR 403
Problem accessing /job/testjob/buildWithParameters. Reason: No valid crumb was included in the request
For a HTTP POST request, the URL specifies the resource, i.e. strJenkinsURL = "http://<jenkinsmaster>/job/<myjob>/buildWithParameters
The parameters are added as part of the .Send command:
Dim sParams
sParams = "token=test&Description=" & strDesc & "&TestEnv=" & testEnv
HttpReq.Send(sParams)
As #Lankymart pointed out, you also need to set the appropriate headers, e.g.
HttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
HttpReq.setRequestHeader("Content-Length", CStr(Len(sParams)))
After piecing together many suggestions with some trial and error, I was finally able to get the Jenkins job to run remotely with the VBScript code below (with variables set to proper values such as strCrumb). The returned Status will be 201 for success. The Base64 functions were taken from Base64 Encode String in VBScript
Dim strJenkinsURL, strParam1, strParam2, strCrumb, strUsername, strPassword
strJenkinsURL = "https://<jenkinsURL>/job/testjob/buildWithParameters?token=test&param1="& strParam1 &"&param2="& strParam2
Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.Open "POST", strJenkinsURL, False
HttpReq.setOption 2, 13056
HttpReq.setRequestHeader "Jenkins-Crumb", strCrumb
HttpReq.setRequestHeader "Authorization", "Basic "& Base64Encode(strUsername &":"& strPassword)
HttpReq.Send
Response.Write "<br>Status: "& HttpReq.Status & vbNewline
Response.Write "<br>Response: "& HttpReq.responseText & vbNewline
Function Base64Encode(sText)
Dim oXML, oNode
Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
Set oNode = oXML.CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.nodeTypedValue = Stream_StringToBinary(sText)
Base64Encode = oNode.text
Set oNode = Nothing
Set oXML = Nothing
End Function
Private Function Stream_StringToBinary(Text)
Const adTypeText = 2
Const adTypeBinary = 1
Dim BinaryStream 'As New Stream
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeText
BinaryStream.CharSet = "us-ascii"
BinaryStream.Open
BinaryStream.WriteText Text
BinaryStream.Position = 0
BinaryStream.Type = adTypeBinary
BinaryStream.Position = 0
Stream_StringToBinary = BinaryStream.Read
Set BinaryStream = Nothing
End Function

Generating authorization headers automatically

Right now I generate authentication headers using a website - OAuth tool. Then I create the following code:
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n" .
'Authorization: OAuth oauth_consumer_key="343432dsddsf", ' .
'oauth_nonce="3432fsdfsdf", ' .
'oauth_signature="423fsdfsdfsdf%3D", ' .
'oauth_signature_method="HMAC-SHA1", ' .
'oauth_timestamp="1431435892", ' .
'oauth_version="1.0"'
)
);
//191683771
$context = stream_context_create($opts);
$source = #file_get_contents('https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&user_id=112344123', false, $context);
To get the JSON data.
It works, but I want the user_id parameter to be changed. I have the whole array of users for which I want to retrieve this data.
But then, I can't do that as I would have to generate authentication headers for all users myself.
Is there a way to solve this?

Quickbooks SDK Deposit not populating payee on main deposit

I am creating a program using the QBFC13 that is supposed to create a deposit from an other current asset type of account to a bank account. However, when the depositadd method is executed the payee doesn't get filled in on the bank account. How do i get the Payee information filled out?
I dont have a high enough reputation to post pictures so this is a link to the picture of the field i need filled out: http://i.stack.imgur.com/nqWOh.jpg
Here is my current code:
Public Sub CreateDeposit()
On Error GoTo Errs
Dim depositadd As IDepositAdd
depositadd = msgSetRequest.AppendDepositAddRq()
depositadd.DepositToAccountRef.FullName.SetValue("checking")
depositadd.Memo.SetValue("newdeposit test")
depositadd.TxnDate.SetValue(Date.Today)
Dim depositLineAdd As IDepositLineAdd
depositLineAdd = depositadd.DepositLineAddList.Append()
depositLineAdd.ORDepositLineAdd.DepositInfo.AccountRef.ListID.SetValue("1EE0000-943382783")
depositLineAdd.ORDepositLineAdd.DepositInfo.EntityRef.ListID.SetValue("80002534-1335362979")
depositLineAdd.ORDepositLineAdd.DepositInfo.Amount.SetValue(150.0)
depositLineAdd.ORDepositLineAdd.DepositInfo.Memo.SetValue("test memo lineitem")
' send the request to QB
Dim msgSetResponse As IMsgSetResponse
msgSetResponse = qbSessionManager.DoRequests(msgSetRequest)
' check to make sure we have objects to access first
' and that there are responses in the list
If (msgSetResponse Is Nothing) Or _
(msgSetResponse.ResponseList Is Nothing) Or _
(msgSetResponse.ResponseList.Count <= 0) Then
Exit Sub
End If
' Start parsing the response list
Dim responseList As IResponseList
responseList = msgSetResponse.ResponseList
MsgBox(msgSetRequest.ToXMLString())
' go thru each response and process the response.
' this example will only have one response in the list
' so we will look at index=0
Dim response As IResponse
response = responseList.GetAt(1)
If (Not response Is Nothing) Then
If response.StatusCode <> "0" Then
MsgBox("DepositFunds unexpexcted Error - " & vbCrLf & "StatusCode = " & response.StatusCode & vbCrLf & vbCrLf & response.StatusMessage)
Else
MsgBox("The funds were successfully deposited in Checking")
MsgBox(msgSetResponse.ToXMLString())
End If
End If
Exit Sub
Errs:
MsgBox("HRESULT = " & Err.Number & " (" & Hex(Err.Number) & ") " & vbCrLf & vbCrLf & Err.Description, _
MsgBoxStyle.Critical, _
"Error in DepositFunds")
End Sub
This actually isn't an SDK issue, as it's how QuickBooks was designed. Because a deposit transaction in QuickBooks can contain multiple lines, the bank register won't show any names even if there's just one line. You can manually go to the bank register and add the name, but there's not a way to do it through the SDK. It's a two step process to even do it in QuickBooks, where you create the deposit, then go and edit it in the register.
If you need to have this information show from transaction using the SDK, then you might have to use Journal Entries instead of a Deposit transaction.

How to sign a quickbooks online API request in ColdFusion 9?

In my CF app, I've used the CF OAuth code at riaforge to get request token and access token from QuickBooks Online and it works fine.
After I tried to make a QBO API call by starting to build the http headers of the call (I followed the instructions on the section "HTTP Authorization Header" here: Implement OAuth in Your App). Then built the http header based on the methods of the code at riaforge because it worked. In addition, I've respected the order of the parameters given by Intuit in the previous link).
When I launched the API Call, I received the response: "signature_invalid"
I really want directions on how to sign the QBO online API Call with CF 9 if I have ready the 6 header parameters:
oauth_token
oauth_nonce
oauth_consumer_key
oauth_signature_method
oauth_timestamp
oauth_version
(But if possible a working code would be better)
Thank you in advance for your time and help
this is what I use for generating the signature and header for the request token, simple additions are used for the other signatures you'll need along the way.
paramsStr = "oauth_callback=" & encodeData(CALL_BACK_URL) & "&" & "oauth_consumer_key=" & sConsumerKey & "&" & "oauth_nonce=" & session.nonce & "&" & "oauth_signature_method=" & SIGNMETHOD & "&" & "oauth_timestamp=" & TIMESTAMP & "&" & "oauth_version=" & VERSION;
signStr = "POST&" & encodeData(REQUEST_TOKEN_URL) & "&" & encodeData(paramsStr);
signature = computeHMACSignature(signStr, sConsumerSecret & "&");
authHeader = 'OAuth ' & createHeaderElement("oauth_consumer_key", trim(sConsumerKey)) & ", " & createHeaderElement("oauth_nonce", trim(session.nonce)) & "," & createHeaderElement("oauth_signature_method", trim(signmethod)) & ", " & createHeaderElement("oauth_signature", trim(signature)) & ", " & createHeaderElement("oauth_timestamp", trim(TIMESTAMP)) & ", " & createHeaderElement("oauth_version", trim(VERSION)) & ", " & createHeaderElement("oauth_callback", trim(CALL_BACK_URL));

pinterest api not giving response ( http://pinterestapi.co.uk/username/pins )

I have used this url http://pinterestapi.co.uk/username/pins for getting the pins from my account . Previously it is working but now it is not giving proper response . The output is {"body":[],"meta":{"count":0}} . At the starting it have some data for the key "Body" . So Based on that I have parsed the json . Please tell me how to solve this problem . Platform is **iOS** .

Resources