locked
Adding timestamp to filename in RS data-driven subscription from SharePoint list RRS feed

  • Question

  • I wasn't sure whether to put this in Reporting Services/SQL Server forum, or the SharePoint forum... but here goes.

    I have a Reporting Services report that has a data-driven subscription that outputs a file at scheduled times.

    When choosing filename in the data-driven subscription, instead of a 'static' choice, the filename comes from a SharePoint list by pointing at a data source and using the following CAML:

    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>FM1_TB Pools</ListName>
      <ViewFields>
        <FieldRef Name="Pool" />
      </ViewFields>
    </RSSharePointList>

    The subscription runs the same report over and over, outputting a file for each 'pool' with the filename of that pool.

    What I need to do is add a timestamp to the filename.

    If I was using a T-SQL statement, I could easily append GETDATE(), or if I was using a static value for the filename I could add @Timestamp... but because I'm using a queried value, and using CAML to query it, I'm not sure how to add the current date.

    I've tried adding a new column to the sharepoint list to hold current date, but of course it's only set when the item is modified. I've tried using a workflow too to update it daily with the current date, but that didn't work either. I've also tried to add it on in the CAML above, but being unfamiliar with CAML I'm not sure of the syntax, or whether that can even be done in CAML.

    Has anyone any ideas how this can be done?

    Cheers

    Friday, November 15, 2013 2:19 PM

Answers

All replies

  • For instance, could I do this? Which I would want to return:

               Pool        |  ReportName
    Row 1: POOL999 | POOL99915-11-2013
    Row 2: POOL998 | POOL99815-11-2013

    etc...

    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>FM1_TB Pools</ListName>
      <ViewFields>
        <FieldRef Name="Pool" DisplayName="Pool" /> 
        <FieldRef Name="Pool" DisplayName="ReportName" /><Value Type="DateTime"><Today/></Value>
      </ViewFields>
    </RSSharePointList>

    • Edited by FeatureActivator Friday, November 15, 2013 4:09 PM Added column headers
    Friday, November 15, 2013 4:08 PM
  • Hi,

    Use the IncludeTimeValue attribute for the Value element. Add this attribute and assign it true, check out the following thread for more information:

    CAML Query with Datetime problem

    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2bbe50de-0966-495c-ae53-f63ceba7ccbc/caml-query-with-datetime-problem

    Thanks.


    Tracy Cai
    TechNet Community Support

    Tuesday, November 26, 2013 9:02 AM