FlexReport: Require Distribution of .FLXR Files

Posted by: sales on 15 May 2019, 2:06 pm EST

    • Post Options:
    • Link

    Posted 15 May 2019, 2:06 pm EST

    We are early in testing\evaluating the FlexReport\FlexViewer controls as a replacement for Crystal Reports (CR) for Winform applications.

    Our methodology has been to create a generic report definition based upon a dataset\data table and have the application pass the recordset to the report.

    In the CR environment, the report objects\definitions become incorporated in the .EXE. It appears with C1FlexRpt the FLXR report definition files will need to be included as external files on a user’s workstation.

    Is there away to compile the FLXR report definition in the .EXE file?

    Example Implementation below:

    
      ....
    	<Build dataset in application>
      ....
    
       Dim dt As New DataTable
       dt = ds.Tables("rptResults")
    
       'load report definition :: 
       [b] 'Q: Is this required to be distributed as a separate file external from the application .exe?[/b]
       Me.c1FlexRpt01.Load("\rptsApp.flxr", "Report Name 01")
    
       ' use DataTable as the data source
       Me.c1FlexRpt01.DataSource.Recordset = dt
    
       ' preview the report
       Me.c1FlexViewer01.DocumentSource = c1FlexRpt01
    
    
    
  • Posted 16 May 2019, 3:30 am EST - Updated 4 October 2022, 1:14 am EST

    Hello,

    Thank you for showing your interest in ComponentOne controls.

    Visual Studio by default publishes only the non-code files along with the application.

    You can change the flxr file’s Build Action to Content from the properties window, in order to deploy the flxr along with the application.

    As soon you do it, you will be able to see that the *.flxr file too becomes available for publish (To check, right click the project → Under ‘Publish’ tab → select ‘Application Files…’, in the available list you should now be able to see the *.flxr file).

    Now, just re-publish the application and it should run correctly, thereby including the flxr file in the directory containing the exe and the related dlls.

    Best Regards,

    Esha

  • Posted 16 May 2019, 6:01 am EST

    Hi sales,

    C1FlexReport also provides a method “Load(Stream stream, string reportName)”, which can be used to load ther report from a stream.

    This link explains how to obtain a stream from an embedded resource:

    https://stackoverflow.com/questions/3314140/how-to-read-embedded-resource-text-file

    Hope this helps

    Wolfgang

  • Posted 16 May 2019, 12:42 pm EST

    Thanks to you both for the resolution\implementation ideas.

    • Ed
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels