Embed Javascript into SSRS Report

Hi
There are similiar question on this forum, but they don't really anwser my question, in a way I understand.
I'm new to SSRS and have a requirement to add a 'badge' to a report I am creating, this is dynamic for each row.
Below is the code that works as a static page. What I am after is to be able to pass the 'data-doi' for each row and have the 'badge' displayed on the report for each row.
Can this be done?
Thanks
<html>
<head>
   <script type="text/javascript" src="URL is below"></script>
   </head>
<body>
<div data-badge-popover="top" data-badge-type="4" data-doi="110.1371/journal.pone.0003902" data-hide-no-mentions="true" class="altmetric-embed"></div>
</body>
</html>
JS URL
replace -
https-d1bxh8uas1mnw7-cloudfront-net/assets/embed.js

Hi CuriousCraig,
If I understand correctly, you want to embed the javascript with the code which posted before into report. As per my understanding, we can embed JavaScript in reports using “Response.Write” in custom code, and then show a messagebox using JavaScript. For
more details, please see the following steps:
Add a reference that refer to “System.Web”. We can do this by navigating to Report -> Report Properties -> References.
Add the following custom code to your report through Report -> Report Properties -> Code:
Function WriteHTML (ByVal Msg AS String) AS String
System.Web.HttpContext.Current.Response.Write(Msg)
Return “”
End Function
In the report, use the custom function for the image column:
=Code.WriteHTML("<script>..[your code]..</script>”)
For more information about how to add code to a report (SSRS), please see:
http://msdn.microsoft.com/en-us/library/ms156028.aspx
Another similar thread:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bb9a913c-4082-4b5d-8c9f-7c1b73f4721c/audio-alerts-on-reports?forum=sqlreportingservices
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support

Similar Messages

  • Display Disclaimer message before opening SSRS report

    Hello,
    I have a requirement to display a disclaimer message before going to the content of a particular report.
    The workflow would be:
    go to report folder e.g. Reports/Pages/Folder.aspx?ItemPath=%2fMyFolder%2fReports&ViewMode=List
    Click on Report x
    Display Disclaimer
    Press 'ok' on disclaimer
    Continue to report
    This is SSRS 2012 native.
    I had contemplated injecting JavaScript into the report, but this appears virtually impossible to do i a simple manner.
    I am stumped as best to how to proceed.
    Regards,
    MrHH

    Hi MrHH,
    Per my understanding that you want to display an popup window(disclaimer message) before display the report.
    I have tested on my local environment and that we have two method to help you do this.
    Method one is simple and more easy to add this action to a special report":
    you can create an new report with the information of the disclaimer and add two textbox(Agree,Disagree) perform as the two button, then add "go to report" action for the two buttons, when click "Agree" link to the particular report,
    if click on "disagree" will just refresh on this discalimer report.
    Note: you need to deploy both the disclaimer report and the particular report to the report server, and when you click on the disclaimer report you will got the display result you want.
    Method two:
    This method is not that simple, i will give you some sample data to get the popup windows display before you can see the particular report, when you click  the particular report you will get the popup window display with two buttons "Agree"
    and "Disagree", when you click the "Agree" you will see the report content, when you click "Disagree" you will link back to the home page of the report manager.
    Detail information below for your reference:
     Add some code in the report.aspx file in the path similar to this:
    C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportManager\Pages\Report.aspx
    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
    <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    $(function() {
    $("#dialog").dialog({
    title: "jQuery Dialog Popup",
    height: "200",
    modal: true ,
    buttons: {
    "Agree": {
    text: "Agree",
    id: "my-button-id1",
    click: function() {
    $(this).dialog('close');
    document.getElementById("bg").style.display = "none";
    "Disagree": {
    text: "Disagree",
    id: "my-button-id2",
    click: function() {
    location.href = '/Reports'
    </script>
    <div id="bg" style="width:100%; height:100%;z-index:20000;background-color:silver" >
    <div id="dialog" style="display: none;z-index:20001">
    Please make sure you have read this information and understand clearly before enter the report.
    </div>
    </div>
    Note: this sample code now works for all the report in the report manager, you can improve the code by add url to make it just work on the particular report.
    2. Restart the Report Server instance in the Reporting Service Configuration manager and then open the report manager to have a test.
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • NeoDynamic Barcode Proffessional Upload Error in SSRS Report Server 2012

    Hi,
    I am Developing a SSRS Report for Displaying Barcode . I am Using Neodynamic Barcode Proffessional and the Report is Working fine in Developer Machine (MY Machine). When i try to Upload the Report into SSRS Report Server i get this Error Can any one Help on
    this. Thanks in Advance
    Note : I am Using SSRS 2012 Version and The Report Server is also the Same
    Error : Error while loading code module: ‘Neodynamic.ReportingServices.Barcode, Version=7.0.2000.0, Culture=neutral, PublicKeyToken=c6b33c3093a0d4cd’. Details: Could not load file or assembly 'Neodynamic.ReportingServices.Barcode, Version=7.0.2000.0, Culture=neutral,
    PublicKeyToken=c6b33c3093a0d4cd' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (rsErrorLoadingCodeModule) Get Online HelpError in class instance declaration
    for class Neodynamic.ReportingServices.Barcode: [BC30002] Type 'Neodynamic.ReportingServices.Barcode' is not defined. (rsCompilerErrorInClassInstanceDeclaration) Get Online Help There is an error on line 4 of custom code: [BC30451] Name 'Neodynamic' is not
    declared. (rsCompilerErrorInCode) Get Online Help

    Hi cbazrm,
    According to your description, you add an external assembly to display barcode in your report. It works properly in developing environment. But it throw the above error after deploying onto report server. Right?
    Based on the error message, the report server side doesn't have the assembly added, so it can't use the assembly to render the barcode.
    In this scenario, we should copy the AgeAssembly.dll to the “C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin” folder then drag and drop the assembly to the C:\Windows\assembly too.
    Reference:
    SSRS - Custom Code with External Assemblies
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Javascript Problem for Drill Down Action in SSRS Report when integrated to PPS 2010

    Hi all,
    I have a SSRS report which is integrated to PPS 2010(Performance Point Services) and it is having a drill down action through Go to URL action(I wrote javascript:void(window.open('xxxxx')) to open drill down report in new window).
    This report has 5 parameters and all are multiple valued. Drill down report is opening very well when I open the report form Report Manager for any number of parameters values selected. But when I integrate the same report is PPS and deployed to SharePoint
    then it is working only for 23 parameter values selected in PPS filters. If I select more the 23 values in PPS filters then the drilldown report is not opening.
    But it is working well in Chrome, I verified in IE and Mozilla, both browsers are having problem.
    When I look at Error Console of Mozilla, it is showing a javascript error as "Error: uncaught exception: ReferenceError: window is not defined" but the same report is working well if I select less than 24 filter values.
    Please provide me the solution
    Thanks in advance

    Hi Vasu,
    The issue might occur due to the Microsoft security update MS11-100 which limits the maximum number of form keys, files, and JSON members to 1000 in an HTTP request. Here, I suggest that you modify the Web.config file of the SharePoint site as follows:
    <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="10000" />
    </appSettings>
    If the SharePoint site uses the port 80, the web.config file of the SharePoint site is located in the C:\inetpub\wwwroot\wss\VirtualDirectories\80 folder.
    Reference:
    An ASP.NET request that has lots of form keys, files, or JSON payload members fails with an exception
    If the issue persist, please check whether there are any related errors in the Reporting Services log file which is located in <Drive>:\Program Files\Microsoft SQL Server\MSRSXX.<Instance Name>\Reporting Services\LogFiles.
    Regards,
    Mike Yin
    TechNet Community Support

  • How to Export SSRS report into Excel format using query string

    Hello all,
    I am new to SSRS world.
    Last night i was trying to add a hyperlink  on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
    Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)

    Hi Suman85,
    Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
    Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
    to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
     ="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
    Then preview the report ,you will see
    Click here and export the report to excel 
    when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled. 
    I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
    Regards,
    Challen Foo

  • Dynamically generating the ssrs dataset and filling the data into the dataset and binding it to ssrs report dynamically

    I have a work to do, in ssrs we are using server reports in our project. i am looking for dynamically generating the ssrs dataset and filling the data into the dataset and binding the dataset to ssrs report(RDL) dynamically.
    Getting the dataset dynamically has a solution by using Report Definition Customization Extension (RDCE), but the problem is binding that dataset to the report(RDL) dynamically was not there.
    Here is the reference for RDCE http://www.codeproject.com/Articles/355461/Dynamically-Pointing-to-Shared-Data-Sources-on-SQL#6
    I looked for binding the dataset to the report(RDL) dynamically and searched many sites but i did not get the solution. Can anyone help me here.
    Is there any custom assemblies or any Custom data processing extensions to work around. Please help.
    Thanks in advance

    Hi Prabha2233,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to embed the Word Document and PDF file into Crystal report?

    How to embed the Word Document and PDF file into Crystal report?
    I have word doc which having 10 pages. I need to show all of the 10 pages at a time. I tried OLE object but problem is it shows only one page.
    Is there any solution to show word doc / PDF file in CR?

    Symptom :
    When embedding a pdf document into a Crystal Report, only the one page shows.
    Reproducing the Issue
    Environment:
    Crystal Reports OLE object
    Cause
    An OLE object only displays the first page.
    Resolution
    Embed multiple objects, one for each page
    Or
    Use a hyperlink to the object instead
    Hope this helps!
    Regards,
    Vinay

  • How to Deploy SSRS Reports(Sql Server 2008 R2) into Oracle Weblogic Application Server

    Hi Friends
    One of my project requirement is Developing reports by using SSRS and deploying the reports into Oracle Wblogic Server
    Could you please give me a Steps where we need to configure.
    Regards
    Hasthi.

    Hi Hasthi,
    As per my understanding, I think we couldn’t directly deploy the SSRS report to Oracle Weblogic Application Server. We can deploy report to report server and SharePoint library. And we can display report to some applications, for example, windows application
    and web application. Sorry for that I am not familiar with Oracle. So if your Oracle Weblogic Application Server support those Visual Studio application, then we can use report viewer control to display report in application. For more detail information about
    report viewer control, please refer to the following document:
    http://msdn.microsoft.com/en-us/library/ms251671.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Embed dynamic smart view report into power point

    Hello All.
    can amyone help with How to Embed dynamic smart view report into power point
    Thanks.

    Have you tried dragging and dropping onto a ppt slide? I just did and showed up sheet one of the workbook. If you have many sheets in the workbook and want to show a particular sheet/data, you may want to save workbook with that sheet visible when you reopen. One thing I have not checked is dynamic content of the worksheet.
    Venu

  • Steps to migrate 2005 SSRS reports into 2012 SSRS?

    Hi All,
    I will migrate bunch of datamarts from 2005 to 2012
    SO Any idea where should I start looking and steps to take for SSRS reports?
    thanks,
    Gok

    Hello Gok,
    Just open the BIDS 2005 SSRS Project in SSDT 2012 (SQL Server Data Tools) and the Project will be automatically migrated to the new Version; pretty simple.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SSAS report action to pass multi-value list of dimention key values to a SSRS report parameter

    This was originally posted on StackOverflow and suggested I try here as well.
    I want to create a report action in an SSAS OLAP cube that generates a list of formatted values to pass into an SSRS report parameter that accepts a multi-valued parameter list.  This would be applied at the
    cell level in the SSAS action.  I have found a solution that gets me most of the way:
    How to Pass Multiple Values from an SSAS Report Drill Through Action to an SSRS Multi-Value Parameter, but not quite.  The action does appear in Excel and works
    if I run the action from a cell that is at or below the dimension attribute I am generating the list for, in this case,
    Account Key.
    Below is a link to a screen capture (unable to embed it due to lack of reputation) showing the action and dimension structure in Excel.  The action works as long as I run it at the
    Account Key level or below.  I want to be able to run it at higher levels, such as
    Account Major and still have it generate all then related Account Key values for the SSRS report parameter.  Running it at the higher
    Account Major level does not trigger the report to run.
    Excel Action Screen Shot:
    http://i.stack.imgur.com/QCGSp.png
    Below is the MDX I am using to generate the value for the report parameter:
    UrlEscapeFragment(
    GENERATE(
    DESCENDANTS(
    [Account].[Account Key].CurrentMember,
    [Account].[Account Key].[Account Key]
    [Account].[Account Key].CURRENTMEMBER.Name,
    "&rp:Account="
    I am hoping that I can somehow modify the MDX above to make it return all the
    Account Keys for any attribute of the Account dimension when ran from any measure cell, not just when ran at self and children of
    Account Key in the pivot table.
    Also, if it helps, I can execute the following MDX query on the cube and get the results I am looking for.
    WITH MEMBER [Measures].[Account Key List] as
    GENERATE(
    DESCENDANTS([Account].[Account].CurrentMember, [Account].[Account].[Account]),
    [Account].[Account].CURRENTMEMBER.NAME,
    "&rp:Account=")
    SELECT {[Measures].[Account Key List]} on 0,
    ([Account].[Account Company Number].[Account Company Number],[Account].[Account Major].[Account Major]
    ) on 1
    FROM [Company 10 Action Demo]
    Below are partial results:
    10.116&rp:Account=10.116.010
    10.117&rp:Account=10.117.010&rp:Account=10.117.020
    10.120&rp:Account=10.120.005&rp:Account=10.120.006&rp:Account=10.120.010&rp:Account=10.120.020&rp:Account=10.120.030&rp:Account=10.120.040&rp:Account=10.120.050&rp:Account=10.120.060&rp:Account=10.120.380&rp:Account=10.120.999
    10.123
    Questions
    Any ideas what I might need to do to get Account Key to be returned for any attribute of the
    Account dimension?
    Would I possibly have to alter my Account dimension in the cube to get this to work?
    Thanks in advance.
    Edit 1 - Adventure Works Cube Version
    I was unable to get the suggested answer with the "Exists" function to work.  To better demonstrate this issue, I have recreated it using the Adventure Works Cube.
    I will focus on the Customer dimension, specifically the Customer and
    Education attributes.  I created a report action called Test Report Action.  Below is the XML created for it in the cube.
    <Action xsi:type="ReportAction" dwd:design-time-name="f35ad5ee-5167-4fb8-a0e0-0a74cc6e81c6">
    <ID>Report Action 1</ID>
    <Name>Test Report Action</Name>
    <TargetType>Cells</TargetType>
    <Target></Target>
    <Type>Report</Type>
    <ReportServer>SQLSERVER</ReportServer>
    <Path>ReportServer?/Test Report</Path>
    <ReportParameters>
    <ReportParameter>
    <Name>Test Customer Existing</Name>
    <Value>UrlEscapeFragment(
    GENERATE(
    EXISTING DESCENDANTS(
    [Customer].[Customer].CurrentMember,
    [Customer].[Customer].[Customer]
    [Customer].[Customer].CURRENTMEMBER.Name,
    "&amp;rp:Customer="
    )</Value>
    </ReportParameter>
    </ReportParameters>
    <ReportFormatParameters>
    <ReportFormatParameter>
    <Name>rs:Command</Name>
    <Value>Render</Value>
    </ReportFormatParameter>
    <ReportFormatParameter>
    <Name>rs:Renderer</Name>
    <Value>HTML5</Value>
    </ReportFormatParameter>
    </ReportFormatParameters>
    </Action>
    Below are the steps to re-create the issue.
    Connect to the cube in Excel
    Add dimension Customer -> More Fields -> Customer
    Add measure Internet Sales -> Internet Sales Amount
    Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action" and see customer values created for URL 
    When the action is ran at this point with Customer, I see the values created in the URL shown message box (since there is no SSRS report server at location specified).
    Now the part I'm unable to resolve
    Remove the Customer dimension and add Customer -> Demographic -> Education
    Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action"
    Nothing happens. If I ran the action on the cell next to "Bachelors", I would want it to build up all the list of all the "Customers"  that make up the "Bachelors" in the
    Customer dimension as part of the report parameter.  If no attributes where used in the cube from the
    Customer dimension for that cell, then I would like it to return "All Customers", or something similar to show that all customers are included in the aggregations.
    I am not too MDX savvy, thus far.  I think I need to somehow join the
    Customers to Internet Sales Amount in the Generate function portion.  I have tried several different combinations of the
    Customer dimension and Internet Sales Amount, along with various functions to see if I could get this to work with no success.  I am hoping that someone more knowledgeable the me will have a solution.   If you need more details,
    please ask and I will provide them.

    Simon,
    Thanks for you help with this.  This morning I found a workaround.  Below describes what that is.
    What I ended up doing was getting a list of values from a degenerate dimension that I could use to pass to SSRS to get a list of transactions for a report.  Below is how I did this, in relation to the Adventure Works cube using the degenerate dimension
    Internet Order Details.
    WITH MEMBER [Measures].[Order Param List] AS
    GENERATE(
    EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
    "Internet Sales"),
    [Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
    "&rp:OrderNum=")
    SELECT {[Measures].[Order Param List], [Measures].[Internet Sales Amount]} ON 0
    ,([Date].[Calendar].[Date]) ON 1
    FROM [Adventure Works]
    This will get a list of Sales Order Number in a text string, separated by "&rp:OrderNum=" for each measure of
    Internet Sales. This would allow me to create an SSRS report to bring back detail information for each
    Sales Order Number. Below are some sample results.
    May 16, 2007 SO50493&rp:OrderNum=SO50494&rp:OrderNum=SO50495&rp:OrderNum=SO50496&rp:OrderNum=SO50497&rp:OrderNum=SO50498&rp:OrderNum=SO50499&rp:OrderNum=SO50500 $12,157.80
    May 17, 2007 SO50501&rp:OrderNum=SO50502&rp:OrderNum=SO50503&rp:OrderNum=SO50504&rp:OrderNum=SO50505&rp:OrderNum=SO50506&rp:OrderNum=SO50507&rp:OrderNum=SO50508 $13,231.62
    May 18, 2007 SO50509&rp:OrderNum=SO50510 $4,624.91
    With this, I can then create a Report Action in SSRS with a Parameter Value of
    UrlEscapeFragment(
    GENERATE(
    EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
    "Internet Sales"),
    [Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
    "&rp:OrderNum=")
    The way I was going about it before was flawed, as I was trying to get a list of the granular values from each dimension used to build the measure value and pass each one of those as separate parameters. I just needed to set something unique for each fact
    measure transaction that represents the value and uses that in a query parameter for the SSRS report.

  • Open PDF File from Link on SSRS Report REDUX

    Revisiting an earlier post here, because a solution is revealed. 
    The string below, when entered into the "Jump to URL" value on the Navigation tab for Textbox properties, works IN A REPORT PUBLISHED to a Report Server.  This would NOT work in the Visual Studio project on my desktop.
    ="
    FILE:\\somehost.com\SomeFolder\SomPDF.pdf"
    Unfortunately, it opens the PDF file on the same browser tab as the SSRS report that contains the link to the file. 
    Can anyone please suggest an alternative construction for the string that would force the file to open in either a new browser window or a new tab in the current window?

    How about trying this
    =
    "javascript:void(window.open('FILE:\\somehost.com\SomeFolder\SomPDF.pdf'))"

  • SSRS report security by expiring its session

    Hello all,
    We are using SSRS 2008 r2 for Reporting as its financial services company so, too much scope for reporting .
    Here, i am facing some problems let to security when users opens report and forget to close anymore report still stay opens for a hours i get suggest that to expired session for report after 10 minutes . How to achieve this please help.
    also ,  instead of login to application users are opening report from browser history .
    Dilip Patil..

    Hi Dilip,
    According to your description, you have reports which can be accessed by a lot users. Now you want to expire the session 10 minutes after the user has no operation on the page. Right?
    In this scenario, we can embed javascript code in the report page. Keep the page monitoring the event on page. If there's no mouse click/move, key press event for 10 minute, it will redirect/close the page. Please go to the Report.aspx file, it locates at
    C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportManager\Pages. Embed the code below:
    <script type="text/javascript">
    var load_time = null;
    var down_time = null;
    function window.onload(){
    flag = false;
    load_time = setTimeout(function(){
    location.href("http://server name/Reports/Pages/Folder.aspx");
    },600000);
    function clear(){
    clearInterval(load_time);
    if(null != down_time){
    clearInterval(down_time);
    down_time = setTimeout(function(){
    location.href("http://server name/Reports/Pages/Folder.aspx");
    },600000);
    function document.onmousemove(){
    clear();
    function document.onmousedown(){
    clear();
    function document.onkeypress(){
    clear();
    </script>
    Then the report will redirect to the Report Manager page if it's timeout.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • SSRS Reports in iFrames Across Domains

    I'm trying to set up an iFrame to load an SSRS report that is in a SharePoint 2013 library.
    The report's URL looks something like this:
    https://sp.example.com...
    I tried to load the report in an iFrame in a site with a URL like this:
    http://sp.example.com...
    I get this error message:
    It gives me the option to "Open this content in a new window", which opens a new tab and displays my report perfectly.
    When I change "http" to "https", the report loads just fine:
    I am led to believe that this is due to my X-FRAME-OPTIONS being set to the value of SAME-ORIGIN.
    I went into the IIS Server and tried to add this line:
    <httpProtocol>
    <customHeaders>
    <add name="X-Frame-Options" value="ALLOW-FROM http://sp.example.com" />
    </customHeaders>
    </httpProtocol>
    This should allow the iFrame to access the report viewer page even though it is not from "http://sp.example.com"
    Further down the road, I want to use this to put a SharePoint report in an iFrame in a CRM Form.
    So it is very important that this cross domain access is possible in an iFrame.
    Thanks,
    Ryan

    Eliminate the javascript function and this to your page :
    <!doctype html>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    or 
    <!doctype html>
    <meta http-equiv="X-UA-Compatible" content="IE=11">
    or 
    <!doctype html>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11">

  • SSRS Report Returning Double Quote string from a Single Quote String

    Hi, I'm getting weird thing in resultset from SSRS report when executed. When I pass parameter to a report, which passes String that has single quote value to a split function , it returns rows with double quote. 
    For example  following string:
    'N gage, Wash 'n Curl,Murray's, Don't-B-Bald
    Returns: 
    ''N gage, Wash ''n Curl,Murray''s, Don''t-B-Bald
    through SSRS report.
    Here is the split function Im using in a report.
    CREATE Function [dbo].[fnSplit] (
    @List varchar(8000), 
    @Delimiter char(1)
    Returns @Temp1 Table (
    ItemId int Identity(1, 1) NOT NULL PRIMARY KEY , 
    Item varchar(8000) NULL 
    As 
    Begin 
    Declare @item varchar(4000), 
    @iPos int 
    Set @Delimiter = ISNULL(@Delimiter, ';' ) 
    Set @List = RTrim(LTrim(@List)) 
    -- check for final delimiter 
    If Right( @List, 1 ) <> @Delimiter -- append final delimiter 
    Select @List = @List + @Delimiter -- get position of first element 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    While @iPos > 0 
    Begin 
    -- get item 
    Select @item = LTrim( RTrim( Substring( @List, 1, @iPos -1 ) ) ) 
    If @@ERROR <> 0 Break -- remove item form list 
    Select @List = Substring( @List, @iPos + 1, Len(@List) - @iPos + 1 ) 
    If @@ERROR <> 0 Break -- insert item 
    Insert @Temp1 Values( @item ) If @@ERROR <> 0 Break 
    -- get position pf next item 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    If @@ERROR <> 0 Break 
    End 
    Return 
    End
    FYI: I'm getting @List value from a table and passing it as a string to split function. 
    Any help would be appreciated!
    ZK

    Another user from TSQL forum posted this code which is returning the same resultset but when I execute both codes in SQL server it works and return single quote as expected.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8d5c96f5-c498-4f43-b2fb-284b0e83b205/passing-string-which-has-single-quote-rowvalue-to-a-function-returns-double-quoate?forum=transactsql
    CREATE FUNCTION dbo.splitter(@string VARCHAR(MAX), @delim CHAR(1))
    RETURNS @result TABLE (id INT IDENTITY, value VARCHAR(MAX))
    AS
    BEGIN
    WHILE CHARINDEX(@delim,@string) > 0
    BEGIN
    INSERT INTO @result (value) VALUES (LEFT(@string,CHARINDEX(@delim,@string)-1))
    SET @string = RIGHT(@string,LEN(@string)-CHARINDEX(@delim,@string))
    END
    INSERT INTO @result (value) VALUES (@string)
    RETURN
    END
    GO
    ZK

Maybe you are looking for

  • Device not recognized in iTunes for Windows

    iPhone 5S is not being recognized by iTunes or Windows Explorer.

  • ITunes sharing just NOT working!  Please help!

    I can't seem to get iTunes to find shared music on the network, or share my music. -I'm using iTunes version 6.0.1.3 and Windows XP with SP2 -I have tried adding the ports 3689 and 5353 to the firewall port exceptions -After researching for awhile on

  • Ipad frequently shuts off while I'm working

    We got the new Ipad 4 for Christmas and it randomly shuts off when we are using it.  Is there a sensor along the rim of the ipad that I'm unaware of?  I have applecare on it so I can call, but I just wanted to check to see if anyone is having these i

  • Create previews of video clips with multiple thumbnail and export in html?

    Hi all! I am trying to make a list of the videos that i have shot with my digital camera....my 1Tb is almost full, so you can understand that is not that easy as looking into a folder with the big thumbnails this is the expectation: to find an app th

  • No audio for movie maker

    I had started a movie maker project back in August, and had sound attached and working.  Sound is now no longer working in movie maker.  Works for everything else eg itunes, you tube, games etc.  What am I doing wrong? This question was solved. View