Export Reports using AwareIM data & Displaying same (#3)

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Export Reports using AwareIM data & Displaying same (#3)

Post by tford »

This builds on BSV built in two posts below:

http://www.awareim.com/forum/viewtopic.php?t=3479
http://www.awareim.com/forum/viewtopic.php?t=3481

This BSV demonstrates:
A) naming report files with AwareIM BO attributes in context
B) giving user the ability to save or email report with name from #1
C) eliminating extra messages / mouse clicks in report display

Steps:
1) Add a Report: OneCityReport . Determined at run time. Include City.Name and City.Country on the Detail Line.

2) Add process: ExportAndViewOneCityReport

PICK FROM 'City List' ORDER BY City.Name

EXPORT DOCUMENT OneCityReport TO FILE SystemSettings.ExportPath_Temp+'Report_300__City_'+City.Name+'.pdf'

DISPLAY URL SystemSettings.DisplayURLPrefix_Temp+'Report_300__City_'+City.Name+'.pdf' IN NEW WINDOW

3) Add "One City Report" to the Menu. This will run process from #2 above.


Now run a test:

After clicking the menu option from #3 above, you will get a Pick list.

When you choose a city & click OK, the PDF report will open in a new screen. It can be saved or emailed with a name that includes the City the user selected.


Obviously you can use different syntax of DISPLAY URL depending on your needs.











Tom - V8.8 build 3137 - MySql / PostGres
Sergej
Posts: 218
Joined: Tue Aug 30, 2011 2:24 pm
Location: Russian Federation

Post by Sergej »

Hi!
Is it possible to display url containing path where document was exported IN FOLDER ?
AwareIM 5.1a build 1454, Debian 64bit , MySQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Is it possible to display url containing path where document was exported IN FOLDER ?
It should be possible.

You would have to modify the syntax here to use the folder name in the URL being build for display:

DISPLAY URL SystemSettings.DisplayURLPrefix_Temp+'Report_300__City_'+City.Name+'.pdf' IN NEW WINDOW
Tom - V8.8 build 3137 - MySql / PostGres
Sergej
Posts: 218
Joined: Tue Aug 30, 2011 2:24 pm
Location: Russian Federation

Post by Sergej »

I meant

Code: Select all

The FOLDER keyword specified after the TO keyword identifies the directory in the file system where the file will be written. Note that if the file with this name already exists in the specified folder, it will not be overwritten. Instead another file with the variation of the original name (for example, originalName0) will be created.
So how is it possible to get path of that created file?
AwareIM 5.1a build 1454, Debian 64bit , MySQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

EXPORT DOCUMENT OneCityReport TO FILE SystemSettings.ExportPath_Temp+'Report_300__City_'+City.Name+'.pdf'

DISPLAY URL SystemSettings.DisplayURLPrefix_Temp+'Report_300__City_'+City.Name+'.pdf' IN NEW WINDOW
Notice in my rules that I use EXPORT .. TO FILE syntax

but I allow the configurator or user to determine the folder / path that is used for file storage in SystemSettings.DisplayURLPrefix_Temp
Tom - V8.8 build 3137 - MySql / PostGres
Sergej
Posts: 218
Joined: Tue Aug 30, 2011 2:24 pm
Location: Russian Federation

Post by Sergej »

I am trying to construct process of Order BO that:

1) Exports Document based on Order BO to folder A
2) Gets the Path to exported document
3) Stores Path to Order BO attribute DocPath

All Documents are exporting to the same folder A. I think the solution is to use Order.ID as a filename so documents in folder will not be overwritten.
AwareIM 5.1a build 1454, Debian 64bit , MySQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Using Order.ID seems to makes sense in your situation.

Do you have additional questions?
Tom - V8.8 build 3137 - MySql / PostGres
Sergej
Posts: 218
Joined: Tue Aug 30, 2011 2:24 pm
Location: Russian Federation

Post by Sergej »

No, thanks! I think it should work.
AwareIM 5.1a build 1454, Debian 64bit , MySQL
Post Reply