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

Get current open report path

1 Answer 362 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Janitha
Top achievements
Rank 1
Janitha asked on 22 Oct 2018, 07:05 AM

Hi,

I have created a custom user function for translation where I will get the translations from a .po file and replace the values. The issue is these .po files resides in the same directory where the / file is. But these files are dynamic hence I cannot specify a static path inside my function. Is there a way to get the current path of the opened / file? I have tried 'Directory.GetCurrentDirectory()' and 'Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location' but both returns the path for the Telerik.ReportDesigner.exe 

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 25 Oct 2018, 09:03 AM
Hello Janitha,

In general .po (portable objects) files are translation files. However, for localizing reports we use with RESX files.
Indeed, built-in localization with RESX files is not available for the Standalone Report Designer due to limitations of localizing XML documents. So, the suggested approach is to create a user function that will accept resource key and optionally string report parameter specifying the culture code. Based on these parameters, localized string resources can be displayed in XML documents.

We are considering built-in support for TRDX/TRDP/TRBP report localization as there is such request in our Ideas & Feedback portal. Please leave your vote for the request: Declarative report definitions (TRDP, TRDX, TRBP) localization.

User functions are, indeed, getting the path to the Standalone executable file, since the DLL with the custom function should be placed in the root location where the application is being executed. Getting the current path to the report (TRDP/TRDX) file is not feasible at this moment. I can suggest to move the resource files at the same directory as the .dll - right next to the executable file of the Standalone application.

We can research the possibility of getting the current path to the report files in our future releases. So, feel free to log it as a new feature request into our feedback portal.

Regards,
Silviya
Progress 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
Silviya
Telerik team
Share this question
or