So i built a framework with a reporter process that will get all the transactions at the end of the day, but I need the Excel file to have the date and time (ex. YYYY-MM-DD-THH_MM_SS-EODReport.xlsx) in this format.
I have a build report workflow, and am passing an argument for the file path.
String.Format(In_Config(“X_ReportPath”).ToString,Environment.GetFolderPath(Environment.SpecialFolder.Desktop),DateTime.Now.ToString(“yyyyMMddHHmmss”),In_Config(“OrchestratorQueueName”).ToString)
When i run my file, it successfully generates the file but it only generates it as “EODReport.xlsx”. Is there anything i can do?
@dylanTana get full folder path in veriable.
then right
Folderpath+“back slash symbol”+DateTime.Now.ToString(“yyyyMMddHHmmss”)+In_Config(“OrchestratorQueueName”).ToString
string.format is used when we are trying to add string specific place and you are not mentioning that place
That’s because String.Format is a fancy Replace. It takes the first parameter (your X_ReportPath) and then replaces {0} {1} etc values with the remaining parameters. But you don’t have any {0} {1} etc in your X_ReportPath so there’s nothing to replace and it just spits back out X_ReportPath.
As others have said, use Path.Combine instead of String.Format.
Excel we are writing with the provided activities e.g. write range, append range CSV we do write the the CSV related activities e.g. write CSV file or doinng it on text file base
share your last statement whenever you cannot fix it by your own by prototying the file name within the immediate panel during a debug run and get paused by a breakpoint.
You don’t use Path.Combine to build the filename. You use it to combine the final filename with the rest of the path. So you need an assign to set the filename: