XSLT Creating A Table With Varying Amount Of Columns
Apr 20, 2010
I have a RSS feed i need to display in a table (its clothes from a webshop system). The images in the RSS vary in width and height and I want to make a table that shows them all. First off i would be happy just to show all of the items in 3 columns, but further down the road i need to be able to specify through a parameter the amount of columns in my table. I run into a problem showing the tr tag, and making it right, this is my Code so far:
<xsl:template match="item">
<xsl:choose>
<xsl:when test="position() mod 3 = 0 or position()=1">
<tr>
<td>
<xsl:value-of select="title"/>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<td>
<xsl:value-of select="title"/>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
In RSS all "item" tags are on the same level in the xml, and thus far i need only the title shows. Thr problem seems to be that i need to specify the start tag as well as the end tag of the tr element, and cant get all 3 elements into it, anyone know how to do this?
View 1 Replies
Similar Messages:
Apr 27, 2016
I have a stored Procedure, which copies the data in one table to another table in other DB.
I have the query to copy the records to other table.
But, tomorrow, new columns are added to the source table, then, how to dynamically copy the data from those columns to the destination column..
View 1 Replies
Oct 10, 2010
I am upgrading a classic asp page, the page uses response.write to make a table, as soon as a null value comes up for a month the columns of the grid then stop. The sql is below
SELECT sName, Strategy,
Sum(case when Month([Date])=1 then Rtn else null end) as Jan,
Sum(case when Month([Date])=2 then Rtn else null end) as Feb,
Sum(case when Month([Date])=3 then Rtn else null end) as Mar,
Sum(case when Month([Date])=4 then Rtn else null end) as Apr,
Sum(case when Month([Date])=5 then Rtn else null end) as May,
Sum(case when Month([Date])=6 then Rtn else null end) as Jun,
Sum(case when Month([Date])=7 then Rtn else null end) as Jul,
Sum(case when Month([Date])=8 then Rtn else null end) as Aug,
Sum(case when Month([Date])=9 then Rtn else null end) as Sep,
Sum(case when Month([Date])=10 then Rtn else null end) as Oct,
Sum(case when Month([Date])=11 then Rtn else null end) as Nov,
Sum(case when Month([Date])=12 then Rtn else null end) as Dec
FROM Chess
If this is run in oct i only have data from jan -0ct , how do i not display nov and dec so that its dynamic?
View 1 Replies
Oct 7, 2010
I am trying to create a recipe system that will pull material amounts from an already built inventory database upon request for testing purposes of the different recipe runs. What is throwing me for a loop is that each time a user will request a recipe comparison they will have a different number of recipe trial runs for comparison purposes. In order to do this I'm guessing you will need to generate a gridview-like control with a dynamic number of columns which would be specified on a web form page prior to arriving at the recipe formulation page which will contain the control for the recipe formulation. As a result the user will have different columns and rows on this formulation page, with the rows being a static number of 30 (30 being maximum amount of ingredients to include in each recipe). The columns will contain the recipes to be compared, i.e. ProductRun1, ProductRun2, ProductRun3, where the number of ProductRunX will be determined by user input. So the user when they come to this aspx page will be presented with a blank editable grid of X columns by 30 rows deep. The left-most column will contain the ingredient names in a drop down box for users to select to input into their recipe and the rest of the columns will be editable fields where the user can type in the amount of each material to be used. The setup will look roughly like this:
| ProductRun1 | ProductRun2 | ProductRun3 |
ProductRun4 | ... |
-------------------------------------------------------------------------------------------------------
Material1 | Material1_Amt | Material1_Amt | Material1_Amt | Material1_Amt | ...|
-------------------------------------------------------------------------------------------------------
Material2 | Material2_Amt | Material2_Amt | Material2_Amt | Material2_Amt | ...|
-------------------------------------------------------------------------------------------------------
Material3 | Material3_Amt | Material3_Amt | Material3_Amt | Material3_Amt | ...|
-------------------------------------------------------------------------------------------------------
(...)
-------------------------------------------------------------------------------------------------------
Material30 | Material30_Amt | Material30_Amt | Material30_Amt | Material30_Amt | ...|
-------------------------------------------------------------------------------------------------------
So my question is how would I go about tackling something like this and what controls would I use. All of the forum posts around the internet show the GridView control being tied to data in a database already and not having the ability to have a fully blank and editable table upon the page loading so that it can accept user input. Another wrench into the situation is that the column numbers can vary. What control would be used in this situation or would it be better to use just a repeater of textboxes to build this type of control? Another thing is once the control is built how can you pull the data from such a control with the intentions of entering it inside a sql server database?
View 44 Replies
Feb 2, 2011
I am creating a temp table and populating it's two columns manually and the rest of the table from the data returned by the stored procedure. When I added the first column called custno as @CustNumber, it allowed me to add it fine and the rest of the columns were filled by the stored procedure as expected. I then needed to add another column called RepeatCustomer the same way but it keeps saying:
Msg 207, Level 16, State 1 Invalid column name 'Repeatcustomer' So eventhough I have added Repeatcustomer column it's not seeing it. Any one has seen this error before or know what's wrong with this code. Note when I parse the query it's fine, it only fails upon the execution.
[Code]....
View 4 Replies
Mar 2, 2010
How do you create an XSLT file from an xml file with an existing XSD file
View 1 Replies
Dec 29, 2010
[Code]....
View 2 Replies
Dec 7, 2010
comes with another calculation query.In this one I like to get the total amount for the customer in the OrderDetail table. I can't figure out how to do it. And I only want to receive one row. With this SP I get all rows in the orderDetail table.
[Code]...
View 6 Replies
Dec 17, 2010
I am working with GridView, When huge amount of Data is inserted in the GridView its columns became very thin all tall, however I want to Display the Gridview with Fix size and if the Data is hugeit only display the starting few words of Data.in other words I want to use gridView same like the GMAIL account where Data Display like this. .
View 2 Replies
Mar 5, 2010
I'm creating a table in an asp.net code behind dynamically, and I want to have a footer row that only has 2 cells. The first should span all the columns in the table-1. Is there some way other then keeping track of the # of columns in the table manually for me to set the colspan to be # of all the columns in the table-1? Preferably a HTML or CSS solution?
View 2 Replies
Feb 21, 2011
I've the following code which successfully makes an average for all the columns from a table. What I need to do though is ignore certain columns in this equation.
Dim totalNumber as Double = 0
Dim count as Integer = 0
For x = 0 To xyz123.Tables(0).Columns.Count - 1
Dim current as Double = 0
If Double.TryParse(xyz123.Tables(0).Rows(0)(x).ToString(), current) AndAlso current <> 0 Then
count += 1
totalNumber += current
End If
Next
Dim averageRating as Double = totalNumber / count
View 2 Replies
Mar 10, 2011
I'm working on setting up a Gridview that dynamically creates new "columns" after a set amount of rows. To do this, I bind a datasource to the Gridview and then add new cells and shift the other items into those cells. I seem to be having an error with the link buttons that I move around. All of the items get put in there correct location, but for some reason, when I click a link button that has been added to a new cell, the sender's text is the LinkButton in the original cell's text. Does anyone know why this would be happening? Is the gridview not meant to be manipulated after it has been data bound? This is the code that I use to update the gridview.
[Code]....
View 2 Replies
Sep 1, 2010
i have a table that has some columns and rows i want this table to have borders that are visible inside it i want every column an row to be closed in borders how can i do that?
View 1 Replies
Jan 14, 2011
I have a DataTable where the columns are generated programmatically at runtime. I then bind this DataTable to a GridView. What I'm wondering is how I can create the GridView to accommodate this, and if it's not possible, how I can output the DataTable into nicely formatted HTML.
View 3 Replies
Jun 2, 2010
how to populate the asp:menu from xml directly. But my issue is to do everything from server side. I am using dom model in my dev and so I have to get the nodes from xml dynamically and populate into the Menu and create a flyout with 2 columns on hover of each menu item. Would be great if someone can provide with a custom code to achieve this.
View 2 Replies
Sep 15, 2010
I have a problem. I have a textbox where i enter the amount and in another textbox the amount in words comes automatically. The function appended below works fine when the amount entered is without a decimal. But if the amount entered has a decimal, then the function gives an error. Can anyone check the same and tel me a solution.Wat i want is suppose the amount entered in 2345.68 the amount in words should come, Rupees two thousand three hundred forty fve and sixty eight paisa only. if the decimal is not entered then the function gives proper result.
[Code]....
View 2 Replies
May 11, 2010
I am using ASP.NET 2008 Visual Basic Language. I tried to create a function that multiply two values from two different tables and get the result presented in a label. The value is retrieved by referring to the primary key after the user selects from a DropDownList which is in another page using sessions.
I tried to build this code in the Load_Page event but it didn't display for me the total.
[Code]....
View 4 Replies
Jun 18, 2010
I want to create columns in gridview dynamically based on rows in a table and each gridview colum should have a checkbox. When I Click the save button, I want to save the checkbox state. How Can I do this ?
View 2 Replies
Aug 9, 2010
I'm building an ASP.NET MVC 2 site where I'm using the OutputCache parameter heavily. However, I have a concern: using such caching may interfere with authentication.On all of my pages, I display whether the user is logged in or not. Furthermore, in some of my Views, I do filtering based on user role to determine whether or not to display some page content (for example, the Edit link on one of my pages is only shown to users in the roles of Moderator or Administrator)
View 2 Replies
Sep 14, 2010
how to create dynamic template columns in gridview .
I have writing some of the code but it gives me error
The type or namespace name 'GridViewLabelTemplatecould' not be found (are you missing a using directive or an assembly reference?)
I have paste some my code
[Code]....
View 8 Replies
Mar 16, 2011
i have a gridview which is populated from a stores proc using pivot tables. The column are created dynamically apart from a total column which is created as a template field. the gridview looks like below:
CPW
EE
Foh
H3G
IND
O2
ORG
P4U
T-M
TSC
VIR
VOD
Total
Stores Visited
70
0
0
12
0
16
18
7
11
1
2
8
145
i need to add a hyperlink to each gridview cell and when that cell is clicked pass the header text through the querystring to another page. I can access the cells value ok and pass that through but i cannot seem to access the cells column header text. when i response.write out a count of the gridview.columns it brings back 2 which is the template fields but not the dynamic fields i have tried this on the rowdatbound, rowcreated, page_load and page_unload. the count should be 12 its like it cannot find the dynamic columns at all. ?
here is my code for populating the gridview
[Code]....
and here is my gridview:
[Code]....
i am also moving the total column in this code
[Code]....
and calculating my total in this code and adding my link to the total colum (which works fine)
[Code]....
now i just need to somehow add a link to the other cells and somehow get the value of the header text for that cell clicked.
View 2 Replies
Jul 1, 2010
In the ASP.NET MVC site that I'm writing, I'm building a generic Error Action that is routed to by an HttpModule, following this tutorial. In this Action, I will return a View corresponding to the status code that is applied to the response inside the HttpModule (after doing this, the module transfers the request over to the Action in question).
That's all good, except that I want to implement caching. I don't want to use the OutputCache attribute without filtering/varying, because that would mean that the page would be cached once. I want the page to be cached once for every possible status code.
Is it possible to somehow filter/vary with OutputCacheAttribute's properties, so that each Response.StatusCode is cached separately?
View 1 Replies
Jul 4, 2010
Note: You may not need to read the whole thing to know what's wrong... skip down to the part about the 3 scenarios if you'd like. Only read the begin if you'd like some background info on how I've tried implementing this and where the errors occurred.To begin with, I'm trying to retrieve a list of Clients stored in the CRM_Clients table for a given callerId.I retrieve the clients from my Controller with the SelectLiveClientsForCaller method. The message is then passed on to the DAL through the static Instance method in the DataProvider class:
public List<Client> SelectLiveClientsForCaller(int callerID)
{
List<Client> results = new List<Client>();
[code]...
View 3 Replies
Mar 14, 2011
i have atable that contains (id, name, commission) i need to have the sum of commission where name=a as'first' and the sum where name=b as 'second' in the same row
View 2 Replies
May 18, 2012
In asp.net, I am having a data table with the column ID, Name, AGe, Rank.
I need to get the records from the Column ID, Name and have to create a new data table with this column and rows.
View 1 Replies