**Resolved** Process Task to run all Bookmarks in a Bookmark Organizer Folder
My users have asked that I code a single-click option to run all Bookmarks in a specified Bookmark Organizer Folder to NativeExcel.
I know that I can form the URL to run a report with rdReportFormat=NativeExcel and I can add the LoadBookmark=True&rdBookmarkCollection=...&rdBookmarkID=..., etc. to run the report as it's Bookmark definition directly to Native Excel. However, I can't find any option in the Process Task > RunDataLayerRows to loop through these URLs.
The closest I can get is to use a Response.Report element under RunDataLayerRows with the Bookmark and Excel params as Link Parameters. This only runs the first Bookmark from the RunDataLayerRows, exports the Excel correctly, then spins on the Wait Panel until I close the browser. No second report or third, fourth, etc., no finishing up and hitting the Response.Report outside of RunDataLayerRows.
Any ideas on how to loop through the Bookmarks and run each to NativeExcel, then hit a Response.Report when done?
-
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 -
Hey VISUI
I'm working on this model now. I'll update with questions or success :)
Thanks for your response!!
0 -
Of course. On the Procedure.NativeExportExcel include Link Parameters for the rdBookmarkCollection, rdBookmarkID, rdBookmarkUserName and rdLoadBookmark = True
0 -
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:
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~','"','_')" 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~','"','_')" 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 -
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.
Comments
5 comments