cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Script : Generate Dynamic Filename

Corrupt-07
Newcomer
0 Kudos
176

import com.sap.gateway.ip.core.customdev.util.Message

import java.text.SimpleDateFormat

 

def Message processData(Message message) {

    def date = new Date()

    def sdf = new SimpleDateFormat("yyyyMMdd_HHmmss")

    def timestamp = sdf.format(date)

    def fileName = "Invoice_" + timestamp + ".pdf"

 

    message.setProperty("dynamicFilename", fileName)

    return message

}

View Entire Topic
0 Kudos

Hi Michael,

Yes it is, you'll have to either hire a .NET Developer or use a third party tool that can do it for you.

You can get the CR installer into VS 2010->2015 from here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Install VS first then the first link to install into VS, all other are for distributing the runtime only, do not install them on the Developers PC.

The API to use is ReplaceConnection(), search, you'll find a KBA on how to.

And added CR for VS Tag to your post.

Don