This is a migrated thread and some comments may be shown as answers.

Get the .trdx location path inside the suctom function dll file

3 Answers 252 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Janitha
Top achievements
Rank 1
Janitha asked on 29 Mar 2016, 05:42 AM
I have created a custom function for multilingual support. Inside this function I use path of the language files as an variable. But when I call Directory.GetCurrentDirectory() , System.AppDomain.CurrentDomain.BaseDirectory or other methods to get the report template file location it always returns the path of the 'TelerikReportDesigner.exe' and where the dll file resides (C:\Program Files (x86)\Telerik\Reporting Q1 2016\Report Designer). But my template file resides on another folder(ex:- E:\Reports\..) How can I get the template file location inside the custom function???

3 Answers, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 29 Mar 2016, 04:17 PM
Hello ,

Relative paths are resolved based on the execution folder of the running application. Test specifying the absolute path to the reports -  E:\Reports\...

You can also review this thread for information related to this topic.

Regards,
Katia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Janitha
Top achievements
Rank 1
answered on 30 Mar 2016, 03:30 AM
I cannot specify the absolute path since the path of the .trdx file changes dynamically. I was hoping that there is a way to identify that path as a relative path, not the path of the execution file. 
0
Katia
Telerik team
answered on 01 Apr 2016, 04:10 PM
Hi ,

GetCurrentDirectory() method will get the current working directory of the application. You can place the files from E:\Reports\.. location to the drive where the application is running to be able to use the relative path.

You can also map the relative path to base path that is provided via expression e.g. report parameter:
//custom function
public static string GetFullPath(string basePath, string relativePath)
{
    return basePath+relativePath;
}
 
//usage
"=GetFullPath(Parameters.BasePathParam.Value, '/FileName.ext')";


The report's BasePathParam  parameter can be updated on displaying the report.

Regards,
Katia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Janitha
Top achievements
Rank 1
Answers by
Katia
Telerik team
Janitha
Top achievements
Rank 1
Share this question
or