Sign in to follow this  
Followers 0
AC DC

Filename_Var

4 posts in this topic

I try to make a report in CX Supervisor with a variable number at the end. It should look like: Report_123.txt I tried this script: GenerateReport(ReportPath + "\report1.txt",ReportPath + "\Report_((Batch_nr)).txt") or GenerateReport(ReportPath + "\report1.txt",ReportPath + "\Report_((%d,Batch_nr)).txt") report1.txt is the original file and should be generated to an new report. But I get only files like: Report_((Batch_nr)).txt, while I want it to be Report_123.txt Is there a solution for this.

Share this post


Link to post
Share on other sites
I also have played with something like this but dropped it as I couldn't get it right. The problem is that the filename is already within quotes, therefore the point substitution ((...)) isn't executed and the filename becomes whatever you put in between the quotes. Perhaps you can set a text point e.g. ReportName with the filename and use the text point when you generate the report. Or use an alias ?

Share this post


Link to post
Share on other sites
Hello ACDC, Try - GenerateReport(ReportPath + "\report1.txt",ReportPath + "\Report_" + ((Batch_nr)) + ".txt"). This is a fairly standard method used to concatenate a variable within a string. In this instance, "Report_" (string) with Batch-nr (variable) and ".txt" (string). Hope this helps Regards anonymous

Share this post


Link to post
Share on other sites
This one works: value = Batch_nr value defined as integer textpoint = ValueToText(value) textpoint defined as string GenerateReport(ReportPath + "\report1.txt",ReportPath + "\Report_" + textpoint + ".txt") Thanks for the help! Edited by AC DC

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0