Infopath calculate each row of a repeating table

This was somthing that bugged me for ages then it suddenly clicked and i couldnt belive how simple it is . As i didnt find anything on the net to help me work this out  i hope this will help someone.

The senario is;

I have a field in an infopath form which holds a value, then i have a repeating table in the same form which is from a SharePoint list. This repeating table has a number column which i want to calculate against the value field row by row.

My first mistake was to think that this is possible using a single text field, it is only possible to do this with a calculated value field as you cannot store data unbound in a repeating table.

Click on the right hand column in the repeating table and choose “Insert” > “Column to the right” give it a meaningful header then click in the new cell and insert a calculated value field.

Right click the calculated value field and click properties, click on the “FX” xpath button and then insert a field, choose the data source which the repeating table comes from, choose the field you wish to calculate on, then do the same to insert the in form field to calculate with and once both fields are in the box put the calculation symbol between the fields i.e. * / – + . Click ok to get back to the form and preview. Now all rows should have a row by row calculation against them.

 

Advertisements

Export site users to excel

SharePoint comes with a great feature which is that its lists and libraries  can be exported to excel, (if you then change the settings in the data connection within excel to refresh on file open you can then save this excel and every time you open it, it will be up to date with the list, saving you from keep navigating to the list and pressing exporting to excel)

unfortunately there is no export to excel option on the site people and groups list, so to create this feature you have to create a query file (this is the file that is created when in a regular list you click export to excel)

To create a query file first create a new .txt file then paste the following code into it changing the text in bold to your details;

WEB 1 http://SITE COLLECTION URL/_vti_bin/owssvr.dll?XMLDATA=1&List={LIST ID}&View={LIST VIEW ID}&RowLimit=0&RootFolder=%2fLists%2fLIST NAME

Selection={LIST ID}-{LIST VIEW ID} EditWebPage= Formatting=None PreFormattedTextToColumns=True ConsecutiveDelimitersAsOne=True SingleBlockTextImport=False DisableDateRecognition=False DisableRedirections=False SharePointApplication=http://SITE COLLECTION URL/_vti_bin SharePointListView={LIST ID} SharePointListName={LIST VIEW ID} RootFolder=/Lists/LIST NAME

Save the file, then rename the file to  .IQY

Double click and open with Excel and it will export your site collection people and groups list into the excel workbook.

Here is an example of the code;

WEB 1 https://www.sitecollection.com/_vti_bin/owssvr.dll?XMLDATA=1&List={37fd0da1-ce48-405b-b8ec-d8b364dcaddb}&View={F86875B9-C5A8-4AAE-94E4-9E7D1BB9551F}&RowLimit=0&RootFolder=%2fLists%2fList1

Selection={37fd0da1-ce48-405b-b8ec-d8b364dcaddb}-{F86875B9-C5A8-4AAE-94E4-9E7D1BB9551F} EditWebPage= Formatting=None PreFormattedTextToColumns=True ConsecutiveDelimitersAsOne=True SingleBlockTextImport=False DisableDateRecognition=False DisableRedirections=False SharePointApplication=https://www.sharepointcollection.com/_vti_bin SharePointListView={F86875B9-C5A8-4AAE-94E4-9E7D1BB9551F} SharePointListName={37fd0da1-ce48-405b-b8ec-d8b364dcaddb} RootFolder=/Lists/List1

See all accounts in a site collection

Quick and easy one, sometimes you just want to see every user account recognised in a site collection (this doesn’t mean they have any permissions at all just that they are in your Active directory and has been synced by the UserProfileSyncronisation service)

All you have to do is add the following to end of the site collection URL;

/_layouts/people.aspx?MembershipGroupId=0&FilterField1=ContentType&FilterValue1=Person

Heres an example:

http://mysharepointsitecollection.com/_layouts/people.aspx?MembershipGroupId=0&FilterField1=ContentType&FilterValue1=Person

How to find a SharePoint list ID

Navigate to the SharePoint list in your browser. On the ribbon select the list Settings in this new page copy the url from the browser address bar into a text editor such as notepad.

Example:
http://sharepoint2010/_layouts/listedit.aspx?List=%7B3A0740A0%2D56AB%2D4FD3%2DAFD0%2D5631C7565208%7D

• Delete everying before and including “List=”.
• Change “%7B” to “{”
• Change all “%2D” to “-“
• Chnage “%7D” to “}”

Now you have the List (Guid) ID:
{3A0740A0-56AB-4FD3-AFD0-5631C7565208}

Hide the Quick launch without modifying the master page

Sometimes you may want to hide the Quick launch on a page quickly without creating a new masterpage just for that page. Luckily you can do this with CSS. All you have to do is add a content editor web part to the page in question, and then either paste the blow code into the HTML editor or reference a .txt document with the code in the content editor web part. Then hide the content editor web part by choosing “None” in Chrome type under appearance on the edit web part settings. Here is the code: <style> #s4-leftpanel { DISPLAY: none } #MSO_ContentTable { MARGIN-LEFT: 0px }</style>

How to extract EXIF meta data from Photographs automatically in SharePoint 2010

These days most people use their mobile phones to take pictures rather than a standalone camera (although a lot of standalone cameras also store data against the photograph).

Because of the many features mobile phones have the pictures usually have a lot of information saved to them, such as GPS location, Date and Time the picture was taken, the position of the camera etc. This is all saved against the picture in a standard called EXIF.

