dbTalk Databases Forums  

Naming an Excel file

comp.databases.filemaker comp.databases.filemaker


Discuss Naming an Excel file in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Paine
 
Posts: n/a

Default Naming an Excel file - 10-19-2005 , 08:35 PM






FM8. I have added a button to a layout to Export records as Excel. The
Specify options allow me to select the fields to export and also to name
the worksheet within the spreadsheet from a field value.
However, there does not seem to be a way to automatically generate a
unique name of the spreadsheet file based on a field value. Can this be
done with a script?
Michael Paine

Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Naming an Excel file - 10-19-2005 , 09:39 PM






Michael Paine wrote:
Quote:
FM8. I have added a button to a layout to Export records as Excel. The
Specify options allow me to select the fields to export and also to name
the worksheet within the spreadsheet from a field value.
However, there does not seem to be a way to automatically generate a
unique name of the spreadsheet file based on a field value. Can this be
done with a script?
Michael Paine
In FM8, you should be able to set a variable to the file path for the
..xls, then enter that variable name in your Export script step.

So you might set a variable ($ExportPath) to:
"file:" & get(desktoppath) & "/" & "Data_as_of_" &
dayname(get(currentdate)) & ".xls"

And then in your export script step, set the destination as $ExportPath


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
Michael Paine
 
Posts: n/a

Default Re: Naming an Excel file - 10-19-2005 , 11:42 PM



Worked perfectly, thanks Howard

Michael Paine

-------
Set Error Capture [ On ]
Set Variable [ $$FILE_NAME; Value:"fileATA/" & VARIANT::model_id &
".XLS" ]
Export Records [ File Name: “$$FILE_NAME”; Use field names as column
names; Worksheet: VARIANT::model_id ]
[ No dialog ]
--------------------

Howard Schlossberg wrote:
Quote:
Michael Paine wrote:

FM8. I have added a button to a layout to Export records as Excel. The
Specify options allow me to select the fields to export and also to
name the worksheet within the spreadsheet from a field value.
However, there does not seem to be a way to automatically generate a
unique name of the spreadsheet file based on a field value. Can this
be done with a script?
Michael Paine


In FM8, you should be able to set a variable to the file path for the
.xls, then enter that variable name in your Export script step.

So you might set a variable ($ExportPath) to:
"file:" & get(desktoppath) & "/" & "Data_as_of_" &
dayname(get(currentdate)) & ".xls"

And then in your export script step, set the destination as $ExportPath



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.