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!

Mid or left function in report writer

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
0
0
CA
Is there a function in report writer that will take off the first 5 or x number of characters from a string field in order to make another field. For example, a field with xxxxx-123456. I would like it to appear as 123456.
 
There are a number of functions of this type. Look at RW_Func.rtf in the SDK, which can be installed from CD 2.
Warner
 
I am using the RW_Right function listed in this document. It says to use:

Parameters:
in string IN_String.
in integer IN_Length.


So, I added the funtion, then the string, then 14, but it doesn't work. In SQL, it is simply right(docnumbr,14). This is the formula I have:

FUNCTION_SCRIPT(RW_Right RM_HATB_Document_TEMP.Document Number 14)

 
I have it working now, however, I need to create a header on this new calculated field. I no that a field is only listed in the section setup if you first add it to the sort, but no calculated fields are available to sort by. Am I not able to subtotal on a calculated field?
 
You should be able to subtotal on a calculated field. I know I've used the function to take part of a field. I'llsee if i can find it for u.


Thanks!
Barb E.
 
If you install the SDK from the Tools folder of CD2 of the Great Plains install discs, you will find the Report Writer Programmer's Interface document under Procedures and Functions.

This document contains the Report Writer functions I got added in GP v7.0, including RW_Left, RW_Right and RW_Substring.

As for creating a additional header on a calculated field, that is not possible. However, you could try using the additional header on the Document Number and suppressing it when the righthand 14 characters have not changed.

To suppress it you could create a calculated conditional field which compares the current value to the last occurrence and setting the returned value to 1 or 0 accordingly.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top