Migration to C1FlexReport: outline tree

Posted by: wknauf on 13 August 2018, 8:28 am EST

    • Post Options:
    • Link

    Posted 13 August 2018, 8:28 am EST

    Hi C1,

    I started the migration to C1FlexReport. The outline tree causes trouble: in the old C1Report reports, we had a lot of reports which grouped by an ID field. While creating the report data, we put the “ID to display text” mappings in a dictionary.

    Later, we used the “C1Report.AddOutlineEntry” event to look up an outline key from our dictionary and return the display text.

    Seems this was removed completely. Is there any chance to change the outline texts after the report is rendered?

    Probably the correct way to do this is to change the “OutlineLabel” script in the group sections so that it does not access the ID field but calculates the display value based on some other fields.

    But this would mean that I have to edit a bunch of reports.

    Best regards

    Wolfgang

  • Posted 14 August 2018, 12:43 am EST

    Hello Wolfgang,

    That’s right. The AddOutlineEntry event has been removed in C1FlexReport. To change the text of the outline entry generated by a field/section/subsection, the OutlineLabel property must be used. That’s the only way to do so.

    Best Regards,

    Esha

  • Posted 14 August 2018, 5:13 am EST

    Hi Esha,

    is it possible to change the outline after the report was rendered? I have all necessary values. This would be easier for me than having to edit a bunch of old reports.

    It would be even OK for me if you could add something to the C1FlexViewer code - I could wait until this is added. It is some kind of tree control - so if I could access the outline tree, even with reflection, and change the display texts, this would be OK. Or some event “Translate outline node”?

    Best regards

    Wolfgang

  • Posted 14 August 2018, 6:07 am EST

    OK, I found it - it is easier than I thought ;-):

    I handle e.g. the C1FlexReport.GenerateCompleted event. Here, I can modifiy the outline:

        private void c1FlexReport1_GenerateCompleted (object sender, AsyncCompletedEventArgs e)
        {
          if (this.c1FlexReport1.Document.Outlines[0].Caption == "myID")
          {
            this.c1FlexReport1.Document.Outlines[0].Caption = "myDisplayText";
          }
        }
    

    Best regards

    Wolfgang

  • Posted 14 August 2018, 7:24 am EST

    One problem: if the Outline tree is previously visible, it has to be hidden before rendering the report. Otherwise the report values are displayed instead of my replacements. Seems the changes to the OutlineNode captions are only applied if the tree is rendered initially.

    So:

    1. handle the “C1FlexReport.StartReport” event and hide the outline:
     c1FlexViewer.ShowOutlines = false;
    
    1. after replacing the outline in “C1FlexReport.GenerateCompleted” event, show the outline again. This has to be done by “Invoke”:
            this.Invoke(new MethodInvoker(() =>
            {
              c1FlexViewer.ShowOutlines = true;
            }));
    
  • Posted 16 August 2018, 5:20 am EST

    Hello Wolfgang,

    Seems the changes to the OutlineNode captions are only applied if the tree is rendered initially.

    That’s right, because once a report is rendered, the changes made to it after that are made by comparison.

    Thanks for sharing your solution here.

    This will indeed help the other users as well.

    Best Regards,

    Esha

Need extra support?

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

Learn More

Forum Channels