Skip to main content
Newcomer
November 8, 2022

Book Filename with Variables

  • November 8, 2022
  • 4 replies
  • 0 views

What do I need to add to our book settings in order to get the file to export with variables within the filename? For example, I'd like our consolidated financial book to save as the time defined in the parameter as "2022M10 Financial Statements.pdf."

4 replies

Newcomer
November 8, 2022

Can you share the setup of the Book? And how are you planning to run the book?

Newcomer
November 8, 2022

sdayringer_0-1667942600519.pngsdayringer_1-1667942703864.pngsdayringer_2-1667942987336.png

See setup above. The pdf is generated from the OPEN ALL IN PDF button.

 

Newcomer
November 8, 2022

Thank you for sharing that information.

 

You could create a "shell" book which is a .zipbook, which contains your .pdfbook, and provide the Output name there; in this instance I used the substitution variable |WFTime|

PaulaMihalko_CS_0-1667945666467.png

When run, the zip file will open with the PDF file named accordingly:

PaulaMihalko_CS_1-1667945731601.png

 

Hope that helps!

Newcomer
November 8, 2022

Looks like I can't enter my period parameter (|P_PeriodPrompt|) as it says there are illegal characters, if I enter |WFTime| or |CVTime| is processes the file, but it doesn't tie to the selected time parameter....I also get an error when trying to open the extracted pdf file

sdayringer_4-1667946769304.png

sdayringer_5-1667946794528.png

 

 

 

sdayringer_1-1667946615138.pngsdayringer_2-1667946640736.png

sdayringer_3-1667946722972.png

 

OneStream Employee
November 10, 2022

Chances are that that parameter contains characters like / or :, which might be breaking things somewhere. You might want to wrap that into an XFBR that sanitizes it.

Newcomer
November 10, 2022

I'm still getting the illegal characters error... but not sure if I setup or am using the XFBR rule correctly... I've tried replacing "BRString" with "XFBR" as well as taking the exclamation points out in the parameter...

DASHBOARD XFBR STRING BUSINESS RULE:

sdayringer_3-1668090153636.png

BOOK SETUP:

sdayringer_2-1668090010890.png

 

sdayringer_1-1668089990550.png

ERROR:

sdayringer_0-1668089954081.png

 

ERROR DETAILS:
Source code: WcfRetryManager.cs, line 279, method ExecuteRetries.
.
Source code: WcfRetryManager.cs, line 351, method ExecuteRetriesStartingWithPreferredAppServerIndex.
.
Source code: WcfRetryManager.cs, line 483, method TryExecuteAction.
.
Source code: FileSystemWcf.cs, line 419, method GetFile.
.
Source code: FileSystemWcf.cs, line 563, method GetFileStream.
.
Source code: ExtensibleDocumentsWcf.cs, line 543, method ConvertStringsInFileUsingSubstitutionVariables.
.
Source code: ExtensibleDocBook.cs, line 274, method ConvertStringsInFileUsingSubstitutionVariables.
.
Source code: ExtensibleDocBook.cs, line 332, method ConvertStringsInFileUsingSubstitutionVariables.
.
Source code: XFLoopProviderHelper.cs, line 241, method RecursiveProcessChildItems.
.
Source code: XFLoopProviderHelper.cs, line 393, method RecursiveProcessLoopProviderItem.
.
Source code: ExtensibleDocBook.cs, line 474, method OnLoopProviderProcessItem.
.
Source code: ExtensibleDocBook.cs, line 698, method GetDashboardPrintItemForFile.
Illegal characters in path.

User Interface Stack Trace:

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at OneStream.Client.SharedUI.FileExplorerServiceReference.FileExplorerService.GetFileData(SessionInfo si, FileSystemLocation fileSystemLocation, String fileFullName, Int32 maxFileSize, Boolean processExtensibleDocument, Boolean convertToPdf, Dictionary`2 customSubstVars)
at OneStream.Client.SharedUI.FileLauncher.ProcessAndLaunchFileSystemFileUsingWPFClient(SessionInfo si, FileSystemLocation fileSystemLocation, String fileName, Boolean processExtensibleDocument, Boolean convertToPdf, Dictionary`2 customSubstVars, FileLaunchType fileLaunchType) in C:\agent\_work\606\s\Source\Client\Windows\ClientWindowsSharedUI\FileSystem\FileLauncher.cs:line 608

OneStream Employee
November 10, 2022

The right syntax to apply such an XFBR is:

 

XFBR(_BR_BookTitle, ConsBook, P_PeriodPrompt=|!P_PeriodPrompt!|)

 

XFBRs don't pick up Parameters automatically.

Note that, in the code seen, you're not doing any sanitizing, so any bad character will continue to be passed. You can have a look for a possible technique to do that in this post: https://community.onestreamsoftware.com/t5/Blog/Building-BiBlend-table-names-or-a-classic-tale-of-XFBR/ba-p/7843