web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

ReportWriter - Legends in calculated fields

(0) ShareShare
ReportReport
Posted on by 140

Hello,

I need help, please. I modified the Checkbook Register report on ReportWriter and I want to get the value of legend 11 (date). I want to use this value in a function on Visual Basic.

 The ReportWriter manual says :"Legend values can also be used as elements in calculated fields."

I created a calculated field called FechaHasta with data type date but when I print the report, I receive a error message: "Type mismatch Symbol 'FechaHasta'".  What type should I use? or How should I get the legend value?

Thanks,

Carla

*This post is locked for comments

I have the same question (0)
  • winthropdc Profile Picture
    on at

    Hi Carla

    Legends are of string datatype, so you will need to have your calculated field as a string.

    You could then convert it to a date using VBA code.

    You could also use report writer functions in a number of calculated fields to convert the string date to a actual date field.

    You can use RW_Left(), RW_Right(), RW_SubString() to grab the characters for month, day and year.  Then you can use the system function STR_LNG to convert them to integers and finally, you can use RW_MakeDate() convert into a date.

    For information on using Report Writer functions as user defined functions in calculated fields, have a look at the Report Writer Programmer's guide document in the SDK (Software Development Kit).  The SDK can be loaded from the Tools folder of CD2 or downloaded from CustomerSource or PartnerSource.

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

     

  • Carla Hinojosa Profile Picture
    140 on at

    Thanks a lot David.

     Carla

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

     Hi David,

    After several hours of research, I came back to your posting, since I think the two functions RW_MakeDate and RW_DateToString are the ones I'll probably have to use, but I'm not able to figure out yet how...

    My problem is rather simple (in my opinion), but no one seems to have bothered with that yet : I wanted to have the current system date & time printed in the footer of my SOP_Blank_Form.  I looked everywhere from the ReportWrite doc, to the VBADeveloppersGuide and the MS course about RW, but wasn't abel to figure out how to get the SysDate & SysTime in a calculated field... it seems they can only be used as direct fields in the report layout, but then there is only very limited format options if ever.

    Any hints would be welcome on how to get a calculated string that would look like "Printed on : June 10, 2009 / 14:13" for example.

    Thanks in advance for your help and have a great time,

    Beat

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans