Level 3 Assignment 2 - ReportFilePath is showing incorrect path

I am stuck with ReportfilePath which is navigating i.e. getting saved under incorrect path

ReportFilePath is given as path.Combine(Environment.CurrentDirectory,in_ReportsDownloadPath,“Report-” +in_TaxID+"-"+ in_Year.ToString + “-” + Month+".csv")

While Debugging observed that ReportFilePath value is becoming null and slashes are added in in_ReportsDownloadPath

Can someone help with Yearly Report Download workflow where I have missed

Hi @Leela_Javvaji

Check this

Thanks
Ashwin S

Hi @AshwinS2

My issue is Path.Combine is not working when I checked individually. When I am using path.combine of environment.currentdirectory with other value then ReportFilePath actually not combining the value of current directory. Its getting saved in some other directory

Hi @Leela_Javvaji
Check this

Thanks
Ashwin S

As said in the above, I restarted my workflow but still its same. And also to have trail version, I have written small steps to check path.combine working but its not. PFB

And I have system.IO namespace as well as stated in the above solution

Attaching my create yearly report workflow also. Please help to understand where I have missedSystem1_CreateYearlyReport.xaml (37.0 KB) Main.xaml (59.6 KB) Process.xaml (24.0 KB)

Can someone help me on this issue

hi @Leela_Javvaji
In type into activity enable Simulate Type
hope this will work
cheers

hi @Abdulkader_Sandouka1

I have tried with both the ways by checking and unchecking Simulate type but it didnt work

Use this below code and check,
path.Combine(Environment.CurrentDirectory,in_ReportsDownloadPath,“Yearly-Report”+in_Year+"-"+in_TaxID+".xlsx").

Send me your path which is you assigned to this variable,
“in_ReportsDownloadPath”?..
If any back slash is present at the end of the “in_ReportsDownloadPath”, remove that.

Slashes are added in in_ReportsDownloadPath. Not sure why its being added everytime and also path.combine is not combing the path of current direct directory with in_ReportsDownloadPath

Put single back slash every where in in_ReportsDownloadPath and try.

in_ReportsdownloadPath value is fetching from config file only as per my understanding.Please correct if I am wrong

and also why its not routing to current directory.

Remove end back slash and check if you get any error.

1 Like

Hi @Manish540

Thank you very much. It worked now and its pasted correct value.
1 more small help . Merge Datatable is showing now Object reference not set to instance of an object

Source Datatable has value

How you created the “dt_YearlyReport” datatable in the workflow???..
Whether you created the “dt_YearlyReport” in the assign as,
“dt_YearlyReport = new Datatable”

3 Likes

Thanks alot :slight_smile: @Manish540

It worked

1 Like

Your Welcome
Happy Automation :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.