Breaking a band over multiple pages.... horizontally
Hi,
Here's a tricky problem I've been having, and I'm hoping there's a good solution for it.
Basically I want to report a dataset (TTable), but I don't know yet how many columns it will have when designing the report. If there are more columns than will fit on one page, it needs to break into a new page. First across, then down. Initially I used the Cross-table as in the example. This does just that, but I found it limiting in other areas. I.e. you cannot access/alter individual columns, also I would like to do more with totals and averages. These are things you can do with normal bands.
So I then wrote some code to fill a Master Data Band manually with columns (C++).
This works, but columns outside the page width will simply not display. After playing around with the setting I found no way to make it break automatically.
I could add another band after the current one with the extra columns, but this would result in "down then across" and I'd like it the other way around.
Is there some code that I can write to get a similar breaking behaviour as in the Cross-table? Right now I have no idea how to do it. I looked into how the Cross-table accomplishes it and kind of understand, but do not know how to apply this to a Master Data Band.
If anyone can point me in the right direction... thanks!
Here's a tricky problem I've been having, and I'm hoping there's a good solution for it.
Basically I want to report a dataset (TTable), but I don't know yet how many columns it will have when designing the report. If there are more columns than will fit on one page, it needs to break into a new page. First across, then down. Initially I used the Cross-table as in the example. This does just that, but I found it limiting in other areas. I.e. you cannot access/alter individual columns, also I would like to do more with totals and averages. These are things you can do with normal bands.
So I then wrote some code to fill a Master Data Band manually with columns (C++).
  TfrxMasterData* bandData = dynamic_cast<TfrxMasterData*>( frxReport->FindObject( "TableData" ) );
  if( bandData )
  {
    bandData->Clear();
    TfrxMemoView* memoData;
    for( int i = 0; i < frxDBDataset->DataSet->Fields->Count; i++ )
    {
      memoData = new TfrxMemoView( bandData );
      memoData->CreateUniqueName();
      // connect to data
      memoData->DataSet = frxDBDataset;
      memoData->DataField = frxDBDataset->DataSet->Fields->Fields[i]->FieldName;
      memoData->SetBounds( i * fr1cm * 5.0, 0, fr1cm * 5.0, fr1cm * 0.5 );
      // adjust the text to the right object???s margin
      memoData->HAlign = haRight;
    }
  }
  frxReport->ShowReport( true );
This works, but columns outside the page width will simply not display. After playing around with the setting I found no way to make it break automatically.
I could add another band after the current one with the extra columns, but this would result in "down then across" and I'd like it the other way around.
Is there some code that I can write to get a similar breaking behaviour as in the Cross-table? Right now I have no idea how to do it. I looked into how the Cross-table accomplishes it and kind of understand, but do not know how to apply this to a Master Data Band.
If anyone can point me in the right direction... thanks!
Comments
Is it possible to address separate columns (memos) in a CrossView?
For instance, I would like the text in the second column to be left-aligned and the third one right-aligned.
Thanks!
btw across then down is a boolean property and can be set.
I am aware of the PrintAcrossThenDown property, but I was wondering if the same could be accomplished for regular Data bands
down across is accomplished by dividing design page into columns.
across down by setting the band's no of columns and column gap.
you can also control output of objects in the obp event by using the engineobject and setting the curx cury props.