CREATE DOCUMENT .doc with custom filename

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
srufini
Posts: 34
Joined: Thu May 23, 2019 11:23 pm

CREATE DOCUMENT .doc with custom filename

Post by srufini »

Hello,

to export some reports of a BO, I use the word templates/report and the command button in the menu of the form "CREATE DOCUMENT". This is the only way I managed to make it work with html, pictures embedded and sub_report, so using "presentations"is not an option.

When the user exports the document on its local machine, the filename is always "nameoftemplate_timestamp.doc" .

Is there a way to assign to the exported file the value of an attribute?

Thanks

Sergio
Jaymer
Posts: 2455
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: CREATE DOCUMENT .doc with custom filename

Post by Jaymer »

Feb 12, 2021
I sugg. this to Vlad in an email, but it got no traction.

Back then, I found an error where Chrome introduced a cacheing bug - Initially, Vlad didn't believe me - but fortunately other users started to complain as well.
If you output a PDF using DISPLAY DOCUMENT, Chrome would display it fine - it always had for years.
Then, if you quickly made another (like, another report with diff. criteria or diff customer), the filename was still the same.
Chrome would display the 1st report because it was in cache, which could be embarrassing if you didn't catch it and sent it out.
(It was repeatable, usually if you ran reports one right after the other - it wouldn't happen across logins, or on another day)

Hi solution was to append a timestamp, which I agreed on. Aware has a "docs" folder it writes these temp files out to and cleans this up periodically.
In that emailing back and forth, I wrote the following:
Given that you’re moving in that direction, if you ARE going to append a unique name, then a timestamp would suffice.
Even if 2 users did something at EXACTLY the same time, thats not an issue because its a diff. Session, DOCS folder and client.

So “RO_Summary_20210212104123” wouldn’t be the worst thing.

Given that, if you could implement the “AS filename” modification to “DISPLAY DOCUMENT”, then I could handle it myself…
"RO_Summary_1000_23” would be adding the Invoice# (1000) + the seconds from the timestamp (23)
So this just makes it a cleaner name and makes it easier for the user to save since the Invoice# is already part of the desired saved PDF filename.
Sergio, I'm sure this makes sense to you - not sure if Vlad saw any value.
Anytime someone runs a report, like an Invoice, or a Customer Ledger, it would be nice if when the PDF displayed it was ALREADY named “Customer Ledger for Acme Corp, May 2023 11:13:14” . After all, a Process just created it and has access to the context data to name it.

And it can almost be saved as that name exactly so when its emailed as an attachment, its clear what the attachment is.
But now, if every PDF is named “Customer Ledger_20230316101523” then the user not only has to remove the timestamp, but they have to type in “Acme Corp, May 2023”
It just makes sense to be able to name the PDF.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2455
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: CREATE DOCUMENT .doc with custom filename

Post by Jaymer »

srufini wrote: Thu Jul 06, 2023 4:21 pm Is there a way to assign to the exported file the value of an attribute?
Oh, and the direct answer it NO.
No guarantee Vlad will see this - perhaps send him an email.
This would be an EASY improvement.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
srufini
Posts: 34
Joined: Thu May 23, 2019 11:23 pm

Re: CREATE DOCUMENT .doc with custom filename

Post by srufini »

Thank you Jaymer for your answer,

I don't really mind the timestamp, but I need the prefix to be an attribute. I will add this post to the whish list then.

Cheers

Sergio
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: CREATE DOCUMENT .doc with custom filename

Post by PointsWell »

I vaguely remember that you can control the name of a document when it is attached to a BO.

It is a bit of a work around, but could you create a document and then attach it to an instance of a BO to rename it before then using the document as you intended?

Don't know if non persisted BOs interact with documents but that would be my first test as the BO will then naturally be disposed of once the process moves on. It would mean that you'd have to write a process rather than just use the AIM operation.
Post Reply