Skip to content

A Few More CAML Reports

June 15, 2010

I’ve been writing a few more CAML reports, so here’s some more code and resources to write your own! Remember, queries can’t have any line breaks for Sharepoint reports.

Large File Sizes:

      <FieldRef Name="File_x0020_Size" />
      <Value Type="Lookup">1000000</Value>

Large JPG Images: (adapted from the ECM Team blog)

         <FieldRef Name="DocIcon"  />
         <Value  Type="Computed">jpg</Value>
            <FieldRef  Name="ImageWidth" />
            <Value  Type="Integer">200</Value>
            <FieldRef  Name="ImageHeight" />
            <Value  Type="Integer">200</Value>
      <FieldRef  Name="FileSizeDisplay" Ascending="False"  />

For many of these CAML queries, you’ll find yourself in need of the internal column names – those are the names Sharepoint uses for columns in lists and libraries. For example, Sharepoint displays “File Size”, but to compare file size data, you need to use the internal value File_x0020_Size. A great list of display names, corresponding internal names, and the type used in the <Value> tag can be found in this MSDN article.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: