How to create header in code

Hello,

I tried to create a report in code as follows:

// Create report
report = new TfrxReportClass();

// Create page
IfrxReportPage page = report.CreateReportObject(
report as IfrxComponent,
typeof(IfrxReportPage).GUID,
"DemoPage") as IfrxReportPage;

// Create title and his memo
IfrxBand title = report.CreateReportObject(
page as IfrxComponent,
typeof(IfrxReportTitle).GUID,
"Report Title") as IfrxBand;
IfrxMemoView title_memo = report.CreateReportObject(
title as IfrxComponent,
typeof(IfrxMemoView).GUID,
"Title memo") as IfrxMemoView;

// Create DataBand
IfrxDataBand band = report.CreateReportObject(
page as IfrxComponent,
typeof(IfrxDataBand).GUID,
"MasterData2") as IfrxDataBand;

IfrxMemoView memo1 = report.CreateReportObject(
band as IfrxComponent,
typeof(IfrxMemoView).GUID,
"MemoView1") as IfrxMemoView;

IfrxMemoView memo2 = report.CreateReportObject(
band as IfrxComponent,
typeof(IfrxMemoView).GUID,
"MemoView2") as IfrxMemoView;

IfrxMemoView memo3 = report.CreateReportObject(
band as IfrxComponent,
typeof(IfrxMemoView).GUID,
"MemoView3") as IfrxMemoView;



But how could I be able to create the header for memo1, memo2 and memo3?

Thanks.


Comments

  • edited 2:48AM
    Use this code:
                // Create GroupHeader
                IfrxGroupHeader header = report.CreateReportObject(page as TfrxDispatchableComponent,
                    typeof(IfrxGroupHeader).GUID, "GroupHeader1") as IfrxGroupHeader;
                header.Condition = "DemoQuery.\"Common_Name\"";
                (header as IfrxComponent).Height = 32;
                IfrxMemoView memo4 = report.CreateReportObject(header as TfrxDispatchableComponent,
                    typeof(IfrxMemoView).GUID, "Memo4") as IfrxMemoView;
                (memo4 as IfrxComponent).Left = 5;
                (memo4 as IfrxComponent).Top = 5;
                (memo4 as IfrxComponent).Width = 460;
                (memo4 as IfrxComponent).Height = 22;
                memo4.Color = 0xAAAAAA;
                memo4.Memo = "[DemoQuery.\"Common_Name\"]";
    

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.