Converting .trdx to .cs

4 posts, 1 answers
  1. Randy
    Randy avatar
    12 posts
    Member since:
    Apr 2014

    Posted 09 May 2014 Link to this post

    So I have reports that are generated with the standalone report generator, I'm wondering if it is possible to convert them to .cs files (as if they were generated with the integrated tool instead). If this still isn't possible then I'm curious if there is an easy way to have the Report Manager find .trdx files so that it can be loaded with the report catalog that came with the example package.

    I know how to show the reports on the client individually, but I can't figure out how to show both types of files in a consolidated reports catalog. Ideally I'd like it if the report catalog found .trdx reports and .cs reports and make the end user unaware of the fact that they are stored differently.
  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 10 May 2014 Link to this post

    Hi Randy,

    Currently, there is no option to import TRDX files in Visual Studio. For now we support only import of VS reports into the Standalone Designer.

    You can still deserialize the reports in Telerik.Reporting.Report objects and enlist them in a catalog with the available reports, by using a similar to ours ReportManager implementation (the one from our local examples installed by default under C:\Program Files (x86)\Telerik\Reporting Q1 2014\Examples\CSharp\ReportLibrary). To unify the work with the manager, it can returns the deserialized report object of TRDX files or an instance of a report created in Visual Studio.

    I hope the above information helps you.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Randy
    Randy avatar
    12 posts
    Member since:
    Apr 2014

    Posted 19 May 2014 in reply to Stef Link to this post

    I appreciate the answer, however I don't completely understand how to go about doing this. Could you give an example of adding the .TRDX files (or at least their contents) to the report catalog?
  5. Answer
    Stef
    Admin
    Stef avatar
    3036 posts

    Posted 22 May 2014 Link to this post

    Hello Randy,

    Ideally, you can serialize all reports in XML format and return a collection of their paths on the server, which can be directly used with an UriReportSource and set for the navigate to report action in the ReportCatalog.


    If not, the approaches are to gather the information for all existing reports in a collection and use an user function and a binding to the TextBox.Action property. The user function would return a NavigateToReportAction.

    For example, the ReportManager gets the current assembly and extracts all types from it. Then it checks if each type is actually a Telerik.Reporting.IReportDocument. If yes, there is created a ReportInfo object for that type. Note the ReportInfo class has a property AssemblyQualifiedName, which gets the assembly qualified name of the stored type.
    This ReportInfo can be extended with a property, which stores the paths of TRDX files, retrieved by searching the reports project's directory. And another one pointing the report format.
    Also the ReportInfo can be extended with a property that return a Telerik.Reporting.Report - the deserialized TRDX file or an instance of the type.

    Then in the user function, you can use these fields to determine what type of report source to be created and assign it to the NavigateToReportAction.


    There are many approaches to create a library with mixed report formats and you have to consider yours with your custom requirements.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top