.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Missing fields when filter applied

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
Hello all, I hope someone can help as I can't figure it out!I shall try my best to explain. I have a report to show all sales quotes by status code (first group), then by Category code (2nd Group) and then by sales quote (3rd group) for the first 2 groups there is a coulmn to show no. of quotes using a CountDistinct expression. My issue is as follows, when running the report by month (Jan, Feb then Mar etc) and taking the total number of quotes for each month and adding them up manually gives a different total when running the report for alll months together (Jan-Mar). For example: Month      No. of Quotes (this is calculated using CountDistinct so not sure if this is the problem?) Jan:          10 Feb:          11 Mar:          8 Total:        29 When run for Jan-Mar I get a total of 25. Looking at the lines there are quotes missing (when running the report for all (Jan-Mar)) but when run by month the quotes appear?

View Complete Post

More Related Resource Links

Exception occurs when checking in document with missing required fields

I have a document library with required fields. When the user uploads a document and closes the Properties window without entering the required fields, the document is still uploaded, but is left checked out. If the user subsequently attempts to check in the document without first editing the properties to supply values for those required fields, an exception is thrown and the user sees the following: Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed. The Event Log shows the following: Exception message: You must fill out all required properties before checking in this document. Request path: /_layouts/checkin.aspx Stack trace: at Microsoft.SharePoint.ApplicationPages.Checkin.OnLoad(EventArgs e) ... I would like to trap this error and present it to the user or somehow prevent the check-in event from getting far enough to cause this exception. I have tried coding something like this: public override void ItemCheckingIn(SPItemEventProperties properties) {     try     {         base.ItemCheckingIn(properties);     }     catch (SPException ex)     {         properties.Cancel = true;      &n

Filter and Sort on fields in a joined dataview in SharePoint Designer


I need to create a data view that joins and displays data from two lists, and to sort and group on all of the fields displayed, not just fields from the main list.

I created linked datasource from two of my lists, joined them on a common field, and first inserted fields from the main list. Then I inserted fields from the other list as a Joined Subview,  which worked just fine, but now I need to be able to sort and filter on fields in that joined list, for which there doesn't seem to be an option.

Does anybody know whether it's possible and/or any workarounds/solutions for this? Basically, Is there a way to create a joined view of two lists where all fields are displayed in separate columns, and not in a table within a cell as in a case with joined subview?

Any comments are highly appreciated.


Report exported to Excel 2007 is EXTREMELY slow once a filter is applied.


I am exporting a 12,000 row, 20 column report to Excel from SSRS 2008.  Once opened in Excel, everything is fine.  If I further filter the data through Excel (no external data connections) performance degrades.  If I filter down to say 20 rows, it nearly completely bogs down my entire PC.  I've emailed this spreadsheet to several others, who then experience the same issue.

If I export this same set of data from a different BI tool, such as Microstrategy, there are no performance issues what so ever.

SharePoint 2010 External Content Type and InfoPath 2010 - Numeric data type fields missing in InfoPa


Connected SQL data table to SP 2010 ECT from SQL table.  The SQL table has several fields that have a type of "numeric(3,0)".  The SP 2010 list shows all fields form SQL.  When we open up InfoPath Designer and reference the SP List data (from SQL) all of our numer fields are missing from the available fields list.

I amd going to try another data type but that hardly feels like a solution.  If anyone has any ideas please let me know!

Calculated fields with cube filter



We have a simple calculated field in a cube that looks like this:

[Measures].[Value] * [Measures].[Factor]

This works great when we slice it year by year in rows. The problem is when we use year as a filter in the cube browser (BIDS) we always get the same total, no matter what years we have selected.

How can we make the filter work with calculated fields?

Best Regards


How do I Filter on fields and not Record Limits for External Content Types


I have created an External Content Type that connects to an SQL server/table.  I would like to set a filter on CompanyType so that my external list only shows records where CompanyType = Owner.  The only examples of Filter examples that I have found are dealing with record counts.


Leland Usher SharePoint Developer/Administrator

Custom filter - Looking in 2 fields


I'm using DD and VS 2010 in my application.

I have two dates (Start Time and PLN Start Time). In my filter, when the user choose a date, if the Start Time is null, I need to verify the PLN Start Time. Something like the code bellow:


        public DateTime StartTimeFilter
                if (this.StartTime.HasValue)
                    return Convert.ToDateTime(this.StartTime);
                    return Convert.ToDateTime(this.PLNStartTime);

How I can insert that column in my page filter ?

Column filter in Business Data List web part does not work for all fields


I have a BDC entity whose fields contain a variety of data – numbers, dates and strings.  When I use the business data list web part I find that some of the columns’ dynamic filtering (accessed from the list’s column header) doesn’t work.  For these problem fields, the filter values load correctly but when I select a value all records disappear.  Initially I thought this was limited to just string columns but there is one string column that does filter correctly.

Here are some things that may be useful to know:

1.       The datasource is a SQL view and all fields are varchar(255)


custom field type works in view properties, but not in list view: 3 parent fields filter child list,


My situation:

A) odd thing is that no matter where I put a stop point in my custom field type, it is NEVER hit when the items are displayed in list view.  Event with <Field Name="CAMLRendering">TRUE</Field> which causes the list to error out, but again no stop point to help me know why.

B) the value of the column in question will be different for every user who views the list, I'm querying a secondary list based on the user's loginName, and two of the fields from the list we're in. 

