Daily Report - AB Mobile

Top  Previous  Next

Steps to Creating a  Custom Daily Report for ABM

 

1.Create Custom Version of Daily Report in the MAR PM Forms section

2.Update the report security on the form.

3.Set the Report Class setting on this form to use CUSTOM Script, if applicable.

4.Tweak the Custom Script for Class 401, if applicable.

5.Set up Custom Form Assignment.

6.Use MAR Script tool to modify class 112000.  Remove sample text and replace with text below.  Script references the ADMS record number of the custom form so be sure to update the script where indicated (ADMS record number is referenced twice).  IMPORTANT NOTE - Whenever the custom report is modified, you will need to modify the 112000 script for the new MAR ADMS Rec ID or else mobile will not reflect the latest changes…

7.Refresh the ABM Stored Procedures (File > System Admin > ABM)

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

try

 drop procedure abm_RunMarReport_DRPMID;

catch all

end;

 

CREATE PROCEDURE abm_RunMarReport_DRPMID

  (

     UserID Integer,

     ReportClass Integer,

     ReportName CHAR ( 50 ),

     PartialRunFilter CHAR ( 750 ),

     StartDate DATE,

     EndDate DATE,

     DateOption Integer,

     JobListType Integer,

     ReturnReportFileNameandPath CHAR ( 500 ),

     ReturnReportFileType Integer,

     ReportRecordID Integer,

     ResultCode Integer OUTPUT,

     ResultMessage CHAR ( 1500 ) OUTPUT

  )

BEGIN

 

Declare @UserID integer;

Declare @ReportClass Integer;

Declare @ReportName string;

Declare @PartialRunFilter string;

Declare @StartDate DATE;

Declare @EndDate DATE;

Declare @DateOption Integer;

Declare @JobListType Integer;

Declare @ReturnReportFileNameandPath string;

Declare @ReturnReportFileType Integer;

Declare @ReportRecordID Integer;

Declare @SQLStmt string;

Declare @ResultStatus integer;

Declare @ResultMessage string;

 

 

@UserID = (select UserID from __input);

@ReportClass = (select ReportClass from __input);

 

// REPLACE SAMPLE TEXT WITH ADMS RECORD NUMBER FOR CUSTOMER

//@ReportName = (select ReportName from __input);

@ReportName = 'C0000518.401';

 

 

@PartialRunFilter = (select PartialRunFilter from __input);

@StartDate = (select StartDate from __input);

@EndDate = (select EndDate from __input);

@DateOption = (select DateOption from __input);

@JobListType = (select JobListType from __input);

@ReturnReportFileNameandPath = (select ReturnReportFileNameandPath from __input);

@ReturnReportFileType = (select ReturnReportFileType from __input);

 

// REPLACE SAMPLE TEXT WITH ADMS RECORD NUMBER FOR CUSTOMER

// @ReportRecordID = (select ReportRecordID from __input);

@ReportRecordID = 518;

 

@SQLStmt ='EXECUTE PROCEDURE abSy1_ABAEP_RunMARReport(';

@SQLStmt =@SQLStmt +trim(convert(@UserID,sql_char));

@SQLStmt =@SQLStmt +','+trim(convert(@ReportClass,sql_char))+','''+trim(@ReportName)+''',''';

@SQLStmt =@SQLStmt +trim(@PartialRunFilter)+''','''+trim(convert(@StartDate,sql_char))+''',''';

@SQLStmt =@SQLStmt +trim(convert(@EndDate,sql_char))+''','+trim(convert(@DateOption,sql_char))+','+trim(convert(@JobListType,sql_char))+',''';

@SQLStmt =@SQLStmt +trim(@ReturnReportFileNameandPath)+''','+trim(convert(@ReturnReportFileType,sql_char))+','+trim(convert(@ReportRecordID,sql_char))+');';

try

execute immediate @SQLSTMT;

@ResultStatus = 0;

@ResultMessage = @SQLSTMT;

catch all

@ResultStatus = -1;

@ResultMessage = __errText+' SQL Statement Failed: '+@SQLStmt;

end;

 

if @ResultStatus = -1 then

try

insert into __Output (ResultStatus,ResultMessage) VALUES (@ResultStatus,@ResultMessage);

catch all

end;

endif;

 

END