DataSource and Layout - Migrating C1Report to FlexReport

Posted by: thomas.hayashi on 15 January 2020, 6:47 am EST

    • Post Options:
    • Link

    Posted 15 January 2020, 6:47 am EST

    Hello,

    Thanks for this community and @esha.dhir I was able to solve many problems related to the migration from C1 to C1Flex. Unfortunately, I’m facing others problems within the same report.

    After importing the following file on C1FlexReportDesigner [C1REPORT_ORIGINAL_00001#15684598#CORT^CORT.XML ]

    and adjusting all the previous issues that I had, it seems that I cannot preview.

    It returns the following error message:

    Error rendering report:
    Can not open the report data source [Main].
    Exception:
    XML in [C:\temp\Report\C1FLEX_CONVERTED_DADOS.XML] does not contain [] table.
    
    

    To make it easier to check the issue, I also zipped the converted file in at the end of this comment [C1FLEX_CONVERTED_00001#15684598#CORT^CORT.FLXR]

    Well… I’m able to preview if I change “5 - DB”, “7 - DB” and “6 - DB” subreports DataSource from “Main” to “None”. However, because it was an automatic conversion, I’m not sure if this is the right thing to do.

    Question 1: What’s the correct way to solve the previous error ?

    Question 2: I don’t know if it’s the consequence of my previous adjustment, but I get 2 warnings for ‘Evaluated expression ":null reference object’ that I’m unable to locate. If not critical, could you help me find the root for those 2 warnings?

    Question 3: When I visualize this report on C1Report the output is a 3 page report [C1Report_Original.PNG]. Each of the following subreport in one page: “2 - exm_T3_T3”, “2 - exm_T4_T4”, “2 - exm_GLI_GLI”. While the converted FlexReport version gives me a 2 page report. The first page has “2 - exm_T3_T3” and the second page squeezes the other two subreports “2 - exm_T4_T4” and “2 - exm_GLI_GLI”.

    Is there a configuration on C1Flex to make them equal ? Or at least similar ?

    Question 4: The last one, I’m failing to understand the difference between C1Report and C1FlexReport.

    Scenario 1) When I have a many subreports and two subreports are rendered TOGETHER in a single page there is a separator between them, in my case it’s a long ____ (This behaviour is expected and OK in both versions).

    Scenario 2) When it’s many subreports and they are in DIFFERENT pages, the separator is shown in C1Flex, but it was not in C1Report(previously).

    Is this avoidable with any configuration?

    Sorry for the amount of questions in a single thread. All questions were originated from the conversion of a single report and I thought it would be better to cluster them.

    Not sure if it’s relevant, these reports were generated from code.

    C1FlexReport version: 4.0.20193.393

    C1FlexReportDesigner.4, Version 4.0.20192.382

    C1ReportDesigner, Version 4.6.20132.54638

    Thanks

    Report.zip

  • Posted 15 January 2020, 10:43 pm EST

    Hello,

    Is there a specific reason why we have two different xml files used for binding to the reports? Can we not bind the converted FlexReport with the same xml you have used to bind C1Report?

    1. The error owes to having no proper data source for the subreports. While C1Report ignored this, FlexReport ensures that a DataSource is set, if it exists.

    2. I could observe one “Evaluate Expression” warning but would need to investigate on this further to see the cause of the same. However, this does not seem to be affecting the report’s rendering in any way and does not come as an error. Let me know if you need the details about the same and I shall be happy to help.

    3. “2 - queb_00001||15684598||CORT^CORT_ped_15684598” has Height property of the subreports set in GroupHeader1.OnFormat script. This is causing the fields to overlap somehow. Commenting these properties out makes the fields to render properly.

    4. I could not observe the difference. Please refer the attached gif showing the same. Let me know if something is missing.

    Regards,

    Esha

    Files.zip

  • Posted 16 January 2020, 12:58 am EST

    I’m satisfied with the answers for the questions numbers 1 and 2, thank you.

    3 - Sorry, because we are talking about migration I think the topics between C1Report and C1Flex got mixed up. To simplify I’ll attach only one report and a GIF.

    Following your instructions and commenting these lines didn’t give my desired layout

    
            <OnFormat>
    [exm_1_T3].Visible=iif(SeqProcedimento=1,True,False)
    '[exm_1_T3].Height=iif(SeqProcedimento=1,5629,1)
    [exm_2_T4].Visible=iif(SeqProcedimento=2,True,False)
    '[exm_2_T4].Height=iif(SeqProcedimento=2,5629,1)
    [exm_3_GLI].Visible=iif(SeqProcedimento=3,True,False)
    '[exm_3_GLI].Height=iif(SeqProcedimento=3,4439,1)</OnFormat>
    
    

    As the gif shows, the C1Report has 3 pages and the Flex report 2 pages. How to make Flex 3 pages like the C1Report ?

    Report.zip

  • Posted 16 January 2020, 1:22 am EST

    Because the last comment had a GIF at the limit of the upload size, I’ll address the question number 4 here.

    The GIF shows a separator between sub-reports. While there is NO separator on new page for C1Report, Flex is always showing. How to suppress this separator in Flex?

    I’ll attach the report and the gif

    Separator.zip

  • Posted 16 January 2020, 10:39 pm EST

    Hello,

    For 3:

    We need to re-adjust the SubreportField related to the third report because it is finding space on the second page and so, gets rendered there.

    For 4:

    I am investigating on this and will get back to you once it is done (Internal Tracking ID: 417489).

    Thanks.

    C1FLEX_CONVERTED_Question3.zip

  • Posted 17 January 2020, 7:14 am EST

    Thanks for answering question number 3. After your advice I was able to adjust to the desired layout.

    As for question 4, I apologize for my sloppiness, I did not take into account that several comments in the report is in my mother tongue. I know that you are already investigating and probably has more tools to do that, but I’ll try to give further explanation.

    On the “2 - queb_00001||15684571||CORT^CORT_ped_15684571” report, under the GroupHeader2.OnFormat property (I’ll translate here)

    
    'Variable to control if the exam is going to break the page
    QuebraPg = False
    
    'Hide separator between reports if it's the first on the page or it's going to break the page
    grpSeparadorLaudos_Header.Visible=iif(Paginou OR QuebraPg,False,True)
    
    'Verifies if it's going to be a new page by PageBreak, sets as a non new page(group pedido sets as a new page if it creates a new page)
    Paginou=QuebraPg
    
    

    And the GroupHeader0.OnFormat property (Also translated here)

    
    'Control new page to hide the separator
    Paginou=True
    
    

    So there is a logic between those two, in order to make that separator visible. Previewing the “2 - queb_00001||15684571||CORT^CORT_ped_15684571” alone works fine, but previewing the report as a whole “0 - Laudos” does not.

  • Posted 19 January 2020, 5:20 pm EST

    Thank you, Thomas. Appreciate your help on this.

  • Posted 21 January 2020, 4:44 am EST

    Hello,

    After a further investigation here, I believe I’ve pinpoint the root cause, but I’m still unable to reach a solution.

    As explained in my last comment, there is a logic between the GroupHeader0 and GroupHeader2 to hide or show the separator.

    When previewing the “2 - queb_00001|| …”, the variable ‘Paginou=True’ is applied correctly, which results in hiding the separator at each beginning of the page (Expected behaviour - same as C1Report)

    On the other hand, previewing the “0 - Laudos” doesn’t reset the variable ‘Paginou’ and consequently the variable remains False, always showing the separator (Wrong behaviour)

    To get to this conclusion, I’ll attach the report that I used. I’ve added a field with a Timer value inside the GroupHeader0 and GroupHeader2. Previewing"2 - queb_00001|| …" shows different values between GroupHeader0 and GroupHeader2 at each page; Previewing the “0 - Laudos” shows the EXACT SAME value for GroupHeader0 at different pages.

    Therefore, I concluded that GroupHeader0 is invoked only once and added through the pages.

    Is my analysis correct ? Because if right, what are my choices here ?

    In the end, I just want to hide that separator when it’s a new page or reset that variable Paginou at news pages. Is there a way to check if it’s a new page once per page?

    Separator_GroupHeader.zip

  • Posted 22 January 2020, 6:33 pm EST

    Hello Thomas,

    I could observe the same and we are investigating how it affects the rendering of the GroupHeader.

    I will get back to you once the team is done with the same.

    Thanks.

  • Posted 26 January 2020, 3:43 pm EST

    Hello Thomas,

    As per the development team:

    In FlexReport, unlike C1Report, sub-reports are first generated for an infinitely high page size, then inserted into the main report, and then broken into pages according to the main report’s layout. This for example allows to render two sub-reports side by side in FlexReport - which was not possible in C1Report. But this also adds the limitation on sub-reports, specifically any calculations based on pagination cannot work in sub-reports. So, this particular case is a limitation of FlexReport that cannot be fixed, unfortunately. The only solution is for the user to restructure their report definitions so that sub-reports do not use pagination-specific calculations.

    Regards.

  • Posted 27 January 2020, 7:29 am EST

    Hello, thanks for the update

    [quote] So, this particular case is a limitation of FlexReport that cannot be fixed, unfortunately. The only solution is for the user to restructure their report definitions so that sub-reports do not use pagination-specific calculations.[/i]

    [/quote]

    Sorry again, if I’m repeating myself, but I kinda feel lost here. If my sub-reports are dynamically generated, how do I perform checks for new generated pages ? In other words, if not by using pagination-specific calculations, how do I perform such feat?

  • Posted 27 January 2020, 6:12 pm EST

    Hello,

    Sorry, but this is a limitation.

    Restructuring the subreports is the only way possible to control the rendering. If the subreports are dynamically generated, you may still want to have a look at the layout of the report before they are generated by manipulating the code for report generation.

    Regards.

  • Posted 30 January 2020, 12:32 am EST

    Because this thread is quite long, I’ll summarize and set as the answer

    1. The error owes to having no proper data source for the subreports. While C1Report ignored this, FlexReport ensures that a DataSource is set, if it exists.

    2. I could observe one “Evaluate Expression” warning but would need to investigate on this further to see the cause of the same. However, this does not seem to be affecting the report’s rendering in any way and does not come as an error. Let me know if you need the details about the same and I shall be happy to help.

    3. Adjust the report size. Added some pixels on top

    4. Given the differences in Flexreport, it’s a limitation and I should restructure the report.

Need extra support?

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

Learn More

Forum Channels