What most people do not know is that SharePoint image libraries are equipped out of the box to be able to extract this EXIF data and display it as Meta data against the picture.What’s more it is really really easy to do this.

In fact all you have to do is create a new column in the image library with one of the following names; (the names are self-explanatory, not all phones/cameras save all of the header details)

  • wic_System_Copyright
  • wic_System_Rating
  • wic_System_ApplicationName
  • wic_System_DateAcquired
  • wic_System_SimpleRating
  • wic_System_GPS_Altitude
  • wic_System_GPS_AltitudeRef
  • wic_System_GPS_AreaInformation
  • wic_System_GPS_Date
  • wic_System_GPS_DestBearing
  • wic_System_GPS_DestBearingRef
  • wic_System_GPS_DestDistance
  • wic_System_GPS_DestDistanceRef
  • wic_System_GPS_DestLatitude
  • wic_System_GPS_DestLatitudeRef
  • wic_System_GPS_DestLongitude
  • wic_System_GPS_DestLongitudeRef
  • wic_System_GPS_Differential
  • wic_System_GPS_DOP
  • wic_System_GPS_ImgDirection
  • wic_System_GPS_ImgDirectionRef
  • wic_System_GPS_Latitude
  • wic_System_GPS_LatitudeRef
  • wic_System_GPS_Longitude
  • wic_System_GPS_MapDatum
  • wic_System_GPS_MeasureMode
  • wic_System_GPS_ProcessingMethod
  • wic_System_GPS_Satellites
  • wic_System_GPS_Speed
  • wic_System_GPS_SpeedRef
  • wic_System_GPS_Status
  • wic_System_GPS_Track
  • wic_System_GPS_TrackRef
  • wic_System_GPS_VersionID
  • wic_System_Image_ColorSpace
  • wic_System_Image_CompressedBitsPerPixel
  • wic_System_Image_Compression
  • wic_System_Image_HorizontalResolution
  • wic_System_Image_ImageID
  • wic_System_Image_ResolutionUnit
  • wic_System_Image_VerticalResolution
  • wic_System_Photo_Aperture
  • wic_System_Photo_Brightness
  • wic_System_Photo_CameraManufacturer
  • wic_System_Photo_CameraModel
  • wic_System_Photo_CameraSerialNumber
  • wic_System_Photo_Contrast
  • wic_System_Photo_DigitalZoom
  • wic_System_Photo_EXIFVersion
  • wic_System_Photo_ExposureBias
  • wic_System_Photo_ExposureTime
  • wic_System_Photo_Flash
  • wic_System_Photo_FlashEnergy
  • wic_System_Photo_FlashManufacturer
  • wic_System_Photo_FlashModel
  • wic_System_Photo_FNumber
  • wic_System_Photo_FocalLength
  • wic_System_Photo_FocalLengthInFilm
  • wic_System_Photo_ISOSpeed
  • wic_System_Photo_LensManufacturer
  • wic_System_Photo_LensModel
  • wic_System_Photo_LightSource
  • wic_System_Photo_MaxAperture
  • wic_System_Photo_MeteringMode
  • wic_System_Photo_Orientation
  • wic_System_Photo_PhotometricInterpretation
  • wic_System_Photo_ProgramMode
  • wic_System_Photo_RelatedSoundFile
  • wic_System_Photo_Saturation
  • wic_System_Photo_Sharpness
  • wic_System_Photo_ShutterSpeed
  • wic_System_Photo_SubjectDistance
  • wic_System_Photo_TranscodedForSync
  • wic_System_Photo_WhiteBalance

How to open a link in an AJAX popup window

Sometimes you may want to open a new item/page in a popup window but without the risk of a popup blocker blocking it. In SharePoint this is where an Ajax popup box comes in extremely useful.

I tend to use this when I want to keep users on one page but use a lot of libraries and lists.

There are many ways you can use the code, the most obvious are;

  • pasted straight into the code of the ASP/Master page
  • add a content editor web part into the page, then paste the code into the HTML editor
  • save the code as a .txt document and then reference that .txt document in the content editor web part.

I usually use the latter, this way if you ever need to edit the code to add or remove items you can just open the document from the document library edit the file then click save and everything updates. (I usually create a document library called “Branding” then i put all of my .txt code files and images in this library and set the library permissions to read for all authenticated users)

So without further ado here is the code, this is the code for a document library upload box but it will also work for a list new item or to view a list/library; (the parts which you need to edit are in bold)

<a onclick=”javascript:NewItem2(event, &quot;http://PASTE YOUR URL IN HERE/&quot;); javascript:return false;” href=”http://PASTE URL IN AGAIN HERE/>img alt=”IMAGE DESCRIPTION TEXT” src=”http://PASTE URL OF IMAGE TO USE AS CLICKABLE LINK HERE“/></a>

Here is a complete example;

<a onclick=”javascript:NewItem2(event, &quot;https://www.mysharepointdoclibrary.com/_layouts/Upload.aspx?List={01ABD049-5A4A-452E-9C99-260B26358AEE}&RootFolder=&quot;); javascript:return false;” href=”https://www.mysharepointdoclibrary.com/_layouts/Upload.aspx?List={01ABD049-5A4A-452E-9C99-260B26358AEE}&RootFolder=”><img alt=”Image of Upload Document” src=”https://www.mysharepointdoclibrary.com/imageslibrary/App-Upload.gif”/></a&gt;