C# Web reportviewer create link to page with id - c#

I have a reportviewer and i want a field to act as a hyperlink. The hyperlink must look like: page.aspx?id=1 But how do i achieve this?
I have entered in the properties window, navigation tab, radio "Jump to URL": page.aspx?id=sum(Field!field.value)
This doens't work :(
What do i have to do to get this work?
Thnx in advance
Martijn
PS: I also have EnableHyperlinks set to true;

Your expression under "Jump to URL" should be:
="page.aspx?id=" & sum(Fields!field.value)
Although I see 2 potential issues with that. First of all, if I remember correctly, the URL must be an absolute path (e.g. http://www.test.com/page.aspx). Secondly, I'm not sure why you're summing on a field. If you mean to only get the "current" value of some field, you don't need the aggregate function, but you have to be sure you are inside a control that repeats data for each row of a dataset, e.g. a detail row of a table.

Related

Checking text with Selenium that doesn't appear in the HTML

I need to write a test that checks some fields are updated with the right information when a button is clicked.
The problem is that when the information changes, nothing in the HTML changes.
Is there an alternative to Element.Text to achieve this? As that method doesn't work.
I'm writing my scripts in c# and using Selenium 3.7.0
Steps to automate:
Click a button to draw data from a database and populate fields on the page
Check that these fields now contain the correct data from the database
Start with clicking the element that needs to be clicked to populate your fields. Then you can do something like this:
IWebElement demoDiv = driver.FindElement(By.Id("demo-div"));
string textInElement = demoDiv.GetAttribute("innerHTML"));
.. then use the textInElement variable as you like. What you probably want to do is to make a comparison/assert with your expected value.
I found a solution for this, using Element.GetAttribute("value") returns data within a textbox, whereas I thought it would be looking for the value attribute attached to the element.

Infragistics UltraGrid filter for dataRowError

Using Infragistics.win.UltraGrid, I'm setting dataRowError for certain rows where I want the user to review. Everything looks good, I get a little red icon in the selector column with the proper tooltip; however, I need my user to be able to filter that column to only see the rows with errors.
Is this possible?
Thanks.
Mike
You can change the FilterOperandDropDownItems from its default value to this one
grid.DisplayLayout.Override.FilterOperandDropDownItems = FilterOperandDropDownItems.All;
After this, your users will be able to see an 'Errors' option (as well a 'Non Errors' one) in the filter dropdown
There is a tutorial on the Infragistics site about this.

Restrict items to select by extension in Sitecore8 Internal Link Field

I have an Internal Link Field in a custom template in Sitecore 8. I want the user to use the Link Field to ONLY select a (say) PDF File from the Media Library. When clicking on "Insert Link" the Media Library pops up, scoped to the node I set in the DataSource Field. In here, I want the user to only see PDF files.
Is there any chance this can be done with the Internal Link Field?
Or maybe some other way around that problem? I don't want to have a custom Field Validation that prevents the user from saving the actual item. I'd rather have the user not selecting any "wrong" files for the field.
Thanks in advance.
Out-of-the box you will not be able to do this. You have a few options that I can think of right now:
Change the field type to treelist (or treelistEx) and use Datasource=/sitecore/media library/....&IncludeTemplatesForDisplay=Pdf,media folder&IncludeTemplatesForSelection=Pdf as datasource - your datasource will do exactly what you want but your editors will be able to select multiple pdf's (this can be checked with validation but you wanted to avoid that)
Change field type to droplink and use query:/sitecore/media library/....//*[##templatename='Pdf'] as datasource - now they can only select one, but you get a flat list of items and that might be not that easy to work with
Create a custom field type for a link with datasource: this is more work but could give you exactly what you want and it seems like it has been done before.

list view problem with respect to my problem

I have a listview in wpf and i am swapping two items index..
the swapping must be visible to the user.
i tried giving thread delay..
it didnt work
How to do that..
If I was going to do this I would delete the list view and lock it up where you can't use it again. Then code whatever your list view was outputting in C# using whatever you use to query your database(I think LINQ to SQL is the most robust solution right now) and then use a string builder to construct the html. This way you can assign a id to each div and append an incrementing number to the end of the id. Finally you could write your javascript and use the id's. Here is a link that shows how to build a gridview without using a gridview control.
See the first answer to the question in this link: How to show pop up menu from database in gridview on each gridview row items?
I am not sure whether it will work for your problem or not.
I think you need some kind of animation there. If it is web project, you can use jQuery animation to do that.

Getting the bound field name at runtime

If you bind a control in a FormView using two way binding (such as Text='<% #Bind("FieldName") %>'), how do you retrieve the field name "FieldName"? There are several things I want to do with this information; for example, I have a database table that contains a dump of all the field definitions from ERWin and I want to programmatically create some sort of context-sensitive help for each individual field (there are hundreds spread across dozens of forms).
This is pretty much an exact duplicate of a question asked a year ago but the answer didn't make much sense to me. First, the answer seemed to be for a GridView and not a FormView (e.Row.Cells[0] gave it away). Second, what does SortExpression have to do with anything? Third, it mentions an event argument, but for what event? In OnDataBound, EventArgs e is empty.
There does not appear to be any way to get at this information from a FormView, as the column name is not stored at the level you want it.
However, I must admit that I do not understand why you want to retrieve at runtime something that you know at compile time. Why is it not possible to just write the code you need? Even if you want your code to be more generic, you can create a dictionary of control names and their associated bound column names to pass to your class that does whatever it needs to do.
Regarding the answer to your last question - the GridView stores the column name in the SortExpression property, so that it knows what column to sort by when the user resorts the grid. Hence, in a GridView, you can access the column name through the SortExpression.
An easy way of doing this is to programatically assign the name of the data field to the Tooltip property of your Formview controls, then the data field names will be shown to the user as they mouse over these controls. If you want a more specific answer, please specify if this is what you are trying to accomplish.

Categories

Resources