Chaya,

First, welcome to R:BASE world!

It was certainly a pleasure meeting you at the R:BASE SAT session in Monroeville, PA.

Now to your question #2, as you have already received the answers and examples for question #1.

When exporting data as Excel using GATEWAY EXPORT command, you can totally automate the process
of generating XLS/XLSW file into predetermined location.

Here's how ...

Let's say you always want to generate the XLS spreadsheet(s) into a sub-folder, such as "XLS"
underneath the folder of your current database directory.

Based on sample RRBYW19 database, here's code that you may recycle, as you see fit.

-- Start here ...
-- Generate MS Excel (XLS) worksheet using GATEWAY EXPORT XLS command
IF (CVAL('DATABASE')) <> 'RRBYW19' OR (CVAL('DATABASE')) IS NULL THEN
   CONNECT RRBYW19 IDENTIFIED BY NONE
ENDIF
IF (CHKFILE('XLS')) <> 1 THEN
   MD XLS
ENDIF
   SET VAR vCaption TEXT = 'Customer List'
   -- Defile folder and unique file name
   SET VAR vXLSFileName  = +
   ('XLS\Customer_List_As_of_'+(FORMAT(.#NOW,'YYYYMMDD_HHNN'))+'.xls')
   -- Delete previously created XLS file with exact same name, if any
   SET ERROR MESSAGE 2077 OFF
   DELETE .vXLSFileName
   SET ERROR MESSAGE 2077 ON
   CLS
   PAUSE 3 USING 'Collecting list of Customer ...' +
   CAPTION .vCaption ICON WINDOWS +
   OPTION BACK_COLOR WHITE +
   |MESSAGE_FONT_NAME Tahoma +
   |MESSAGE_FONT_COLOR NAVY +
   |MESSAGE_FONT_SIZE 11
   GATEWAY EXPORT XLS &vXLSFileName +
   SELECT +
   Company AS `Customer Name`, +
   CustAddress AS `Street Address`, +
   (CustCity+','&CustState&CustZip) AS `City, State, and Zip Code`, +
   CustPhone AS `Phone Number`, +
   CustEMail AS `E-Mail Address` +
   FROM Customer ORDER BY Company +
   OPTION SHOW_PROGRESS ON +
   |COL_NAMES ON +
   |HEADER_TEXT 'List of Customers' +
   |HEADER_TEXT .#NOW +
   |HEADER_TEXT ' ' +
   |TAB_NAME Customer List +
   |ACTION OPENVIEW
   CLS
   RETURN
-- End here

Simply run this command in RRBYW19 folder, and see how cool the entire process is.

Note the Custom Column Names, Spreadsheet Header with Current Date/Time, and the Custom Tab Name.

Feel free to reach out to me if you have any questions.

Have fun!

Very Best R:egards,

Razzak

At 04:12 PM 5/25/2017, Chaya Goldberg wrote:

Hi, thanks for this list.  It's my first time writing in.

I have two questions:

1. Is there a way to get a count of updated records? I have a SQL UPDATE statement and would like to display a message with the count of updates. Right now I'm counting the fields in a temporary table ­ whicch works, but is not 100% accurate, in that it's counting pending updates and not actual updates. Is
there a way to directly count the updates?

2. I'm doing a gateway export into excel. Is there a way to automatically save the generated excel
document in a predetermined location?


--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to