SSRS create hyperlink on report to aspx page of my application with some value as querystring. - hyperlink

I want to send SSRS report field as querystring paramater to my application page. for this I have done following steps:
To add a hyperlink in report:
In report design view, right-click the text box I want to add a link and then click Properties.
1.In the Properties dialog box, click Action.
2.Select Go to URL. An additional section appears in the dialog box for this option.
3.In Select URL, in expression that evaluates to a URL, in pasted my pages url and concatenated it with field value in the below manner.
http://localhost:64970/InvoiceManagement.aspx?a=Fields!INVOICE_NUMBER.Value
Click OK.
but on running report and clicking on the hyperlink, it redirects me well but in querystring i got Fields!INVOICE_NUMBER.Value, it doesnt get replaced by its value(database value which is int), which should be the Invoice number.
where I am going wrong..

Your field is being evaluated as a literal string. You need to write a function to generate the URL:
="http://localhost:64970/InvoiceManagement.aspx?a=" & Fields!INVOICE_NUMBER.Value
There should be a function box for URL target you can click in the properties dialog, or you could paste the function code in over your URL's text. Note: I'm using VS to manage my SSRS reports, and I'm unsure if these methods are the same for BIDS, if that's what you're using. The problem is the same either way, though.

Related

Create links in Kentico reports

I'd like to add clickable links to a Kentico Report. The report editor allows you to add all kinds of HTML mark-up in the layout, but it doesn't allow you to add HTML INSIDE of a table that you've inserted into the layout. (Or if it does, it is not obvious from the UI, or from the Kentico documentation.) I want a link to appear in each row, and the link should include a value from that row.
Clicking any of the links would open another page that shows more data about a particular record. In my case, my first column is an ID column and I want its value (in each row) to behave like a hyperlink to another page whose URL includes the clicked ID value as a parameter.
We can use jquery within our Kentico report to allow each value in a particular field to cause a link to be opened when clicked. In my case, I have a URL into which I want to embed an ID value from the report. I want to open one of the admin pages whose URL looks like the following (where 9999 is replaced with a record ID from my report):
/CMSModules/AdminControls/Pages/UIPage.aspx?elementguid=00000000-0000-abcd-0123-000000000000&objectid=9999&displaytitle=false
So let's assume the first field in the report is an ID column and we want to make the displayed ID behave like a link to some other page.
First we need jquery. Edit the report's layout in '<>Source' mode and add a script reference for jquery, such as one you can get from code.jquery.com, or just reference it locally if you have it:
<script src="/jquery-3.4.0.min.js"></script>
Next, we must find each ID field and then make it behave like a hyperlink. To do so, we find the <th> with the ID column's title, walk up to the <table>, and then find all <tr>s immediately under the <tbody>. Once we have each <tr>, we iterate through them to:
underline the ID value like a hyperlink
set the cursor to a hand like a hyperlink
add an onclick event to do open a URL (in a new tab) with my ID field's value
So here is the script. Add it just like you added the jquery script tag. (but add it after the jquery script tag)
<script>
$('th:contains("MyIDColumnTitle")').parents('table').first().children('tbody').children('tr').each(function() {
$(this).children('td').first()
.css('text-decoration','underline')
.css('cursor','pointer')
.click(function(){
var thisId = $(this).text();
var u = "/CMSModules/AdminControls/Pages/UIPage.aspx?elementguid=00000000-0000-abcd-0123-000000000000&objectid=" + thisId + "&displaytitle=false"
window.open(u,'_blank');
});
});
</script>
Keep in mind that if MyIDColumnTitle is not very unique, this script may find the wrong th and table. Modify the jquery selector to suit your needs. You may want to add a wrapping element around your report that has an element ID so you can be specific with your selector.
It wouldn't be difficult to take the same concept and use it to launch a page in a modal dialog instead.

MVC post not getting the updated value of a mvc textbox, when we change the content of a txtbox via jquery in client side which is copied from a pup

We have a MVC textbox(orignal textbox) in our form that expects time formatted string(eg:10:30), and we have provided a normal button next to it that opens a pop-up and user can see another textbox inside that which can be used for entering time in decimal format(eg:10.5)
then the pop-up shows the converted decimal to time format ie; 10:30. If user clicks OK then we takes the accepted value from the popup to orignal text box in the form.
The above user actions are done via jquery, we shows up jquery poupup and normal html input text box and takes the value back to original ASP.net MVC text box control.
All is fine, even jquery works fine. we have even checked the value of the original text box in javascript from DOM in Developer tool, But the value property of the original text is still the old value what we received when we opened our form - but when we checked the value using javascript in developer tool watch- its our new value.
Looks like our update in the value on the textbox is not posting to server.
Do anyone have any idea to make this working?

How can we add popup in FitNesse?

I want to add an hyperlink or a button in my FitNesse page.
On click of this link or button a popup window with some HTML content should open.
Please let me know if this is possible in FitNesse? If yes, how to achieve this?
I tried to search on FitNesse website but could not get information.
Adding a link to a wiki page is easy: just type the link, or use [[word or phrase][url]]. But this will not open a pop-up. I don't know how to achieve that by just using the wiki.
In a Slim fixture's result you can return any HTML (sometimes you will have to surround it with <div></div>), so you can return ... and in the test result there will be a hyperlink that will open in a new tab...

Asp.Net Mvc remote validation textbox focus issue

I have a single textbox on a form - basically to allow users to change the URL of their site in our mini CMS. We use remote validation to check that the URL is not already taken.
They enter their desired URL and hit the save button. If they do just that and the focus goes from the textbox straight to the submit button - the validation does not happen and the form doesn't submit properly. If they tap into an area of whitespace then the form does.
The issue with the form submitting is that if they tap whitespace we get the name of the submit button posted along with the desired URL - we use the (AcceptParameterAttribute) to allow us to route form submits to the right Action. This uses the submit buttons name attribute to do this. If they don't click whitespace to lose focus on the text box then only the desired URL is posted.
This is a really odd one and it is very annoying. Has anyone seen anything like this before? Is there a way to overcome the problem?
Try adding the following script to the page:
$(":input").live("blur", function () {
$(this.form).validate().element(this);
});
This should cause validation to occur when you click on the submit button. If not, try changing the first line to:
$(":submit").live("click", function () {

Html.Action link and Html.RouteLink

Even If the url is same can i go to different action using Html.RouteLink and Action Link.Like when i click on news link i will go to news details.The url of this page is http://localhost:1390/en-US/latestnews/125.Now if i select the ddl of language in the site header in this pagei need to
go to the home page of the site.The ddl (on change) will take the same url but this time it needs to go to action in the sane controller.
The URL will direct to the controller/action on the first routing entry that it matches regardless of how you generate it. I'm not sure exactly what you are trying to accomplish, but I suspect that what you need to do is use javascript to direct to a different url, perhaps generated with Html.RouteLink instead of Html.ActionLink based on the value of the drop down list when it's selected. If I'm misunderstanding what you are trying to do, please clarify.

Resources