SSRS 2008 Report - Hyperlink on Name - After Clicking - Open Outlook Mail with Subject and Body

  • Hello,

    After reading the subject of this post, i think you got a picture of what i am going to do.

    I have a report and one of the column is Planner. It displays the name and that name should be hyperlinked and when i click that, outlook mail should open and this Planner name should be in "To" list.

    I did it using "MailTo:"

    Now the added requirement is, after clicking name in report, outlook mail should open with Subject and the data should be in the body of the email. After some research, i did it with below code.

    ="MailTo:" & Fields!Email.Value & "?Subject=The SKU and Market " & "&Body=Hello Team, " & VBCRLF & VBCRLF & "SKU: " & Fields!sku.Value & VBCRLF & "Country: " & Fields!countryname.Value & VBCRLF & Blah Blah Blah..

    The problem is, in the above code if i add up to 8 columns, then the hyperlink is working. If i add 1 more column (more than 8) and deploy the report and when i click the hyperlinked name, outlook doesn't open. I can see processing symbol on the report tab revolving for more than 15 min and i would stop the processing. If i modify the expression to 8 columns and deploy the report, hyperlink will open the outlook with data. More than 8, it dies.

    Is there any specific reason for this. Is there any conditions or anything i am missing. Do we have any limit for Fields or Parameters in the expression. Please let me know.

    Thanks,

    SK

  • My guess is that you are hitting a limit on the body size using mailto. I do something similar to what you are attempting; however, I use a hyperlink to a VB.net program I wrote that automates Outlook. See example of hyperlink here:

    http://apps/GenEmails/GenEmails.application?OrderNo=123456&Region=East

    This method took very few lines of VB.net code to accomplish, and it will probably give you more flexibility in your design.

  • Hello,

    Thanks for the reply.

    Yes i am hitting the limit. The limit is kind of weird. The count of characters its limited to is 308.

    I will use the VB.net code as suggested but the link you provided is not working...can you please provide me the other link..

    Thanks,

    SK

  • That was a sample url. You will need to develop your own program. Do a Google search on "vb.net automate Outlook". Publish your vb.net program to a web site and ensure "Allow URL parameters to be passed to application" is checked in Publish Options. The application load event has these lines to get the url:

    Dim cmdLine as String

    cmdLine = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData(0)

    ' parse the cmdLine to extract the parameters

    Below is a snippet of what I use to generate the emails.

    Dim OL As Object

    Dim msg As Object

    OL = CreateObject("Outlook.Application")

    msg = OL.CreateItem(0)

    With msg

    .To = "abc@xyz.com"

    End With

    msg.Subject = "This is the subject line"

    msg.HTMLBody = strBody ' body in html format

    msg.Save()

    msg.Display(True)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply