SSRS 2008 URL click-through with multi-value parameter not working but works if the string is manually entered - reporting-services

I'm attempting to create drill-through functionality to another report using Text Box Properties > Action > Go to URL , all parameters that are in the drill-through report are included in the url expression to ensure no defaults within the drill through report are used, and are specified in the order that they exist in the drill-through rdl.
#ReportIntermediary is a multi-value parameter, all others are single-value.
=Globals!ReportServerUrl
& "/reportserver?"
& replace(Globals!ReportFolder, " ", "+")
& "/Snapshot+Report"
& "&rs:Command=Render&rs:ParameterLanguage=en-AU&rc:Parameters=false"
& "&ReportRegion=National"
& "&ReportDate=" & Code.URLEncode(Format(Parameters!ReportDate.Value, "yyyy-MM-dd"))
& "&ReportIntermediaryGroup=" & CStr(Fields!GroupIntermediaryNo.Value)
& "&ReportNumberOfMonthsToShow=3"
& "&ReportIntermediaryState=National"
& Fields!ParameterIntermediaryList.Value
Where Fields!ParameterIntermediaryList.Value is formatted as:
&ReportIntermediary=123456789&ReportIntermediary=123456789
And a sample of the string that is formed by the expression being:
http://localhost/ReportServer/Pages/ReportViewer.aspx?/Folder/Sub+Folder/Snapshot+Report&rs:Command=Render&rs:ParameterLanguage=en-AU&ReportRegion=National&ReportDate=2013-06-01&ReportIntermediaryGroup=123456789&ReportNumberOfMonthsToShow=3&ReportIntermediaryState=National&ReportIntermediary=123456789&ReportIntermediary=123456789&ReportIntermediary=123456789
I have put the above expression in a text box within the row group of the matrix and the string appears to be well formed. When I take that string and manually enter it into IE address bar the report will render.
If the manual method will render, why won't the click-through behaviour be working in the report?
I have also tried setting the Go to URL expression to =ReportItems!txtLink.Value, where this text box holds the string value created by the expression above. This doesn't work either.
Here is the XML from within the rdl file:
<CellContents>
<Textbox Name="txtGroupIntermediaryName">
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!GroupIntermediaryName.Value</Value>
<Style>
<FontSize>8pt</FontSize>
<TextDecoration>Underline</TextDecoration>
<Color>Blue</Color>
</Style>
</TextRun>
</TextRuns>
<ListLevel>1</ListLevel>
<Style />
</Paragraph>
</Paragraphs>
<ActionInfo>
<Actions>
<Action>
<Hyperlink>=Globals!ReportServerUrl
& "/reportserver?"
& replace(Globals!ReportFolder, " ", "+")
& "/Snapshot+Report"
& "&rs:Command=Render&rs:ParameterLanguage=en-AU&rc:Parameters=false"
& "&ReportSegment=Dealer"
& "&ReportRegion=National"
& "&ReportDate=" & Code.URLEncode(Format(Parameters!ReportDate.Value, "yyyy-MM-dd"))
& "&ReportIntermediaryGroup=" & CStr(Fields!GroupIntermediaryNo.Value)
& "&ReportNumberOfMonthsToShow=3"
& "&ReportIntermediaryState=National"
& Fields!ParameterIntermediaryList.Value</Hyperlink>
</Action>
</Actions>
</ActionInfo>
<Style>
<Border>
<Style>None</Style>
</Border>
<BackgroundColor>=iif(ReportItems!txtRowGroupBackgroundFormat.Value = 1, Code.ColourPalette("row-highlight"), Nothing)</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>

The CStr function causes an error when trying to convert a multi-value parameter. Use the Join function instead. You can convert like this and use whatever separator you want:
Join(Fields!GroupIntermediaryNo.Value, ",")

The issue was caused by the text (within the textbox that has the Goto Url action on it) being indented for formatting purposes.
Removing this indentation allowed the action to work.
This can be done by any of the following methods:
Clicking the Decrease Indent button on the Report Formatting Toolbar
Selecting the textbox and then going to the Properties pane and setting ListLevel equal to 0
Going into the XML and finding the tag <ListLevel>1</ListLevel> and setting the 1 to 0 (this will be a larger number if the indentation is larger, e.g., 2, 3 ..., n)

Related

Hit query on pagination in display tag

I use DisplayTag in my struts2 application and i want to hit query on clicking pagination.
Ex : When user click on the next page or any page then query is fire on action class.
FILE : displayTag.jsp
<display:table name="list1" sort="list" size="20" pagesize="5" id="table1" export="true" requestURI="" partialList="true">
<display:column property="no" group="1" sortable="true" headerClass="sortable"></display:column>
<display:column property="nam" group="2" sortable="true" headerClass="sortable"></display:column>
<display:column property="ct" group="3" sortable="true" headerClass="sortable" autolink="true"></display:column>
<display:setProperty name="export.excel.filename" value="diplayTag.xls"></display:setProperty>
<display:setProperty name="export.pdf.filename" value="diplayTag.pdf"></display:setProperty>
<display:setProperty name="export.csv.filename" value="diplayTag.csv"></display:setProperty>
<display:setProperty name="export.pdf" value="true"></display:setProperty>
</display:table>
I use request.setAttribute("list1", li); where i set all data in list1(ArrayList) and pass to the displayTag.jsp.
DisplayTag get all data and display in the table format. But my need is to pass only 5 data at a time and on clicking next page action class send other 5 data and so on.
I refer link : Display tag pagination problem
But i can not understand because i'm use MySql and also new on DisaplyTag.
DB : MySql
Framework : struts2
After researching and hard working i found answer.
FILE : displayTag.jsp
<display:table name="list1" sort="external" size="20" pagesize="5" id="table1" export="true" requestURI="disTag" partialList="true">
// code as above
</dispaly:table>
here requestURI="disTag" is a action name.
FILE : struts.xml
<action name="disTag" class="className">
<result name="success">/displayTag.jsp</result>
<result name="error">/error.jsp</result>
</action>
FILE : class file
page = Integer.parseInt(request.getParameter((new ParamEncoder("table1").encodeParameterName(TableTagParameters.PARAMETER_PAGE))));
if(page != 0)
{
start = (page - 1) * 5; //5 is row or data per page.
}
getData(start, 5); //getData is a method which store all data in ArrayList. Based on start index.

How to add tags to a blog post in IBM Connections

How can I add tags to a blog post in IBM Connections? The API documentation says I need to update the blog post with a PUT command. If I do so according to the documentation, then I get a 500 Internal Server error as response. Same happens when trying to create a blog post with a POST command.
Question 1: what is wrong with the command?
Question 2: is there a way to only add tags without updating the content of the blog post?
sUrl = "https://my-connect-server/blogs/%BLOGID%/api/entries/%POSTID%"
sBody = "<?xml version=""1.0"" encoding=""UTF-8""?>" & _
"<entry xmlns=""http://www.w3.org/2005/Atom"">" & _
"<id>urn:lsid:ibm.com:blogs:entry-%POSTID%</id>" & _
"<title type=""text"">Test Blog Post</title>" & _
"<summary type=""html"">new summary</summary>" & _
"<content type=""html"">new content </content>" & _
"<category term=""new-tag-1""></category>" & _
"<category term=""new-tag-2""></category>" & _
"<entry>"
Call oHttp.Open("PUT", sUrl, False)
Call oHttp.setRequestHeader("Content-Type", "application/atom+xml")
Call oHttp.send(sBody)
The reason is you are not sending a full payload to the blog api. You should send back the full Blog entry with the additions/subtractions you want to make to the XML payload.
I call the api
https://<SERVER>/blogs/5133e363-7456-4525-afe6-188960888b35/api/entries/b17182a4-7807-4adf-97c7-8ac051a3f115
I had to trim off the XML header, so it's like this:
<entry xml:lang="en" dir="ltr" xmlns="http://www.w3.org/2005/Atom">
<id>urn:lsid:ibm.com:blogs:entry-b17182a4-7807-4adf-97c7-8ac051a3f115</id>
<snx:communityUuid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">5133e363-7456-4525-afe6-188960888b35</snx:communityUuid>
<link href="https://<SERVER>:443/blogs/5133e363-7456-4525-afe6-188960888b35/api/entries/b17182a4-7807-4adf-97c7-8ac051a3f115" rel="edit" type="application/atom+xml">
</link>
<link href="https://<SERVER>/blogs/5133e363-7456-4525-afe6-188960888b35/entry/Test" rel="alternate" type="text/html">
</link>
<link href="https://<SERVER>:443/blogs/5133e363-7456-4525-afe6-188960888b35/feed/entrycomments/Test/atom" rel="replies" type="application/atom+xml" thr:count="0" xmlns:thr="http://purl.org/syndication/thread/1.0">
</link>
<app:collection href="https://<SERVER>:443/blogs/5133e363-7456-4525-afe6-188960888b35/api/recommend/entries/b17182a4-7807-4adf-97c7-8ac051a3f115" xmlns:app="http://www.w3.org/2007/app">
<atom:title xmlns:atom="http://www.w3.org/2005/Atom">Likes</atom:title>
<atom:category term="recommend" scheme="http://www.ibm.com/xmlns/prod/sn/collection" xmlns:atom="http://www.w3.org/2005/Atom">
</atom:category>
<app:categories fixed="yes">
</app:categories>
</app:collection>
<app:collection href="https://<SERVER>:443/blogs/5133e363-7456-4525-afe6-188960888b35/api/entrycomments/b17182a4-7807-4adf-97c7-8ac051a3f115" xmlns:app="http://www.w3.org/2007/app">
<atom:title xmlns:atom="http://www.w3.org/2005/Atom">Comment Entries</atom:title>
<app:accept>application/atom+xml;type=entry</app:accept>
<atom:category term="comments" scheme="http://www.ibm.com/xmlns/prod/sn/collection" xmlns:atom="http://www.w3.org/2005/Atom">
</atom:category>
<app:categories fixed="yes">
</app:categories>
</app:collection>
<snx:moderation status="approved" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
</snx:moderation>
<title type="text">Test</title>
<updated>2015-08-14T11:58:05.000Z</updated>
<app:edited xmlns:app="http://www.w3.org/2007/app">2015-08-14T11:58:05.000Z</app:edited>
<published>2015-08-14T11:57:44.000Z</published>
<snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/recommendations" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">0</snx:rank>
<snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/comment" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">0</snx:rank>
<snx:rank scheme="http://www.ibm.com/xmlns/prod/sn/hit" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">8</snx:rank>
<author>
<name>John Doe0</name>
<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">20000395</snx:userid>
<snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
<snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal>
</author>
<contributor>
<name>John Doe0</name>
<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">20000395</snx:userid>
<snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
<snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal>
</contributor>
<category term="test">
</category>
<category term="test2">
</category>
<app:control xmlns:app="http://www.w3.org/2007/app">
<app:draft>no</app:draft>
<snx:comments enabled="yes" days="0" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
</snx:comments>
</app:control>
<summary type="html"><p dir="ltr">Test</p></summary>
<content type="html"><p dir="ltr">Test</p></content>
</entry>
I added to the category tag before
<category term="test2">
</category>
I send a put to the same api as above, with header Content-Type: application/atom+xml and Method: PUT
You should get Status Code: 200 OK

Setting the Control in RadGrid to Visible-False

I need help with getting the ID of the Control in RadGrid in order to set it Visable=False.
The last function is actually creating a pic based on the value that's coming from the DB. How can I set the HyperLink next to the Pic that I'm adding to Visible false?
I think that I need to send that function RenderLinked the hyperlink control but I don't know how and I hope that some one can show me the way.
<telerik:RadGrid
ID="rgPhoneBook"
runat="server"
AutoGenerateColumns="False"
AllowPaging="True"
AllowSorting="True"
PageSize="50"
CellSpacing="0" GridLines="None"
OnItemCommand="rgPhoneBook_ItemCommand"
OnPageIndexChanged="rgPhoneBook_OnPageIndexChanged"
OnSortCommand="rgPhoneBook_OnSortCommand"
OnItemCreated="rgPhoneBook_OnItemCreated"
EnableHeaderContextFilterMenu="True"
Width="933px"
Height="528px">
<ClientSettings>
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2" />
</ClientSettings>
<MasterTableView ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No PhoneBook Records to display" Font-Size="11px" GridLines="None" AllowPaging="True" ItemStyle-Height="25px" CommandItemDisplay="Top" AllowAutomaticUpdates="False" TableLayout="Auto" DataKeyNames="LocationID,PersonID" ClientDataKeyNames="LocationID,PersonID">
<PagerStyle Mode="NumericPages"></PagerStyle>
<Columns>
<telerik:GridTemplateColumn HeaderText="Linked" HeaderStyle-Width="45px" >
<ItemTemplate>
<span id="spanHyperLink" style="visibility:visible" runat="server">
<asp:HyperLink ID="Link" runat="server" Text="Link">
</asp:HyperLink>
</span>
<%# RenderLinked(DataBinder.Eval(Container.DataItem, "Linked"))%>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Protected Function RenderLinked(ByVal inputVal As String) As String
Dim output As String = ""
Try
Dim svcs As New SystemServices
If Not inputVal Is Nothing And Not String.IsNullOrEmpty(inputVal) Then
If inputVal = True Then
output = "<img src='" + Globals.gRootRelativeSecureURL("\Images\Layout\Link.png") + "' width=""13"" height=""13"" border=""0"" align=""absmiddle"">"
Else
'Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
'Dim link As HyperLink = DirectCast(item("Link").Controls(0), HyperLink)
'LinkButton.DisabledCssClass = True
Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), "StartupScript", "Sys.Application.add_load(function() { DisableHyperLinkCSS(); });", True)
'output = "<a herf='#' onclick='showPersonLinkModal() ;'>Link</a>"
End If
End If
Catch ex As Exception
Globals.SendEmailError(ex, m_User.SessionID, System.Reflection.MethodBase.GetCurrentMethod.Name.ToString(), Request.RawUrl.ToString(), m_User.UserID)
End Try
Return output
End Function
If you want to set some control's attribute visible=false in code behind when rows are bound to data 1 by 1 you may use RowDataBound event and write following code in it's handler
Control_Type Control_ID = (Control_Type) e.Row.FindControl("Control_ID");
Control_ID.Visible = false;
And if you want to set it in javascript,
rgPhoneBook.Rows[Record_Index].Cells[0].Visible = false;
Hope this helps you. The above code is in C#, please convert it to it's equivalent in VB.

mixing asp and html codes

i have this code which contains html and asp code
<%for each x in rs.Fields%>
<%IF (x.name="ID") THEN%>
<%dim i
i=x.value%>
<td><a href="form7.asp?id="+<%i%>>
<%Response.Write(x.value)%><a/>
i want to use the i variable inside the html code
or another example
<%id=request("id")%>
<%=id%>
<tr>
<th>Name:</th>
<td><input name="n"></input></td>
i want to use id in the input tag in the value as value=id
how to do that ? can someone help me please ?
First, a basic ASP design principle: try to minimize the switching between HTML context and ASP (or really, VBScript) context on a page, for reasons of performance as well as readability.
Following that principle in your latter snippet, I would use Response.Write to emit the necessary HTML as follows:
<%
id=request("id")
Response.Write "<tr><th>Name:</th><td><input name=""n"" value=" & id & "></input></td></tr>"
%>
All you're doing is supplying the VALUE attribute of the INPUT tag.
Fixed:
<%
dim i
for each x in rs.Fields
IF (x.name="ID") THEN
i=x.value
response.write("<td><a href='form7.asp?id=" & i & "'>"
response.write(x.value) & "<a/>"
'not sure if you want a closing TD here
response.write("</td>") & vbCrLf
END IF
next
%>

Applying style from within an expression

Is it possible to apply style from within an expression?
I'd like to italicize the Name field:
=Fields!Text.Value & " - " & Fields!CreatedDate.Value & " " & Fields!Name.Value
Textboxes contain textruns. Each textrun has its own style. You would need to edit the code to look something like this:
<Textbox>
<TextRun>
<Value>=Fields!Text.Value & " - " & Fields!CreatedDate.Value & " "</Value>
</TextRun>
<TextRun>
<Value>=Fields!Name.Value</Value>
<Style>
<FontStyle>Italic</FontStyle>
</Style>
</TextRun>
</Textbox>
Create placeholders for each of the fields inside a single textbox. This allows you to change the styling for each specific field. I have a post about this on my blog. http://mrthetrain.wordpress.com/2012/09/14/placeholders-2/