WebPart average of a SharePoint list column
Hello;
I need a Web Part that displays the average of a SharePoint list columns
thank you
Open the AllItems.aspx page of that list in SharePoint Designer
Select a title and right click on it. Format item As -> Hyperlink to -> Edit Form
This will redirect you to edit form when the title column link is clicked.
But if you want to show the modal pop up it edit mode, open the Allitems.aspx page in designer
Select the list view web part, on the ribbon in the List View Tools -> Design tab -> Customize XSLT -> Customize Entire View
Switch to the code view, search for FORM_DISPLAY and change it to FORM_EDIT.
jayant prabhakar
Similar Messages
-
Using Sharepoint List Columns to create a simple trend chart
Hello,
I am trying to use a single sharepoint list fields with as my data to create a chart.
I have only two columns I want to create the chart with: The date and time picker
column where the user picked a date and time and it is formatted accordingly and the Item ID.
I just want show how many items were created in each month and year. For e.g if there were 3 items created in between Jan 1st- 31st, 2014 then I want it to show a count of 3 for the month of Jan.
I used the MonthName and string conversion for the X axis and it seems to be showing the month and year, but I cannot get the items that were created to show up for each month.
Any guidance is welcome!
I would like to create a trend chart that shows how manyHi PinkPowerRanger,
Per my understanding that you have two fields in the table "Date and Time picker" which is Date/time type and another is "Item ID", you need to get the Month from the Date field to display in the X-axis and count(Item ID) related to each
month to display in the Y-Axis, right?
I have tested on my local environment and can do this by create two calculated fields to get the month and year values from the Date/Time field.
Details information below for your reference:
Right click the main dataset to select the "Add Calculated field", specify an name of the new calculated field and add the expression in the field source as below:
Year: =Year(Fields!Date.Value)
Month: =MonthName(Month(Fields!Date.Value))
Add the three field in the Chart as below and remember in the Value area you have got the Count(ItemID) but not SUM(ItemID):
Preview you will got the chart like below:
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support -
How to update SharePoint list columns including choice fields programmatically?
Hi All,
I have a requirement to update multiple columns (which are choice columns) in a SharePoint list. I'm a newbie at creating event receivers and timer jobs. Not sure which one to do and where to start first. There are approximately 4500
list items in the lists. I was thinking I could use one list to maintain the Keywords and perform updates or timer job to any targeted lists.
Scenario. Anytime a power user of the sharepoint list wants to update any of the choice field items or possibly even the column name itself, they want to be able to make updates to any of the list
items or other
lists that contain the new name. The columns I'm using are all choice fields named Assigned To, Division, Region, Job Title, Department, and Zone.
Here's sample code for Updating list:
using (SPSite oSPsite = new SPSite("team url/"))
using (SPWeb oSPWeb = oSPsite.OpenWeb())
oSPWeb.AllowUnsafeUpdates = true;
// get the List
SPList list = oSPWeb.Lists["Keywords"];
//Add a new item in the List
SPListItem itemToAdd = list.Items.Add();
itemToAdd["Title"] = "My Title Field";
itemToAdd["Assigned To"] = "Assigned To";
itemToAdd.Update();
// Get the Item ID
listItemId = itemToAdd.ID;
// Update the List item by ID
SPListItem itemToUpdate = list.GetItemById(listItemId);
itemToUpdate["Assigned To"] = "Assigned To Updated";
itemToUpdate.Update();
// Delete List item
SPListItem itemToDelete = list.GetItemById(listItemId);
itemToDelete.Delete();
oSPWeb.AllowUnsafeUpdates = false;
Any help is greatly appreciated. Please provide code sample and references. Thanks!Thanks Ramakrishna -- Here's what I have so far.
namespace MonitorChanges
class MyTimerJob : SPJobDefinition
public MyTimerJob()
: base()
public MyTimerJob(string sJobName, SPService service, SPServer server, SPJobLockType targetType)
: base(sJobName, service, server, targetType)
public MyTimerJob(string sJobName, SPWebApplication webApplication)
: base(sJobName, webApplication, null, SPJobLockType.ContentDatabase)
this.Title = "My Custom Timer Job";
public override void Execute(Guid contentDbId)
// Get the current site collection's content database
SPWebApplication webApplication = this.Parent as SPWebApplication;
SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];
// Get a reference to the "ListTimerJob" list in the RootWeb of the first site collection in the content database
SPList Listjob = contentDb.Sites[0].RootWeb.Lists["ListTimerJob"];
// Add a new list Item
SPListItem newList = Listjob.Items.Add();
newList["Title"] = DateTime.Now.ToString();
newList.Update();
Talibah C -
How to make a SharePoint list column ReadOnly using Sharepoint designer
Hi,
I am new to sharepoint. Need to make a few columns readonly in a sharepoint list. Not sure how. Any help is appreciated.
ThanksHere is one more Simple and Best practice to be fallowed using powershell
http://soreddymanjunath.blogspot.in/2014/04/readonly-field-using-powershell.html
Cls
Add-PSSnapin "Microsoft.Sharepoint.Powershell"
$web= Get-SPWeb -Identity "http://test.dev/sites/Wftest"
$ls=$web.Lists.TryGetList("test");
$flds=$ls.Fields["CustID"]
$flds.ReadOnlyField=$true
$flds.Update();
Note: If
ReadOnlyField =TRUE,
the field is not displayed in New or Edit forms
ReadOnly to TRUE hides
the field from Site Settings pages for managing site columns and content types. Setting the Hidden attribute
to TRUE completely
hides the field from the UI.
Default ReadOnlyField value
is set to false.
Best Practice is to Use
$flds.ShowInDisplayForm=$false;
$flds.ShowInEditForm=$false; -
How to limit text amount in a 2013 SharePoint list column?
I have a few lists that have a Remarks or Details column that have multiple lines of text. In my old 2007 site, I had a small script that would hide all but the first 30 characters and then add ... and when you moused over it displayed the rest of
the text. It seams that the script won't work in 2013 SharePoint now and I have yet to find a fix.Hi,
I think the way you are following is perfect.
For the script to work fine follow the below mentioned steps
1. If it is a custom user control in which the text box is place then placing the script inside the script block on th usercontrol or putting it in a js file should be fine(i know this is straight forward but still im telling)
2. If it is an out of the box page, then placing the script inside the content editor will not work. You will have to add the script editor webpart and then place your script inside that webpart and it should work fine.
Please let us know in case of any issues.
Regards,
Sharath
sharath kumart shivarama -
How mapping sharepoint list Columns to Sql server data table columns programaticlly
Hi ,
I have one Verification List in share Point ,in that list i have 10 columns.And we have sql server in that sql server we have one data table Verification_Table
in that table we have 25 column, my requirement is all list data move to sql data table[ what ever columns mapping to list--->data table that data store in data table reaming column is Null]
using grammatically not in BCSHello,
You can create SQL connection and use Datareader to read from SQL.Firs create a connection string and put this string in web application web.config file of your sharepoint site.
Now use below code to call your connectionstring in your webpart.
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
Here is link to read the data from SQL:
http://www.akadia.com/services/dotnet_data_reader.html
Here is one MSDN link to read SP list data:
http://msdn.microsoft.com/en-us/library/dd490727%28v=office.12%29.aspx
Let me know if you have any doubt
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Hi
If I have only login name of any user like - "Donamin\login_name".
If this user is not present in sharepoint portal.
How can I add this user to people or group column of any list or in any sharepoint group with permission?hi
got the issue
it should be like this -
string userloginname = @"DOMAIN001\vyankatesh_mujumdar"
using (SPSite oSpSite = new SPSite(site.ID))
using (SPWeb web = site.OpenWeb())
try
{ SPList lst = web.Lists["TestList"];
string userloginname = @"DOMAIN001\vyankatesh_mujumdar";
web.EnsureUser(userloginname);
SPUser oSPUser = web.SiteUsers[userloginname];
SPFieldUserValue FieldValueName = new SPFieldUserValue(web, oSPUser.ID, oSPUser.LoginName);
SPListItem oSPListItem = lst.Items.Add();
oSPListItem["Title"] = userloginname;
oSPListItem["People"] = FieldValueName;
oSPListItem.Update();
catch (Exception ex)
ExceptionManager.LogErrorInFile("--------Exception -------", bIsLogEnabled);
ExceptionManager.LogErrorInFile(ex.Message, bIsLogEnabled);
ExceptionManager.LogErrorInFile(ex.Source, bIsLogEnabled);
ExceptionManager.LogErrorInFile(ex.StackTrace, bIsLogEnabled);
ExceptionManager.LogErrorInFile("-------------------------------------------------------", bIsLogEnabled);
Thanks for all for the reply -
Linked table in Access not displaying all SharePoint List columns
In Access 2007 I created a link to a list in SharePoint 2010.
Originally the modified by and created by columns were not visible in SharePoint. They did not appear in the Access table.
I made the two lists visible in Sharepoint and refreshed the link. However, the two columns did not appear in the Access table. I created a new .accdb file and re-created a link to the list yet the two columns still do
not appear in the table.
How do I get these two columns to appear in the Access table?
Thanks,
- BruceI figured it out by accident. The fields are in the linked table ... they are just hidden!
I face the same Problem with Access 2013 and SharePoint-Online from Office 365. I added additional columns to the list in SharePoint, but they won't appear in the linked table in Access. Even when I make all columns visible, they are not listed.
Updating data for the other columns works like a charm.
Any idea from anyone? -
Lookup column in sharepoint list column in visual studio
Hi i have a list with two columns as student id and student name. in second list am
taking one column as lookup and am giving reference to student name. but while inserting record in second list when am selecting student name and clicked save ,in second list i have to save student id not student name. (just like dropdown in asp.net data text
field and data value field.) how can i achive this in sharepoint using lookup column and am creating the second list in visual studio.you need to create a look up column on Name field in second list and a second look up column on the same field.
then hide and show your fields in edit and display form based on your requirements .
<Field
ID="{886AF390-F68A-4B8A-9EC4-12108A11CC99}"
Name="StudentName"
DisplayName="StudentName"
Type="Lookup"
List="Lists/Students"
ShowField="StudentName"
PrependId="TRUE"
Group="test">
</Field>
<Field
ID="{599F97C5-564C-4DE5-BE4D-3A49DDC87FB5}"
FieldRef="{886AF390-F68A-4B8A-9EC4-12108A11CC99}"
Name="StudentId"
DisplayName="StudentName:Trainer StudentId"
Type="Lookup"
Required="FALSE"
ShowField="StudentId"
List="Lists/Students"
Group="test">
</Field> -
Sharepoint throw a javascript error while adding items to sharepoint list
sharepoint throw javascript error when adding item to list
error called: this._registeredValidators[validatorIdx].Validate is not a function
any help pleaseHi,
If you want to validatelist column, there is out of the box way to accomplish this with SharePoint
There's a great blog that covers how to validate Strict Text Formats:
http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/
In addition, we can use JavaScript to validate column. Please make sure you use the code correctly.
More information:
http://chrisstahl.wordpress.com/2011/02/06/validate-a-sharepoint-list-column-with-regular-expression/
http://blog.tallan.com/2013/09/16/how-to-add-custom-validation-logic-to-validate-a-phone-field-in-sharepoint/
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Custom search functionality in one of sharepoint list
Hi
I want to enable search functionality such as google in one of sharepoint list, such that in Allitmes.aspx of sharepoint list,put the textbox and when user want to search for example “sharepoint”, give him/her
suggestions that contain part or whole "sharepoint"word (such as “like” operaion in sql). These suggestions should be based on one of sharepoint list column,
user fill this column beforehand.
How can do this?!
Thanks.Please follow this... http://joranmarkx.wordpress.com/2012/01/04/configure-sharepoint-2010-search-suggestions/
Sekar - Our life is short, so help others to grow
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer -
How to view data from infopath form that submit into sharepoint list into another page in sharepoint
what I want to do is, User A as administrator, will fill in the form. Next User A will assign task to User B, to complete the form. when User B open the form, the above part of the form will displayed data that fill by User A. Field that User B need to fill
in is at the below of the form.
may I know how to do it step by step? Thank you for your answer.
Azuaniza AriffinHi,
I saw a similar post by you on this forum, and to achieve the functionality you can try using InfoPath Form or JQuery with SPService to make part of the Form as Readonly. and in conjunction use SharePoint designer to create a workflow to assign task or send
email to user B.
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d02389be-f267-4c09-baf1-d85a5429bafb/set-field-value-and-make-field-read-only-on-custom-list-form?forum=sharepointgenerallegacy
http://www.sharepointdiary.com/2013/07/how-to-make-sharepoint-list-column-form-field-read-only.html#ixzz2aH103rcM
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you -
Comparing two SharePoint Lists, three variables in each
I have a data set in a SharePoint list, Column 1, 2, 3,4.
I have a second data set in a SharePoint list, with the same columns 1-3 in it.
I would like to create a workflow (I think) that when a new record is added to the first data set, it checks the second data set to see if there is a record with the same matching three records. If there is a match it would change column 4 in the first file
to "TRUE".
Looking for some help here... I know how to do a look up for one value, and even a lookup to look at two different values independently, but this lookup needs to make sure that all three columns in the record are a match.
ThanksHi,
I'm assuming you mean for List 1 you have four fields and an additional field with the date (MyDate for example).
And that in List 2 you have three fields plus two more date fields (EffectiveDate and ExpirationDate for example)
For this scenario I would create 2 workflow variables:
1. Combined (string) - same as before that builds up the three fields in List1
2. List2Id - that gets the ID of the List Item in List2 that matches (if none match then List2Id will be 0) using the following settings:
Data source: List2
Field from source: ID (As List Item Id - IMPORTANT)
Field: Combined
Value:Variable:Combined
Then use an if condition to check:
If Variable: List2Id not equals 0
then within this if condition create another sub if condition to check the following:
If Current Item:MyDate is greater than or equal to List2:EffectiveDate
AND Current Item:MyDate is less than or equal to List2:ExpirationDate
If both conditions are true then update field four in List1 to True.
Settings to get List2:EffectiveDate are below:
Data source: List2
Field from source: EffectiveDate (As Date/Time)
Field: ID
Value:Variable: List2Id (Return field as: Item Id - IMPORTANT)
Settings to get List2:ExpirationDate are below:
Data source: List2
Field from source: ExpirationDate(As Date/Time)
Field: ID
Value:Variable: List2Id (Return field as: Item Id - IMPORTANT) -
SSDT - Using a SharePoint list data feed as source - "column does not exist in the rowset" error
Hey guys!
So, I want to use a SharePoint list data to create a cube/tabular model, in order to make a complex analysis in PPS using MDX.
To create the tabular model, I'm using the SS Data Tools, and importing a feed from the respective SharePoint list (using the _vti_bin/listdata.svcextension and then selecting the list(s) I wanna to import).
Everything looks fine and smooth, I can select and preview the data in the table import wizard, but in the end, when importing, I always get this error IF the table has one or more row of data (if the table is empty, it's ok...) - the <...>
column doesn't exist in the rowset.
(Curiously, when I have the same procedure in PowerPivot for Excel, I have no problems, everything works fine. The problem is that then I get again errors if I try to create a tabular model on SSDT importing a PowerPivot file).
Here's the error:
Had you already tried this in SSDT? Are you experiencing the same trouble?
Best regards, and thanks in advance!
Jorge Mateus
Jorge MateusI noticed something else too.
I can't process Tabular Models on both SSDT and SSMS (2012), but I can process Tabular Models created on PowerPivot.
I tried to create a Data Feed connection on PowerPivot, and it was successfully created. However, if restoring the PowerPivot Tabular DB on my SSAS Tabular instance and processing (full) the model through SSMS, it won't work.
Is there anything different on PowerPivot and SSDT related with Partitioning or connections to the data sources?
Regards,
Jorge
Jorge Mateus
Update:
When trying to Restore a PowerPivot file on my SSAS Tabular Server and full process the model:
The operation failed because the source does not contain the requested column. You can fix this problem by updating the column mappings.
More Details:
The 'X' column does not exist in the rowset.
An error occurred while processing the partition 'X_81dabac5-c250-4a8c-8832-ad7fcedd35cb' in table 'X_81dabac5-c250-4a8c-8832-ad7fcedd35cb'.
The current operation was cancelled because another operation in the transaction failed.
X is the first column of the source table, no matter if I chose others on the PowerPivot table.
When trying to import data from a data feed using SSDT:
The 'X' column does not exist in the rowset.
An error occurred while processing the partition 'X_ee6be81f-2235-4113-b404-cfcb20647a38' in table 'X_ee6be81f-2235-4113-b404-cfcb20647a38'.
The current operation was cancelled because another operation in the transaction failed.
X is the first chosen column to import. -
Greetings.
I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
I have read and re-read the SharePoint SSIS Adapters 2011.docx from
http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
"Looking Up Values in a SharePoint List
If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
data in the lookup column on the ";#" delimiter to separate the ID value from the description.
If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
I have several of these lookup column types pointing to several different lists.
Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
Thank you.
My errors are:
Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and willI have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
column --> SharePoint displays “4005” and successfully links to the lookup list.
Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
and things work well.
There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
SELECT
pps.SSNm,
pps.file_updated,
pps.Employee_id,
/* pps.CheckDistNm,*/
Check_Distribution_id = COALESCE( d.ID, 0 ),
pps.Job_nbr,
pps.SeqNm,
pps.action_eff_dt,
Fund_id = COALESCE( f.id, 0 ),
Appropriation_id = COALESCE( ap.id, 0 ),
ActionCode_id = COALESCE( ac.id, 0 ),
SpecNumber_id = COALESCE( jt.ID, 0 ),
pps.Employee_id,
/* pps.Fund,
pps.Approp,
pps.Unit,*/
Unit_id = COALESCE( u.ID, 0 ),
PosNm,
PosCode,
pps.LastName,
pps.FirstName,
pps.MI
FROM
x_PPS.aReportVw.pps_screens_active AS pps
LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
pps.CheckDistNm = d.Check_Distribution
LEFT OUTER JOIN dbo.Units AS u ON
pps.Fund = u.Fund AND
pps.Approp = u.Approp AND
pps.Unit = u.Unit
LEFT OUTER JOIN dbo.Appropriations AS ap ON
pps.Approp = ap.Approp
LEFT OUTER JOIN dbo.Funds AS f ON
pps.Fund = f.Fund
LEFT OUTER JOIN dbo.ActionCodes AS ac ON
pps.ActionCode = ac.ActionCode
LEFT OUTER JOIN dbo.JobTitles AS jt ON
pps.SpecNm = jt.SpecNumber AND
pps.JurisClass = jt.JurisClass
Maybe you are looking for
-
Configuring non-BT provided Powerline Adapters
I recently installed BT Vision+. The package came with a BT HomeHub2 router and two COMTREND PG9020 powerline adapters. I chose to replace my Netgear 802.11n router with the BT Home Hub2 - and it all works fine. To my original Netgear router i had
-
Pavilion dv5-1151 not starting.
Got a HP Pavilion dv5. It is about 5 years old. Last Tuesday the AC Adapter started to heat more than usual. At first the laptop turned off and I waited for the AC Adapter to cool down and retry it and it worked. After reusing the laptop for another
-
Manual change to Rebate %
Hi, I was wondering if SAP provided a way for the user ro change the default rebate % directly in the sales order? The system pulls in the Rebate condition type in the sales order, but it is greyed out... and I cannot figure out a way to open it up s
-
HELP! Finder windows won't close.
I hit the "Apple O" (Open ALL) shortcut on a wrong window and now it has opened all 300 folders with music in them in the finers. It's too much for the computer, so it is stalling. I cannot hit the x to close any window. I cannot highlight all and cl
-
Thunderbird Time is off by over 3 hours!
Using windows 7 64 bit, windows time and time zone is set correctly, yet the time shown on thunderbird is at least 3 hours behind!