C) the display is customized based on whether any records were returned and the current DateTime, so possible displays would be "", "! 12/1/2010", and "7/7/2011"

D) and the text displayed links over to a form for them to do their assignment. the link url would be a config setting url + "?[one of the fields form the list we're in]"

My questions:

1) Is it possible for fieldtype code to execute while a list view is being rendered?

2) If not, then should I chase down the path of a content query webpart?  Will it be able to filter on the current users login name?

3) If not on 1 or 2, can you think of any other way to do this beyond creating a custom application page? (need to having filtering and sorting on this page)

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Content Query Web Part missing in SharePoint 2010

If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

Where to Filter the companies returned by the EF?



I am just starting with dynamic data. I have an enttity framework called UsersModel.edmx.

It returns a list of all companies in the tblCompany table. This list is really big.

I need to filter the list returned to all user controls on the client so that it only returns the company that have a CompanyTypeId= 2 or CompanyTypeId= 3 and company name != "".

1 - Is it possible to filter the company list returned on the server so that I can filter only once for all the controls that use that on the client?

My ideas was to do something like this using linq and lambda but I am not sure how:

return tblCompanys.Where(c => c.CompanyTypeId == 2 || c.CompanyTypeId == 3 && ).Where(c=>c.CompanyName != "").OrderBy(c => c.CompanyName).Distinct().OrderBy(c=>c.CompanyName);

2 - I have created a partial class and a metadata class and added the DisplayColumn attribute to use the company name and sort by company name ascending.

Could I use the code to filter the returned companies in this? where?

namespace MarsMedicalModel
    [DisplayColumn("CompanyName", "CompanyName")]
    public partial class t

Filter by Computed Column



After looking for a driver to open legacy dbf drivers to connect, the next level trouble a have is this one:

first, i can retrieve the data but when trying to filter by a parameter (somesc columns) i get an error.

The error says about the database can't determine some blah blah!

The error is a columm tha is formated (  1234  ) about  8 space, fixed. The values in the query appears like that. I resolve this by Trimming Ltrim(ColumnName) and i get this (1234).

Now in SqlExpress, how can i filter by the new Trimmed Expression? (This is a primary key that the DBF use)


SELECT column1, column2, column3


SELECT Ltrim(column1) as NewExp, column2, column3
Where NewExpre = @NewExpres                  -Error-


Create ID (uniqueid?) from two fields when data is entered


I need to create an ID from two fields when they are entered into the db for the first time.  I thought Uniqueidentifer would do this, but it looks like uniqueidentifier is random and i have no control of the process. 

My user will enter 4 letters into a column called INIT and 4 numbers into a column called NUMB.  What I would like to do is create an id by combining those fields.

How can I do this?



LINQ with GridView and edit fields


My project includes a grid view which displays information of inventory items (Assets), data is quried from AssetTable. The GridView has a command field to allow editing, below is a description of the tables and how data is displayed


BuildingTable: (BuildingID, BuildingName)

AssetTable: (BuildingID,..,....,....)


ItemTemplate: Using a LINQ query I join the two table and displays in a label control a string which includes BuildingID and BuildingName (5 North Building)

 EditItemTemplate: Using a LINQ query I populate a DropDownList with strings of BuildingID and BuildingName same as above.
Here  issue which I need to resolve:
1.  ItemTemplate display the correct information (BuildingID BuildingName) but when I switch to EditItemTemplate the pair that is 
displayed is the first one on the list, how do I make is scroll to the item which was displayed in the label ?
<asp:CommandField ShowEditButton="True" >
                    <ControlStyle Wi
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend