Skip to main content

Process Task to run all Bookmarks in a Bookmark Organizer Folder

Comments

5 comments

  • VISUI

    Why not just run a process, passing in the Bookmark Organizer Folder.  The process would utilize a run datalayer rows on the specified bookmark file, filtering to the requested Bookmark Folder, then issue an Export to NativeExcel?  You could even export all the bookmarks to a new folder, compress the folder and exit the process linking to the newly created compressed file, causing the browser to download it.




    <Task ID="tskExportAndZip">
      <Procedure Type="CreateFolder" />
      <Procedure Type="RunDataLayerRows">
        <DataLayer Type="Bookmarks">
          <ConditionFilter />
        </DataLayer>
        <Procedure Type="ExportToNativeExcel">
          <Target Type="NativeExcel" />
        </Procedure>
      </Procedure>
      <Procedure Type="CompressFolder" />
    </Task>
    0
  • Johnny Stevens

    Hey VISUI

    I'm working on this model now. I'll update with questions or success :)

    Thanks for your response!!

    0
  • VISUI

    Of course.  On the Procedure.NativeExportExcel include Link Parameters for the rdBookmarkCollection, rdBookmarkID, rdBookmarkUserName and rdLoadBookmark = True

    0
  • Johnny Stevens

    VISUI

    Leaving this comment in for posterity's sake; the issue has been resolved. Details in the next Comment.

    I'm having an odd error when I try to run this:

    Error running a Procedure. Error running a Procedure. There are multiple root elements. Line 2, position 2. There are multiple root elements. Line 2, position 2.

    I get this error whether I run the two test Bookmarks directly to their own files (no new folder/compress folder) or using the create new/compress folder process. Additionally, neither Procedure creates the file with the name I specify; both create using the internal ID (e.g. rdDLlbnfjb2wfx13pgpgqtajhnna-7c8d2140146f4db7ad19552b000495dc.xlsx). 

    Here are my test Procedures, both of which are giving this error on running the first of the 2 Bookmarks to Excel:

    <Task ID="taskExportAllCompressed">
      <Procedure Folder="@Function.AppPhysicalPath~\rdDownload\reports@Date.Today~" ID="createExportFolder" Type="CreateFolder" />
      <Procedure ID="ProcRunDl" Type="RunDataLayerRows">
        <DataLayer ID="dlFavorites" Type="Bookmarks">
          <CompareFilter CompareType="=" CompareValue="32c4ad2f-6a5d-4cee-a8b2-80c3825c283e" DataColumn="FolderID" ID="compFolder" />
          <CalculatedColumn Formula="REPLACE('@Data.Description~','&quot;','_')" ID="BkmkNameFile" />
        </DataLayer>
        <Procedure Filename="@Function.AppPhysicalPath~\rdDownload\reports@Date.Today~\@Data.BkmkNameFile~" ID="procToExcel" Type="ExportToNativeExcel">
          <Target ExcelOutputFormat="Excel2007" ID="tgtReport" Report="@Data.Report~" ShowGridlines="True" Type="NativeExcel">
            <WaitPage />
          </Target>
          <LinkParams BkmkName="@Data!Js.Description~" inpSubmit="1" rdBookmarkCollection="@Data.BookmarkCollection~" rdBookmarkID="@Data.BookmarkID~" rdBookmarkUserName="@Data.BookmarkUserName~" rdLoadBookmark="True" />
        </Procedure>
      </Procedure>
      <Procedure CompressedFilename="MonthlyReports" FolderToCompress="@Function.AppPhysicalPath~\rdDownload\reports@Date.Today~" ID="zipReportsFolder" Type="CompressFolder" />
      <Response ID="respDefault" Type="Report">
        <Target ID="tgtDefault" KeepShowElements="True" Report="Default" Type="Report">
          <WaitPage />
        </Target>
      </Response>
    </Task><Task ID="taskExportAllSingle">
      <Procedure ID="ProcRunDl" Type="RunDataLayerRows">
        <DataLayer ID="dlFavorites" Type="Bookmarks">
          <CompareFilter CompareType="=" CompareValue="32c4ad2f-6a5d-4cee-a8b2-80c3825c283e" DataColumn="FolderID" ID="compFolder" />
          <CalculatedColumn Formula="REPLACE('@Data.Description~','&quot;','_')" ID="BkmkNameFile" />
        </DataLayer>
        <Procedure Filename="@Function.AppPhysicalPath~\rdDownload\@Data.BkmkNameFile~" ID="procToExcel" Type="ExportToNativeExcel">
          <Target ExcelOutputFormat="Excel2007" ID="tgtReport" Report="@Data.Report~" ShowGridlines="True" Type="NativeExcel">
            <WaitPage />
          </Target>
          <LinkParams BkmkName="@Data!Js.Description~" inpSubmit="1" rdBookmarkCollection="@Data.BookmarkCollection~" rdBookmarkID="@Data.BookmarkID~" rdBookmarkUserName="@Data.BookmarkUserName~" rdLoadBookmark="True" />
        </Procedure>
      </Procedure>
      <Response ID="respDefault" Type="Report">
        <Target ID="tgtDefault" KeepShowElements="True" Report="Default" Type="Report">
          <WaitPage />
        </Target>
      </Response>
    </Task>

    The Bookmarked Reports run fine on their own (e.g. clicking the link to run the Bookmark) and export to Excel manually from the Bookmarked Report, but something about the Procedure is throwing this error.

    0
  • Johnny Stevens

    I found the source of my "multiple root elements" error. We have a keepalive call to ping our parent application and this code lived in our rdPage.aspx. This was creating two root elements in the final XLS: one for the export and one for the script.

    I moved the keepalive script into our Master Report and the error is resolved while the ping/keepAlive still runs as expected.

    I am now able to process either each Excel export sequentially with download notification in browser OR using VISUI's recommendation of using a folder and compressing into one zip for download.

    Excellent!! Thanks again John Sweazen/VISUI!

    0

Please sign in to leave a comment.