Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 7/286 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Dynamic Grouping and Columns

    - by Tim Dexter
    Some good collaboration between myself and Kan Nishida (Oracle BIP Consulting) over at bipconsulting on a question that came in yesterday to an internal mailing list. Is there a way to allow columns to be place into a template dynamically? This would be similar to the Answers Column selector. A customer has said Crystal can do this and I am trying to see how BI Pub can do the same. Example: Report has Regions as a dimension in a table, they want the user to select a parameter that will insert either Units or Dollars without having to create multiple templates. Now whether Crystal can actually do it or not is another question, can Publisher? Yes we can! Kan took the first stab. His approach, was to allow to swap out columns in a table in the report. Some quick steps: 1. Create a parameter from BIP server UI 2. Declare the parameter in RTF template You can check this post to see how you can declare the parameter from the server. http://bipconsulting.blogspot.com/2010/02/how-to-pass-user-input-values-to-report.html 3. Use the parameter value to condition if a particular column needs to be displayed or not. You can use <?if@column:.....?> syntax for Column level IF condition. The if@column is covered in user documentation. This would allow a developer to create a report with the parameter or multiple parameters to allow the user to pick a column to be included in the report. I took a slightly different tack, with the mention of the column selector in the Answers report I took that to mean that the user wanted to select more of a dimensional column and then have the report recalculate all its totals and subtotals based on that selected column. This is a little bit more involved and involves some smart XSL and XPATH expressions, but still very doable. The user can select a column as a parameter, that is passed to the template rather than the query. The parameter value that is actually passed is the element name that you want to regroup the data by. Inside the template we then reference that parameter value in our for-each-group loop. That's where we need the trixy XSL/XPATH code to get the regrouping to happen. At this juncture, I need to hat tip to Klaus, for his article on dynamic sorting that he wrote back in 2006. I basically took his sorting code and applied it to the for-each loop. You can follow both of Kan's first two steps above i.e. Create a parameter from BIP server UI - this just needs to be based on a 'list' type list of value with name/value pairs e.g. Department/DEPARTMENT_NAME, Job/JOB_TITLE, etc. The user picks the 'friendly' value and the server passes the element name to the template. Declare the parameter in RTF template - been here before lots of times right? <?param@begin:group1;'"DEPARTMENT_NAME"'?> I have used a default value so that I can test the funtionality inside the template builder (notice the single and double quotes.) Next step is to use the template builder to build a re-grouped report layout. It does not matter if its hard coded right now; we will add in the dynamic piece next. Once you have a functioning template that is re-grouping correctly. Open up the for-each-group field and modify it to use the parameter: <?for-each-group:ROW;./*[name(.) = $group1]?> 'group1' is my grouping parameter, declared above. We need the XPATH expression to find the column in the XML structure we want to group that matches the one passed by the parameter. Its essentially looking through the data tree for a match. We can show the actual grouping value in the report output with a similar XPATH expression <?./*[name(.) = $group1]?> In my example, I took things a little further so that I could have a dynamic label for the parameter value. For instance if I am using MANAGER as the parameter I want to show: Manager: Tim Dexter My XML elements are readable e.g. DEPARTMENT_NAME. Its a simple case of replacing the underscore with a space and then 'initcapping' the result: <?xdoxslt:init_cap(translate($group1,'_',' '))?> With this in place, the user can now select a grouping column in the BIP report viewer and the layout will re-group the data and any calculations based on that column. I built a group above report but you could equally build the group left version to truly mimic the Answers column selector. If you are interested you can get an example report, sample data and layout template here. Of course, you can combine Klaus' dynamic sorting, Kan's conditional column approach and this dynamic grouping to build a real kick ass report for users that will keep them happy for hours..

    Read the article

  • Nautilus tags/labels/marks/columns for folders/files

    - by madox2
    Is there any way how to mark folders or files with tags(or labels, new columns or whatever) in Nautilus? It would be nice to sort marked folders or files through this tags. Especially my first idea was to mark folders in my Movie directory with tags seen, not seen, must see, and so on. Then I realized it would be useful in any other workspaces with any custom tags... Is there any nautilus extension for this? Or any other file manager which can do this? It might look like this:

    Read the article

  • How to Total Rows and Columns in a Word 2013 Table

    - by Lori Kaufman
    If you’re working in Word and you need to total values in a table, you can do so without having to enter the data into Excel and then copy and paste it into Word. Word can do simple calculations such as summing, multiplying, and averaging. NOTE: When you add new rows or columns of values to a table in Word, the formulas will not automatically update. To update a formula, right-click on the formula and choose Update Field from the popup menu. To enter a formula into a cell in a table, put the cursor in the cell and click the Layout tab under Table Tools.     

    Read the article

  • joomla 2.5 : list links to articles in 2 columns

    - by semyon
    I have a Joomla! 2.5 website, and I have to add a lightbox popup that will contain links to all articles from a specific category(+subs). If anyone can suggest all-in-one solution, that will be great! But generally I'm asking, how to list links to all articles from a specific category and its sub-categories in two/three columns? I know I can set Category blog View to output only article links, without full/introtext, but in this case links will all be in one column. I need at least two. A possibility of grouping article links by subcategory would be great as well (but this is the thing I can live without). How can this be done? I'm looking for: a standard way of configuring this Template override (I'm using T3 framework) Custom extension any other method ...

    Read the article

  • A Better Way To Extract Date From DateTime Columns [SQL Server]

    - by Gopinath
    Quite a long ago I wrote about a SQL Server programming tip on how to extract date part from a DATETIME column. The post discusses about using of T SQL function convert() to get date part. One of the readers of the post, tipped me about a better way of extracting date part and here is the SQL query he sent to us SELECT DateAdd(day, DateDiff(day, 0, getdate()), 0); In clean way this query trims off time part from the DATETIME value. I rate this solution better than the one I wrote long ago as this one does not depend on any string operations. According the commenter, this method is faster compared to the other. What do you say? Thanks Yamo This article titled,A Better Way To Extract Date From DateTime Columns [SQL Server], was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • ASP.NET 3.5 Gridview Hyperlink Columns

    One of the most common applications of GridView tables in ASP.NET 3.5 involves hyperlinks. The hyperlink can be database-driven which means it will retrieve hyperlink information from the MS SQL server database in the form of URLs or part of complete URLs. Adding hyperlinks to the Gridview columns can be accomplished using the hyperlinkfield. ... Business Productivity Online Suite From $10 per user per month. Includes a 12-month subscription. Min 5 seats.

    Read the article

  • Listing SQL Columns

    - by Bunch
    When I am writing up stored procedures in SSMS sometimes I need to know what column types are used in a table. For instance I will know the table name but I might not remember exactly the length of a varchar column or if a column stored the data as an integer or varchar. And I may not want to scroll through all the tables in Object Explorer to find the one I want. A lot of times it is easier if I can just write a quick query to pull up the information I need. The syntax to do something like this is pretty easy. SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM yourdbname.information_schema.columns WHERE TABLE_NAME = ‘yourtablename’ After running that you will get a listing in the Results pane just like any other query with the column name, data type and length (if any). Technorati Tags: SQL

    Read the article

  • calculate next line numbers

    - by osomanden
    Weird question I guess.. But I am not very math wiz - soo here goes.. I am trying to create a patterne (or variable patterns based on selection) based on x and y numbers (2 rows and 4 columns) and the direction of the counting of x numbers like: 1-2-3-4 5-6-7-8 That one is easy, when number of x-columns is reached, next line and continue x count. But with eg. this one (still 2 rows and 4 columns): 1-2-3-4 8-7-6-5 upsie.. what if it is eg. 3++ rows and still 4 columns? 1-2-3-4 8-7-6-5 9-10-11-12 what would be the formula for this - or other possible variations (teaser for variations): 9-10-11-12 8-7-6-5 1-2-3-4 or reversed

    Read the article

  • Sorting the columns of an HTML table using JQuery

    - by nikolaosk
    In this post I will show you how easy is to sort the columns of an HTML table. I will use an external library,called Tablesorter which makes life so much easier for developers. ?here are other posts in my blog regarding JQuery.You can find them all here. You can find another post regarding HTML tables and JQuery here. We will demonstrate this with a step by step example. I will use Visual Studio 2012 Ultimate. You can also use Visual Studio 2012 Express Edition. You can also use VS 2010 editions.   1) Launch Visual Studio. Create an ASP.Net Empty Web application. Choose an appropriate name for your application. 2) Add a web form, default.aspx page to the application. 3) Add a table from the HTML controls tab control (from the Toolbox) on the default.aspx page 4) Now we need to download the JQuery library. Please visit the http://jquery.com/ and download the minified version.Then we need to download the Tablesorter JQuery plugin. Please donwload it, here. 5) We need to reference the JQuery library and the external JQuery Plugin. In the head section ? add the following lines.   <script src="jquery-1_8_2_min.js" type="text/javascript"></script>  <script src="jquery.tablesorter.js" type="text/javascript"></script>6) We need to type the HTML markup, the HTML table and its columns <body>    <form id="form1" runat="server">    <div>        <h1>Liverpool Legends</h1>        <table style="width: 50%;" border="1" cellpadding="10" cellspacing ="10" class="liverpool">            <thead>                <tr><th>Defenders</th><th>MidFielders</th><th>Strikers</th></tr>            </thead>            <tbody>            <tr>                <td>Alan Hansen</td>                <td>Graeme Souness</td>                <td>Ian Rush</td>            </tr>            <tr>                <td>Alan Kennedy</td>                <td>Steven Gerrard</td>                <td>Michael Owen</td>            </tr>            <tr>                <td>Jamie Garragher</td>                <td>Kenny Dalglish</td>                <td>Robbie Fowler</td>            </tr>            <tr>                <td>Rob Jones</td>                <td>Xabi Alonso</td>                <td>Dirk Kuyt</td>            </tr>                </tbody>        </table>            </div>    </form></body> 7) Inside the head section we also write the simple JQuery code.   <script type="text/javascript"> $(document).ready(function() { $('.liverpool').tablesorter(); }); </script> 8) Run your application.This is how the HTML table looks before the table is sorted on the basis of the selected column.   9) Now I will click on the Midfielders header.Have a look at the picture below  Tablesorter is an excellent JQuery plugin that makes sorting HTML tables a piece of cake. Hope it helps!!!

    Read the article

  • Powershell: Select-Object with additional calculated difference value

    - by David.Chu.ca
    Let me explain my question. I have a daily report about one PC's free space as in text file (sp.txt) like: DateTime FreeSpace(MB) ----- ------------- 03/01/2010 100.43 DateTime FreeSpace(MB) ----- ------------- 03/02/2010 98.31 .... Then I need to use this file as input to generate a report with difference of free space between dates: DateTime FreeSpace(MB) Change ----- ------------- ------ 03/01/2010 100.43 03/02/2010 98.31 2.12 .... Here are some codes I have to get above result without the additional "Change" calculation: Get-Content "C:\report\sp.txt" ` | where {$_.trim().length -gt 0 -and -not ($_ -like "Date*") -and -not ($_ -like "---*")} ` | Select-Object @{Name='DateTime'; expression={[DateTime]::Parse($_.SubString(0, 10).Trim())}}, ` @{Name='FreeSpace(MB)'; expression={$_.SubString(12, 12).Trim()}}, ` | Sort-Object DateTime ` | Select-Object DateTime, 'FreeSpace(MB)' |ft -AutoSize # how to add additional column Change to this Select-Object? My understanding is that Select-Object will return a collection of objects. Here I create this collection from an input text file(parse each line into parts: datetime and freespace(MB)). In order to calculate the difference between dates, I guess that I need to add additional calculated value to the result of the last Select-Object, or pipe the result to another Select-Object with the calculation as additional property or column. In order to do it, I need to get the previous row's FreeSpace value. Not sure if it is possible and how?

    Read the article

  • How to deal with calculated values with Dependency Properties on a custom WPF control

    - by jpierson
    To summarize what I'm doing, I have a custom control that looks like a checked listbox and that has two dependency properties one that provides a list of available options and the other that represents a enum flag value that combines the selection options. So as I mentioned my custom control exposes two different DependencyProperties, one of which is a list of options called Options and the other property called SelectedOptions is of a specific Enum type that uses the [Flags] attribute to allow combinations of values to be set. My UserControl then contains an ItemsControl similar to a ListBox that is used to display the options along with a checkbox. When the check box is checked or unchecked the SelectedOptions property should be updated accordingly by using the corresponding bitwise operation. The problem I'm experiencing is that I have no way other than resorting to maintaining private fields and handling property change events to update my properties which just feels unatural in WPF. I have tried using ValueConverters but have run into the problem that I can't really using binding with the value converter binding so I would need to resort to hard coding my enum values as the ValueConverter parameter which is not acceptable. If anybody has seen a good example of how to do this sanely I would greatly appreciate any input. Side Note: This has been a problem I've had in the past too while trying to wrap my head around how dependency properties don't allow calculated or deferred values. Another example is when one may want to expose a property on a child control as a property on the parent. Most suggest in this case to use binding but that only works if the child controls property is a Dependency Property since placing the binding so that the target is the parent property it would be overwritten when the user of the parent control wants to set their own binding for that property.

    Read the article

  • MySQL – Grouping by Multiple Columns to Single Column as A String

    - by Pinal Dave
    In this post titled SQL SERVER – Grouping by Multiple Columns to Single Column as A String we have seen how to group multiple column data in comma separate values in a single row grouping by another column by using FOR XML clause. In this post we will see how we can produce the same result using the GROUP_CONCAT function in MySQL. Let us create the following table and data. CREATE TABLE TestTable (ID INT, Col VARCHAR(4)); INSERT INTO TestTable (ID, Col) SELECT 1, 'A' UNION ALL SELECT 1, 'B' UNION ALL SELECT 1, 'C' UNION ALL SELECT 2, 'A' UNION ALL SELECT 2, 'B' UNION ALL SELECT 2, 'C' UNION ALL SELECT 2, 'D' UNION ALL SELECT 2, 'E'; Now to generate csv values of the column col for each ID, use the following code SELECT ID, GROUP_CONCAT(col) AS CSV FROM TestTable GROUP BY ID; The result is ID CSV 1 A,B,C 2 A,B,C,D,E You can also change the delimiters. For example instead of comma, if you want to have a pipe symbol (|), use the following SELECT ID, REPLACE(GROUP_CONCAT(col),',','|') AS CSV FROM TestTable GROUP BY ID; The result is ID CSV 1 A|B|C 2 A|B|C|D|E MySQL makes this very simple with its support of GROUP_CONCAT function. Reference: Pinal Dave (http://blog.sqlauthority.com)Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • Highlighting rows and columns in an HTML table using JQuery

    - by nikolaosk
    A friend of mine was seeking some help regarding HTML tables and JQuery. I have decided to write a few posts demonstrating the various techniques I used with JQuery to achieve the desired functionality. ?here are other posts in my blog regarding JQuery.You can find them all here.I have received some comments from visitors of this blog that are "complaining" about the length of the blog posts. I will not write lengthy posts anymore...I mean I will try not to do so..We will demonstrate this with a step by step example. I will use Visual Studio 2012 Ultimate. You can also use Visual Studio 2012 Express Edition. You can also use VS 2010 editions. 1) Launch Visual Studio. Create an ASP.Net Empty Web application. Choose an appropriate name for your application.2) Add a web form, default.aspx page to the application.3) Add a table from the HTML controls tab control (from the Toolbox) on the default.aspx page4) Now we need to download the JQuery library. Please visit the http://jquery.com/ and download the minified version.5) We will add a stylesheet to the application (Style.css)5) Obviously at some point we need to reference the JQuery library and the external stylesheet. In the head section ? add the following lines.   <link href="Style.css" rel="stylesheet" type="text/css" />       <script src="jquery-1_8_2_min.js" type="text/javascript"></script> 6) Now we need to highlight the rows when the user hovers over them.7) First we need to type the HTML markup<body>    <form id="form1" runat="server">    <div>        <h1>Liverpool Legends</h1>        <table style="width: 50%;" border="1" cellpadding="10" cellspacing ="10">            <thead>                <tr><th>Defenders</th><th>MidFielders</th><th>Strikers</th></tr>            </thead>            <tbody>            <tr>                <td>Alan Hansen</td>                <td>Graeme Souness</td>                <td>Ian Rush</td>            </tr>            <tr>                <td>Alan Kennedy</td>                <td>Steven Gerrard</td>                <td>Michael Owen</td>            </tr>            <tr>                <td>Jamie Garragher</td>                <td>Kenny Dalglish</td>                <td>Robbie Fowler</td>            </tr>            <tr>                <td>Rob Jones</td>                <td>Xabi Alonso</td>                <td>Dirk Kuyt</td>            </tr>                </tbody>        </table>            </div>    </form></body>8) Now we need to write the simple rules in the style.css file.body{background-color:#eaeaea;}.hover { background-color:#42709b; color:#ff6a00;} 8) Inside the head section we also write the simple JQuery code.  <script type="text/javascript"> $(document).ready(function() { $('tr').hover( function() { $(this).find('td').addClass('hover'); }, function() { $(this).find('td').removeClass('hover'); } ); }); </script>9) Run your application and see the row changing background color and text color every time the user hovers over it. Let me explain how this functionality is achieved.We have the .hover style rule in the style.css file that contains some properties that define the background color value and the color value when the mouse will be hovered on the row.In the JQuery code we do attach the hover() event to the tr elements.The function that is called when the hovering takes place, we search for the td element and through the addClass function we apply the styles defined in the .hover class rule in the style.css file.I remove the .hover rule styles with the removeClass function. Now let's say that we want to highlight only alternate rows of the table.We need to add another rule in the style.css.alternate { background-color:#42709b; color:#ff6a00;} The JQuery code (comment out the previous JQuery code) follows  <script type="text/javascript">        $(document).ready(function() {                     $('table tr:odd').addClass('alternate');        });    </script>  When I run my application through VS I see the following result You can do that with columns as well. You can highlight alternate columns as well.The JQuery code (comment out the previous JQuery code) follows  <script type="text/javascript">        $(document).ready(function() {                      $('td:nth-child(odd)').addClass('alternate');        });    </script>  In this script I use the nth-child() method in the JQuery code.This method retrieves all the elements that are nth children of their parent.Have a look at the picture below to see the resultsYou can also change color to each individual cell when hovered on.The JQuery code (comment out the previous JQuery code) follows    <script type="text/javascript">        $(document).ready(function() {          $('td').hover(                  function() {                 $(this).addClass('hover');               },                function() {                    $(this).removeClass('hover');                }                );        });    </script> Have a look at the picture below to see the results. Hope it helps!!!

    Read the article

  • 12c - Invisible Columns...

    - by noreply(at)blogger.com (Thomas Kyte)
    Remember when 11g first came out and we had "invisible indexes"?  It seemed like a confusing feature - indexes that would be maintained by modifications (hence slowing them down), but would not be used by queries (hence never speeding them up).  But - after you looked at them a while, you could see how they can be useful.  For example - to add an index in a running production system, an index used by the next version of the code to be introduced later that week - but not tested against the queries in version one of the application in place now.  We all know that when you add an index - one of three things can happen - a given query will go much faster, it won't affect a given query at all, or... It will make some untested query go much much slower than it used to.  So - invisible indexes allowed us to modify the schema in a 'safe' manner - hiding the change until we were ready for it.Invisible columns accomplish the same thing - the ability to introduce a change while minimizing any negative side effects of that change.  Normally when you add a column to a table - any program with a SELECT * would start seeing that column, and programs with an INSERT INTO T VALUES (...) would pretty much immediately break (an INSERT without a list of columns in it).  Now we can add a column to a table in an invisible fashion, the column will not show up in a DESCRIBE command in SQL*Plus, it will not be returned with a SELECT *, it will not be considered in an INSERT INTO T VALUES statement.  It can be accessed by any query that asks for it, it can be populated by an INSERT statement that references it, but you won't see it otherwise.For example, let's start with a simple two column table:ops$tkyte%ORA12CR1> create table t  2  ( x int,  3    y int  4  )  5  /Table created.ops$tkyte%ORA12CR1> insert into t values ( 1, 2 );1 row created.Now, we will add an invisible column to it:ops$tkyte%ORA12CR1> alter table t add                     ( z int INVISIBLE );Table altered.Notice that a DESCRIBE will not show us this column:ops$tkyte%ORA12CR1> desc t Name              Null?    Type ----------------- -------- ------------ X                          NUMBER(38) Y                          NUMBER(38)and existing inserts are unaffected by it:ops$tkyte%ORA12CR1> insert into t values ( 3, 4 );1 row created.A SELECT * won't see it either:ops$tkyte%ORA12CR1> select * from t;         X          Y---------- ----------         1          2         3          4But we have full access to it (in well written programs! The ones that use a column list in the insert and select - never relying on "defaults":ops$tkyte%ORA12CR1> insert into t (x,y,z)                         values ( 5,6,7 );1 row created.ops$tkyte%ORA12CR1> select x, y, z from t;         X          Y          Z---------- ---------- ----------         1          2         3          4         5          6          7and when we are sure that we are ready to go with this column, we can just modify it:ops$tkyte%ORA12CR1> alter table t modify z visible;Table altered.ops$tkyte%ORA12CR1> select * from t;         X          Y          Z---------- ---------- ----------         1          2         3          4         5          6          7I will say that a better approach to this - one that is available in 11gR2 and above - would be to use editioning views (part of Edition Based Redefinition - EBR ).  I would rather use EBR over this approach, but in an environment where EBR is not being used, or the editioning views are not in place, this will achieve much the same.Read these for information on EBR:http://www.oracle.com/technetwork/issue-archive/2010/10-jan/o10asktom-172777.htmlhttp://www.oracle.com/technetwork/issue-archive/2010/10-mar/o20asktom-098897.htmlhttp://www.oracle.com/technetwork/issue-archive/2010/10-may/o30asktom-082672.html

    Read the article

  • SSIS code smell – Unused columns in the dataflow

    - by jamiet
    A code smell is defined on Wikipedia as being a “symptom in the source code of a program that possibly indicates a deeper problem”. It’s a term commonly used by our code-writing brethren to describe sub-optimal code but I think the term can be applied equally well to SSIS packages too as I shall now explain One of my pet hates about SSIS development is packages that throw warnings of the form: The output column "ColumnName" (1358) on output "OLE DB Source Output" (1289) and component "OLE_SRC Name" (1279) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.  The warning is fairly self-explanatory – any column that appears in the data flow but doesn’t get used will throw this warning when the data flow is executed. Its not the negligible performance degradation that they cause that bothers me though, it’s the clutter that they cause in your log file/table. Take a look at the following screenshot if you don’t believe me: There are 231409 such warnings in the system that I took this screenshot from, that is 231409 log records that should not be there. The most infuriating thing about this warning is that it is so easily avoidable; eliminating such columns is a very quick and easy thing to do in the SSIS Designer. The only problem I see is that the warnings don’t occur until you execute the package – it would be preferable for the designer to have an unobtrusive way of informing you of them as well. Anyway, I digress… I consider such warnings to be a code smell because, to me, they’re symptomatic of a lack of due care and attention; a lack of developer discipline if you will. What other code smells can you think of when building SSIS packages? If I get a good list in the comments maybe I’ll compile them into a later blog post. @Jamiet Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

    Read the article

  • How to generate SPMetal for a specific list (OOTB: like tasks or contacts) with custom columns

    - by KunaalKapoor
    SPMetal is used to make use of LINQ on a list in SharePoint 2010. By default when you generate SPMetal on a site you will get a code generated file for most of the lists and probably more. Here is a MSDN link for some info on SPMetal.http://msdn.microsoft.com/en-us/library/ee538255(office.14).aspxBut what if you want only to generate the code for one list?Well it is quite simple once you figure it out. You need to add an xml file to override the default settings of SPMetal and specify it in the /parameters option. I will show you how to do this.First create a Folder that will contain two files (GenerateSPMetalCode.bat and SPMetal.xml).Below is the content of the files:GenerateSPMetalCode.bat "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMetal" /web:http://YourServer /code:OutPutFileName.cs /language:csharp /parameters:SPMetal.xml pause SPMetal.xml <?xml version="1.0" encoding="utf-8"?> <Web AccessModifier="Internal" xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal"> <List Name="ListName"> <ContentType Name="ContentTypeName" Class="GeneratedClassName" /> </List> <ExcludeOtherLists></ExcludeOtherLists> </Web> You will have to change some of the text in the files so that it will be specific to your SharePoint Server Setup. In the bat file you will have to change http://YourServer to the url of the web where your list is. In the SPMetal.xml file you need to change ListName to the name of your list and the ContentTypeName to the name of the content type you want to extract. The GeneratedClassName can be anything but perhaps you should rename it to something more sensible.Adding the following line: '<List Name="ListName"><ContentType Name="ContentTypeName" Class="GeneratedClassName" /> </List>'  makes sure that any custom columns added to an OOTB list like contacts or tasks are also generated, which are missed out in a regular generation.So now when you run it the SPMetal command will read the SPMetal.xml list and override its commands. ExcludeOtherLists element makes it so that only the code for the lists you specify will be generated. For some reason I got an error if I had this element above the List element.You sould now have a code file called OutPutFileName.cs that has been generated. You can now put this in your SharePoint project for use with your LINQ queries against that list.I will soon write a LINQ example that uses the generated class. UPDATE: Add the /namespace parameter to add a namespace to the generated code. "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMetal" /web:http://YourServer /namespace:MySPMetalNameSpace /code:OutPutFileName.cs /language:csharp /parameters:SPMetal.xml

    Read the article

  • Select proper columns from JOIN statement

    - by Alexander Stalt
    I have two tables: table1, table2. Table1 has 10 columns, table2 has 2 columns. SELECT * FROM table1 AS T1 INNER JOIN table2 AS T2 ON T1.ID = T2.ID I want to select all columns from table1 and only 1 column from table2. Is it possible to do that without enumerating all columns from table1 ?

    Read the article

  • Rearranged columns in C#

    - by chown
    How can I get the rearranged columns out of a datagridview in C#? I need to get all the columns currently being displayed in order. I can get the default columns order by setting datagridview.AutoGenerateColumns=false but I get the same old order even after I've rearranged the columns in my table. Thanks

    Read the article

  • removing null valued columns from dataset in asp .net

    - by N.Sai Harish
    I have a table which stores data with null valued columns for some entries .I want to retrieve only Not null data to the detail view. I tried the following foreach(string strTableField in (objDataSet.Tables[0].Columns[i])) { if(objDataSet.Tables[0].Columns[i].Equals(null)) { objDataSet.Tables[0].Columns.Remove(strTableField); objDataSet.Tables[0].AcceptChanges(); } i++; } but it is giving error .. Pls help me reg this ...

    Read the article

  • many-to-one with multiple columns

    - by Sly
    I have a legacy data base and a relation one-to-one between two tables. The thing is that relation uses two columns, not one. Is there some way to say in nhibernate that when getting a referenced entity it used two columns in join statement, not one? I'm trying to use this: References(x => x.Template) .Columns() .PropertyRef() But can't get how to map join on multiple columns, any ideas?

    Read the article

  • Finding the maximum value/date across columns

    - by AtulThakor
    While working on some code recently I discovered a neat little trick to find the maximum value across several columns….. So the starting point was finding the maximum date across several related tables and storing the maximum value against an aggregated record. Here's the sample setup code: USE TEMPDB IF OBJECT_ID('CUSTOMER') IS NOT NULL BEGIN DROP TABLE CUSTOMER END IF OBJECT_ID('ADDRESS') IS NOT NULL BEGIN DROP TABLE ADDRESS END IF OBJECT_ID('ORDERS') IS NOT NULL BEGIN DROP TABLE ORDERS END SELECT 1 AS CUSTOMERID, 'FREDDY KRUEGER' AS NAME, GETDATE() - 10 AS DATEUPDATED INTO CUSTOMER SELECT 100000 AS ADDRESSID, 1 AS CUSTOMERID, '1428 ELM STREET' AS ADDRESS, GETDATE() -5 AS DATEUPDATED INTO ADDRESS SELECT 123456 AS ORDERID, 1 AS CUSTOMERID, GETDATE() + 1 AS DATEUPDATED INTO ORDERS .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   Now the code used a function to determine the maximum date, this performed poorly. After considering pivoting the data I opted for a case statement, this seemed reasonable until I discovered other areas which needed to determine the maximum date between 5 or more tables which didn't scale well. The final solution involved using the value clause within a sub query as followed. SELECT C.CUSTOMERID, A.ADDRESSID, (SELECT MAX(DT) FROM (Values(C.DATEUPDATED),(A.DATEUPDATED),(O.DATEUPDATED)) AS VALUE(DT)) FROM CUSTOMER C INNER JOIN ADDRESS A ON C.CUSTOMERID = A.CUSTOMERID INNER JOIN ORDERS O ON O.CUSTOMERID = C.CUSTOMERID .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } As you can see the solution scales well and can take advantage of many of the aggregate functions!

    Read the article

  • RowFilter.regexFilter multiple columns

    - by twodayslate
    I am currently using the following to filter my JTable RowFilter.regexFilter( Pattern.compile(textField.getText(), Pattern.CASE_INSENSITIVE).toString(), columns ); How do I format my textField or filter so if I want to filter multiple columns I can do that. Right now I can filter multiple columns but my filter can only be of one of the columns An example might help my explanation better: Name Grade GPA Zac A 4.0 Zac F 1.0 Mike A 4.0 Dan C 2.0 The text field would contain Zac A or something similar and it would show the first Zac row if columns was int[]{0, 1}. Right now if I do the above I get nothing. The filter Zac works but I get both Zac's. A also works but I would then get Zac A 4.0 and Mike A 3.0. I hope I have explained my problem well. Please let me know if you do not understand.

    Read the article

  • ASP.NET - Overriding Gridview OnRowCreated to add sort images -- columns are null

    - by Zach
    I'm overriding the onrowcreated to add sort images to the header row of a gridview. This works, but actually adding a sortexpression doesn't. What I want to do is set the images as imagebuttons and set their commandarguments to the sort expression of the column they are sorting for. I would assume I could get the cell and from it's index get the gridviewcolumn. Then, I could just get the sortexpression of the gridview column, but this does not work. The columns are null. OnRowCreated Code snippet below: //if this is the header row, we add sort images to each cell if (row.RowType == DataControlRowType.Header) { //iterate through the cells for (int i = 0; i < row.Cells.Count; i++) { //if the column is sortable and visible if (this.Columns[i].SortExpression != string.Empty && this.Columns[i].Visible) { string strSort = this.Columns[i].SortExpression; } } } Can we not get columns in OnRowCreated like this?

    Read the article

  • How to facet multiple columns in Google Refine

    - by banjanxed
    I have a data set with 30 columns and multiple rows (some cells have no data). I would like to be able to facet the columns in groups. 1 2 3 4..... Row1 A B C D Row2 E A D F Row3 Q A B H Given the above data I would like the facet to retun the number of instances in a group of columns. For the first three columns I need the facet to return: A - 3 B - 2 C - 1 D - 1 E - 1 Q - 1 I have tried to combine columns when I loaded the data but the individual data was grouped as well. This is not the desired outcome. For example: ABC - 1 EAD - 1 QAB - 1 Thanks in advance.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >