Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aloha - Handy Batch File

Status
Not open for further replies.

ClayTaco

MIS
Sep 24, 2015
132
0
0
US
Figured I'd post this for future reference and possibly to save someone loads of time. I needed to run a report in Aloha going back to 2015 showing comps by month.
CFC reports don't have a way to run a report for X month. Instead you have to give a start date and the number of days to run. So for a simple example to view my audit report for the month of October 2015 I'd run:
D:\BootDrv\AlohaQS\Bin\rpt.exe /DATE 20151001 /XC /NODEPOSIT /DAYS 31 /Load audit.sls.set

Now I'm sure this is not the best way to do this but below is my final batch file. firstDay is the list of the first day of each month. The numDays array is the count of days in each month. Excel has functions to get both of these values easily. I used the firstDay as the array identifier to make my loop a little cleaner.

@echo off
setlocal enableDelayedExpansion


set firstDay=20181001 20180901 20180801 20180701 20180601 20180501 20180401 20180301 20180201 20180101 20171201 20171101 20171001 20170901 20170801 20170701 20170601 20170501 20170401 20170301 20170201 20170101 20161201 20161101 20161001 20160901 20160801 20160701 20160601 20160501 20160401 20160301 20160201 20160101 20151201 20151101 20151001 20150901 20150801 20150701 20150601 20150501 20150401 20150301 20150201 20150101

set numDays[20181001]=31
set numDays[20180901]=30
set numDays[20180801]=31
set numDays[20180701]=31
set numDays[20180601]=30
set numDays[20180501]=31
set numDays[20180401]=30
set numDays[20180301]=31
set numDays[20180201]=28
set numDays[20180101]=31
set numDays[20171201]=31
set numDays[20171101]=30
set numDays[20171001]=31
set numDays[20170901]=30
set numDays[20170801]=31
set numDays[20170701]=31
set numDays[20170601]=30
set numDays[20170501]=31
set numDays[20170401]=30
set numDays[20170301]=31
set numDays[20170201]=28
set numDays[20170101]=31
set numDays[20161201]=31
set numDays[20161101]=30
set numDays[20161001]=31
set numDays[20160901]=30
set numDays[20160801]=31
set numDays[20160701]=31
set numDays[20160601]=30
set numDays[20160501]=31
set numDays[20160401]=30
set numDays[20160301]=31
set numDays[20160201]=29
set numDays[20160101]=31
set numDays[20151201]=31
set numDays[20151101]=30
set numDays[20151001]=31
set numDays[20150901]=30
set numDays[20150801]=31
set numDays[20150701]=31
set numDays[20150601]=30
set numDays[20150501]=31
set numDays[20150401]=30
set numDays[20150301]=31
set numDays[20150201]=28
set numDays[20150101]=31



for %%d in (%firstDay%) do (

D:\BootDrv\AlohaQS\Bin\rpt.exe /DATE %%d /XC /NODEPOSIT /DAYS !numDays[%%d]! /Load audit.sls.set
ren D:\BootDrv\AlohaQS\rptexport\Audit.sls.csv %%d.csv

echo %%d

)

cmd /k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top