Chart and multi culomn problem

edited 11:26AM in FastReport 4.0
Hello FastReport Experts

I want to print a list of measurements as a two culomn report, and show the same data as a chart on the same page. It works fine with a data band with 2 culoms, but the list is now sorted left to right, but I need down first. If the report page has 2 culoms, the list is ok, but I can not place a chart that is as wide as the page.

One solution is to place the chart in the report title, but it is not recommended to place data on non data bands. This works fine for a single page. But if I use this report as a subreport, the report title of the subreport is ignored!

Who has a tip for me!

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:26AM
    without knowing what youare working with exactly
    i can only suggest.
    you may want to fake column by using the engine object and some variables to control output positioning engine.curx cury props.
    see the chapter in the user manual on using the engine object.
  • edited 11:26AM
    Thanks for the reply, but this look like much work and calcualting.

    I will first try your answer from an other thread: engine.newcolumn.
  • gordkgordk St.Catherines On. Canada.
    edited 11:26AM
    Some times you have to work to get what you desire!
  • edited 11:26AM
    gordk wrote: »
    Some times you have to work to get what you desire!

    Now I have done some work and got the desired result:

    I use a report with 2 columns to get 'down first' columns.
    My chart for the details is located in the master band and is aligned to page width.

    I use 2 local variable and three events to start with the details line in second column after the chart.

    The Engine and the scripting is very powerful, but still easy to understand and use!

    Here is the code of the three events:
    void MasterData2OnAfterPrint(TfrxComponent Sender)
    {
        // store the current page and y position to calc custom column breaks                                                                                                                                                                                                             
        Set( "detailStartPage", <Page> );                                                                                                  
        Set( "detailStartY", Engine.CurY);
    }
    
    void DetailData1OnBeforePrint(TfrxComponent Sender)
    {
        // still on page with chart in master band?                                                                                                                    
        if ( <Page> == <detailStartPage> ) {
            // free space smaller than line of detail?                                                      
            if ( Engine.FreeSpace() <= DetailData1.Height ) {
                // switch from first to second column (on first page)?                                                                                                                                                 
                if ( Engine.CurColumn == 1 ) {
                    // add column break                                                         
                    Engine.NewColumn();
                    /* CurY is set by column header                                                                                                
                    // set start of new column below master band with chart                                                                                                                                          
                    Engine.CurY = <detailStartY>;
                    */                      
                }                                    
            }
        }
    }
    
    void Header1OnBeforePrint(TfrxComponent Sender)
    {
        // still on page with chart in master band?                                                                                                                    
        if ( <Page> == <detailStartPage> ) {
           // set start of new column below master band with chart                                                                                                                                          
           Engine.CurY = <detailStartY>;
        }  
    }
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.