diff --git a/.gitattributes b/.gitattributes index ca0c5494a4..81f2c79d64 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2198,6 +2198,14 @@ components/lazreport/images/package_images.bat svneol=native#text/x-msdos-progra components/lazreport/license-lazreport.txt svneol=native#text/plain components/lazreport/license-rus.txt svneol=native#text/plain components/lazreport/license.txt svneol=native#text/plain +components/lazreport/samples/Demo_CrossTab/demo_cross.lrf svneol=LF#text/xml eol=lf +components/lazreport/samples/Demo_CrossTab/project1.ico -text +components/lazreport/samples/Demo_CrossTab/project1.lpi svneol=native#text/plain +components/lazreport/samples/Demo_CrossTab/project1.lpr svneol=native#text/pascal +components/lazreport/samples/Demo_CrossTab/project1.lps svneol=native#text/xml +components/lazreport/samples/Demo_CrossTab/project1.res -text +components/lazreport/samples/Demo_CrossTab/unit1.lfm svneol=native#text/plain +components/lazreport/samples/Demo_CrossTab/unit1.pas svneol=native#text/pascal components/lazreport/samples/barcode/cb.lpi svneol=native#text/plain components/lazreport/samples/barcode/cb.lpr svneol=native#text/pascal components/lazreport/samples/barcode/cb.res -text @@ -2320,6 +2328,8 @@ components/lazreport/source/addons/DialogControls/resources/tlrlistbox.bmp -text components/lazreport/source/addons/DialogControls/resources/tlrmemo.bmp -text components/lazreport/source/addons/DialogControls/resources/tlrradiobutton.bmp -text components/lazreport/source/addons/DialogControls/resources/tlrradiogroup.bmp -text +components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.lfm svneol=native#text/plain +components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.pas svneol=native#text/pascal components/lazreport/source/addons/SqlDB/lr_ibconnection.pas svneol=native#text/plain components/lazreport/source/addons/SqlDB/lr_pqconnection.pas svneol=native#text/plain components/lazreport/source/addons/SqlDB/lr_sqldb.lpk svneol=native#text/plain @@ -2466,6 +2476,11 @@ components/lazreport/source/lr_checkbox.res -text components/lazreport/source/lr_class.pas svneol=native#text/pascal components/lazreport/source/lr_color.pas svneol=native#text/pascal components/lazreport/source/lr_const.pas svneol=native#text/pascal +components/lazreport/source/lr_crossarray.pas svneol=native#text/pascal +components/lazreport/source/lr_crosstab.pas svneol=native#text/pascal +components/lazreport/source/lr_crosstab.res -text +components/lazreport/source/lr_crosstabeditor.lfm svneol=native#text/plain +components/lazreport/source/lr_crosstabeditor.pas svneol=native#text/pascal components/lazreport/source/lr_ctrls.pas svneol=native#text/pascal components/lazreport/source/lr_dbcomponent.pas svneol=native#text/plain components/lazreport/source/lr_dbop.pas svneol=native#text/pascal diff --git a/components/lazreport/samples/Demo_CrossTab/demo_cross.lrf b/components/lazreport/samples/Demo_CrossTab/demo_cross.lrf new file mode 100644 index 0000000000..d930a5bd28 --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/demo_cross.lrf @@ -0,0 +1,1663 @@ + + + + + + <Subject Value=""/> + <KeyWords Value=""/> + <Comments Value=""/> + <ReportCreateDate Value="1899-12-30 00:00:00"/> + <ReportLastChange Value="2014-08-29 22:44:45"/> + <ReportVersionBuild Value=""/> + <ReportVersionMajor Value="1"/> + <ReportVersionMinor Value="0"/> + <ReportVersionRelease Value=""/> + <ReportAutor Value="Lagunov Aleksy"/> + <Script Value=""/> + <Pages> + <PrintToDefault Value="False"/> + <DoublePass Value="True"/> + <SelectedPrinter Value="Default printer"/> + <PageCount Value="1"/> + <Page1> + <Name Value="Page1"/> + <ClassName Value="TfrPageReport"/> + <Visible Value="True"/> + <Width Value="2970"/> + <Height Value="2100"/> + <Script Value=""/> + <PgSize Value="9"/> + <Margins> + <left Value="36"/> + <Top Value="36"/> + <Right Value="36"/> + <Bottom Value="36"/> + </Margins> + <Orientation Value="poLandscape"/> + <UseMargins Value="True"/> + <PrintToPrevPage Value="False"/> + <ColCount Value="0"/> + <ColGap Value="0"/> + <LayoutOrder Value="loColumns"/> + <Object1> + <Name Value="MasterData1"/> + <ClassName Value="TfrBandView"/> + <Visible Value="True"/> + <Typ Value="gtBand"/> + <StreamMode Value="0"/> + <Size> + <Left Value="0"/> + <Top Value="320"/> + <Width Value="1064"/> + <Height Value="100"/> + </Size> + <Flags Value="49"/> + <Data> + <Script Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <BandType Value="btMasterData"/> + <Condition Value=""/> + <DatasetStr Value="1"/> + </Object1> + <Object2> + <Name Value="Band1"/> + <ClassName Value="TfrBandView"/> + <Visible Value="True"/> + <Typ Value="gtBand"/> + <StreamMode Value="0"/> + <Size> + <Left Value="0"/> + <Top Value="468"/> + <Width Value="1064"/> + <Height Value="100"/> + </Size> + <Flags Value="51"/> + <Data> + <Script Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <BandType Value="btMasterData"/> + <Condition Value=""/> + <DatasetStr Value="1"/> + </Object2> + <Object3> + <Name Value="PageHeader1"/> + <ClassName Value="TfrBandView"/> + <Visible Value="True"/> + <Typ Value="gtBand"/> + <StreamMode Value="0"/> + <Size> + <Left Value="0"/> + <Top Value="40"/> + <Width Value="1064"/> + <Height Value="28"/> + </Size> + <Flags Value="48"/> + <Data> + <Script Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <BandType Value="btPageHeader"/> + <Condition Value=""/> + <DatasetStr Value=""/> + </Object3> + <Object4> + <Name Value="Band2"/> + <ClassName Value="TfrBandView"/> + <Visible Value="True"/> + <Typ Value="gtBand"/> + <StreamMode Value="0"/> + <Size> + <Left Value="0"/> + <Top Value="132"/> + <Width Value="1064"/> + <Height Value="100"/> + </Size> + <Flags Value="49"/> + <Data> + <Script Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <BandType Value="btMasterData"/> + <Condition Value=""/> + <DatasetStr Value="1"/> + </Object4> + <Object5> + <Name Value="Memo1"/> + <ClassName Value="TfrMemoView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="36"/> + <Top Value="324"/> + <Width Value="992"/> + <Height Value="16"/> + </Size> + <Flags Value="2"/> + <FillColor Value="clSilver"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value=""/> + <Restrictions Value=""/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Sales by year - Green and Orange style "/> + <Script Value=""/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="helvetica [urw]"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taLeftJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </Object5> + <Object6> + <Name Value="CrossView1"/> + <ClassName Value="TlrCrossView"/> + <Visible Value="True"/> + <Typ Value="gtAddIn"/> + <StreamMode Value="0"/> + <Size> + <Left Value="36"/> + <Top Value="340"/> + <Width Value="680"/> + <Height Value="74"/> + </Size> + <Flags Value="1"/> + <FillColor Value="clNone"/> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <ShowColumnHeader Value="True"/> + <ShowColumnTotal Value="True"/> + <ShowCorner Value="True"/> + <ShowRowHeader Value="True"/> + <ShowRowTotal Value="True"/> + <ShowTitle Value="True"/> + <ShowGrandTotal Value="True"/> + <DataSetName Value="SQLQuery1"/> + <ShowTotalCHCell Value="True"/> + <ShowTotalRHCell Value="True"/> + <CellFields Value="TOTAL_VALUE|SUM "/> + <ColumnFields Value="ORDER_YEAR "/> + <RowFields Value="CUSTOMER "/> + <DataCell> + <Name Value="CrossView1_Data"/> + <ClassName Value="TlrCrossDesignDataView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="372"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$009BEBFF"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Data "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + <AlternativeColor Value="clNone"/> + </DataCell> + <RowTitleCell> + <Name Value="CrossView1_RowTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="372"/> + <Width Value="176"/> + <Height Value="18"/> + </Size> + <Flags Value="2"/> + <FillColor Value="$0000A47B"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Row title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taLeftJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTitleCell> + <RowTotalCell> + <Name Value="CrossView1_RowTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="372"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$009BEBFF"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Row total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTotalCell> + <ColTitleCell> + <Name Value="CrossView1_ColTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="350"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$0000A47B"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Col title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTitleCell> + <ColTotalCell> + <Name Value="CrossView1_ColTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="394"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$009BEBFF"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Col total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTotalCell> + <GrandTotalCell> + <Name Value="CrossView1_GrandTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="394"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$009BEBFF"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Grand total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </GrandTotalCell> + <TotalCHCell> + <Name Value="CrossView1_TotalCHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="350"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$0000A47B"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalCHCell> + <TotalRHCell> + <Name Value="CrossView1_TotalRHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="350"/> + <Width Value="176"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$0000A47B"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Seller "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalRHCell> + </Object6> + <Object7> + <Name Value="Memo2"/> + <ClassName Value="TfrMemoView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="40"/> + <Top Value="472"/> + <Width Value="988"/> + <Height Value="16"/> + </Size> + <Flags Value="2"/> + <FillColor Value="clSilver"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value=""/> + <Restrictions Value=""/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Sales by customer - Report use alternative color "/> + <Script Value=""/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="helvetica [urw]"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taLeftJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </Object7> + <Object8> + <Name Value="CrossView2"/> + <ClassName Value="TlrCrossView"/> + <Visible Value="True"/> + <Typ Value="gtAddIn"/> + <StreamMode Value="0"/> + <Size> + <Left Value="36"/> + <Top Value="488"/> + <Width Value="680"/> + <Height Value="74"/> + </Size> + <Flags Value="1"/> + <FillColor Value="clNone"/> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <ShowColumnHeader Value="True"/> + <ShowColumnTotal Value="True"/> + <ShowCorner Value="True"/> + <ShowRowHeader Value="True"/> + <ShowRowTotal Value="True"/> + <ShowTitle Value="True"/> + <ShowGrandTotal Value="True"/> + <DataSetName Value="SQLQuery1"/> + <ShowTotalCHCell Value="True"/> + <ShowTotalRHCell Value="True"/> + <CellFields Value="TOTAL_VALUE|SUM "/> + <ColumnFields Value="ORDER_YEAR "/> + <RowFields Value="CUSTOMER "/> + <DataCell> + <Name Value="CrossView2_Data"/> + <ClassName Value="TlrCrossDesignDataView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="222"/> + <Top Value="520"/> + <Width Value="164"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$00E6E6E6"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbRight"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Data "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + <AlternativeColor Value="clMoneyGreen"/> + </DataCell> + <RowTitleCell> + <Name Value="CrossView2_RowTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="520"/> + <Width Value="172"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$004A4A00"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Row title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clWhite"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTitleCell> + <RowTotalCell> + <Name Value="CrossView2_RowTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="390"/> + <Top Value="520"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$008A8A19"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Row total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTotalCell> + <ColTitleCell> + <Name Value="CrossView2_ColTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="222"/> + <Top Value="498"/> + <Width Value="164"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$004A4A00"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Col title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clWhite"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTitleCell> + <ColTotalCell> + <Name Value="CrossView2_ColTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="222"/> + <Top Value="542"/> + <Width Value="164"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$008A8A19"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Col total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTotalCell> + <GrandTotalCell> + <Name Value="CrossView2_GrandTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="390"/> + <Top Value="542"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$008A8A19"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Grand total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </GrandTotalCell> + <TotalCHCell> + <Name Value="CrossView2_TotalCHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="390"/> + <Top Value="498"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$004A4A00"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clWhite"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalCHCell> + <TotalRHCell> + <Name Value="CrossView2_TotalRHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="498"/> + <Width Value="172"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="$004A4A00"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Year "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clWhite"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalRHCell> + </Object8> + <Object9> + <Name Value="Memo3"/> + <ClassName Value="TfrMemoView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="780"/> + <Top Value="44"/> + <Width Value="244"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbBottom"/> + <Restrictions Value=""/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="[TOTALPAGES] - [PAGE#] "/> + <Script Value=""/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="helvetica [urw]"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold,fsItalic"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </Object9> + <Object10> + <Name Value="Memo4"/> + <ClassName Value="TfrMemoView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="36"/> + <Top Value="136"/> + <Width Value="992"/> + <Height Value="16"/> + </Size> + <Flags Value="2"/> + <FillColor Value="clSilver"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value=""/> + <Restrictions Value=""/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Sales by year - simple style "/> + <Script Value=""/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="helvetica [urw]"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taLeftJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </Object10> + <Object11> + <Name Value="CrossView3"/> + <ClassName Value="TlrCrossView"/> + <Visible Value="True"/> + <Typ Value="gtAddIn"/> + <StreamMode Value="0"/> + <Size> + <Left Value="36"/> + <Top Value="152"/> + <Width Value="680"/> + <Height Value="74"/> + </Size> + <Flags Value="1"/> + <FillColor Value="clNone"/> + <Tag Value=""/> + <FURLInfo Value=""/> + <Frames> + <Restrictions Value=""/> + </Frames> + <ShowColumnHeader Value="True"/> + <ShowColumnTotal Value="True"/> + <ShowCorner Value="True"/> + <ShowRowHeader Value="True"/> + <ShowRowTotal Value="True"/> + <ShowTitle Value="True"/> + <ShowGrandTotal Value="True"/> + <DataSetName Value="SQLQuery1"/> + <ShowTotalCHCell Value="True"/> + <ShowTotalRHCell Value="True"/> + <CellFields Value="TOTAL_VALUE|SUM "/> + <ColumnFields Value="ORDER_YEAR "/> + <RowFields Value="CUSTOMER "/> + <DataCell> + <Name Value="CrossView3_Data"/> + <ClassName Value="TlrCrossDesignDataView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="184"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Data "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + <AlternativeColor Value="clNone"/> + </DataCell> + <RowTitleCell> + <Name Value="CrossView3_RowTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="184"/> + <Width Value="176"/> + <Height Value="18"/> + </Size> + <Flags Value="2"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Row title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taLeftJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTitleCell> + <RowTotalCell> + <Name Value="CrossView3_RowTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="184"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Row total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </RowTotalCell> + <ColTitleCell> + <Name Value="CrossView3_ColTitleCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="162"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Col title "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTitleCell> + <ColTotalCell> + <Name Value="CrossView3_ColTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="226"/> + <Top Value="206"/> + <Width Value="104"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Col total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </ColTotalCell> + <GrandTotalCell> + <Name Value="CrossView3_GrandTotalCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="206"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="16843308"/> + <FormatStr Value=""/> + <Memo Value="Grand total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value=""/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taRightJustify"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </GrandTotalCell> + <TotalCHCell> + <Name Value="CrossView3_TotalCHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="334"/> + <Top Value="162"/> + <Width Value="108"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Total "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalCHCell> + <TotalRHCell> + <Name Value="CrossView3_TotalRHCell"/> + <ClassName Value="TlrCrossDesignView"/> + <Visible Value="True"/> + <Typ Value="gtMemo"/> + <StreamMode Value="0"/> + <Size> + <Left Value="46"/> + <Top Value="162"/> + <Width Value="176"/> + <Height Value="18"/> + </Size> + <Flags Value="3"/> + <FillColor Value="clNone"/> + <Frames> + <FrameColor Value="clBlack"/> + <FrameStyle Value="frsSolid"/> + <FrameWidth Value="1"/> + <FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/> + </Frames> + <Data> + <Format Value="556"/> + <FormatStr Value=""/> + <Memo Value="Seller "/> + <OnClick Value=""/> + <OnMouseEnter Value=""/> + <OnMouseLeave Value=""/> + <DetailReport Value=""/> + </Data> + <Tag Value=""/> + <FURLInfo Value=""/> + <Font> + <Name Value="Arial"/> + <Size Value="10"/> + <Color Value="clBlack"/> + <Charset Value="0"/> + <Style Value="fsBold"/> + </Font> + <Highlight> + <FontStyle Value="2"/> + <FontColor Value="clBlack"/> + <FillColor Value="clWhite"/> + <HighlightStr Value=""/> + </Highlight> + <Alignment Value="taCenter"/> + <Layout Value="tlTop"/> + <Angle Value="0"/> + <Justify Value="False"/> + <Cursor Value="0"/> + </TotalRHCell> + </Object11> + <ObjectCount Value="11"/> + </Page1> + <FVal> + <Count Value="0"/> + </FVal> + <ParentVars Value=""/> + </Pages> + <DetailReports> + <Count Value="0"/> + </DetailReports> + </LazReport> +</CONFIG> diff --git a/components/lazreport/samples/Demo_CrossTab/project1.ico b/components/lazreport/samples/Demo_CrossTab/project1.ico new file mode 100644 index 0000000000..0341321b5d Binary files /dev/null and b/components/lazreport/samples/Demo_CrossTab/project1.ico differ diff --git a/components/lazreport/samples/Demo_CrossTab/project1.lpi b/components/lazreport/samples/Demo_CrossTab/project1.lpi new file mode 100644 index 0000000000..2655cf60ff --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/project1.lpi @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <General> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="project1"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <Icon Value="0"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="3"> + <Item1> + <PackageName Value="lazreport"/> + </Item1> + <Item2> + <PackageName Value="SQLDBLaz"/> + </Item2> + <Item3> + <PackageName Value="LCL"/> + </Item3> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="project1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="5"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + <Item4> + <Name Value="EPropertyError"/> + </Item4> + <Item5> + <Name Value="EStringListError"/> + </Item5> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/lazreport/samples/Demo_CrossTab/project1.lpr b/components/lazreport/samples/Demo_CrossTab/project1.lpr new file mode 100644 index 0000000000..ced6d82558 --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/project1.lpr @@ -0,0 +1,21 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, Unit1 + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource := True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/lazreport/samples/Demo_CrossTab/project1.lps b/components/lazreport/samples/Demo_CrossTab/project1.lps new file mode 100644 index 0000000000..13c20f9afd --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/project1.lps @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <Version Value="9"/> + <BuildModes Active="Default"/> + <Units Count="17"> + <Unit0> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos Y="20"/> + <UsageCount Value="35"/> + </Unit0> + <Unit1> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + <CursorPos X="38" Y="21"/> + <UsageCount Value="35"/> + <Loaded Value="True"/> + <LoadedDesigner Value="True"/> + </Unit1> + <Unit2> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_class.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="104"/> + <CursorPos X="6" Y="120"/> + <UsageCount Value="14"/> + </Unit2> + <Unit3> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_desgn.pas"/> + <ComponentName Value="frDesignerForm"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <EditorIndex Value="-1"/> + <TopLine Value="5627"/> + <CursorPos Y="5649"/> + <UsageCount Value="9"/> + </Unit3> + <Unit4> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_crosstab.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="152"/> + <CursorPos X="15" Y="168"/> + <UsageCount Value="16"/> + <Bookmarks Count="1"> + <Item0 Y="393" ID="1"/> + </Bookmarks> + </Unit4> + <Unit5> + <Filename Value="../../../install/source/fpcsrc/rtl/objpas/classes/classesh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="243"/> + <CursorPos X="3" Y="218"/> + <UsageCount Value="10"/> + </Unit5> + <Unit6> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_barc.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="471"/> + <CursorPos X="35" Y="490"/> + <UsageCount Value="9"/> + </Unit6> + <Unit7> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_rrect.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="566"/> + <CursorPos X="56" Y="568"/> + <UsageCount Value="9"/> + </Unit7> + <Unit8> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_shape.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="25"/> + <CursorPos X="15" Y="46"/> + <UsageCount Value="9"/> + </Unit8> + <Unit9> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_chbox.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="145"/> + <CursorPos X="43" Y="168"/> + <UsageCount Value="9"/> + </Unit9> + <Unit10> + <Filename Value="C:/lazarus/components/lazreport/source/lr_class.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="4341"/> + <CursorPos Y="4355"/> + <UsageCount Value="9"/> + </Unit10> + <Unit11> + <Filename Value="C:/lazarus/components/lazutils/lazutf8.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="3198"/> + <CursorPos Y="3212"/> + <UsageCount Value="9"/> + </Unit11> + <Unit12> + <Filename Value="C:/lazarus/components/lazreport/source/lr_crosstab.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="951"/> + <CursorPos Y="965"/> + <UsageCount Value="9"/> + </Unit12> + <Unit13> + <Filename Value="C:/lazarus/components/lazreport/source/lr_desgn.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="5512"/> + <CursorPos Y="5526"/> + <UsageCount Value="10"/> + </Unit13> + <Unit14> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_crosstabeditor.pas"/> + <ComponentName Value="lrCrossTabEditorForm"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <EditorIndex Value="-1"/> + <TopLine Value="171"/> + <CursorPos X="25" Y="184"/> + <UsageCount Value="16"/> + <LoadedDesigner Value="True"/> + </Unit14> + <Unit15> + <Filename Value="/usr/local/share/lazarus/components/lazreport/source/lr_crossarray.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="187"/> + <CursorPos X="3" Y="193"/> + <UsageCount Value="10"/> + </Unit15> + <Unit16> + <Filename Value="../../source/lr_class.pas"/> + <UnitName Value="LR_Class"/> + <IsVisibleTab Value="True"/> + <EditorIndex Value="1"/> + <CursorPos X="41" Y="12"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit16> + </Units> + <JumpHistory Count="2" HistoryIndex="1"> + <Position1> + <Filename Value="unit1.pas"/> + <Caret Line="16" Column="26" TopLine="2"/> + </Position1> + <Position2> + <Filename Value="unit1.pas"/> + <Caret Line="21" Column="38"/> + </Position2> + </JumpHistory> + </ProjectSession> + <Debugging> + <Watches Count="4"> + <Item1> + <Expression Value="SR"/> + </Item1> + <Item2> + <Expression Value="SC"/> + </Item2> + <Item3> + <Expression Value="V"/> + </Item3> + <Item4> + <Expression Value="S"/> + </Item4> + </Watches> + </Debugging> +</CONFIG> diff --git a/components/lazreport/samples/Demo_CrossTab/project1.res b/components/lazreport/samples/Demo_CrossTab/project1.res new file mode 100644 index 0000000000..7c6cf3e4be Binary files /dev/null and b/components/lazreport/samples/Demo_CrossTab/project1.res differ diff --git a/components/lazreport/samples/Demo_CrossTab/unit1.lfm b/components/lazreport/samples/Demo_CrossTab/unit1.lfm new file mode 100644 index 0000000000..3c7df0cfc4 --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/unit1.lfm @@ -0,0 +1,125 @@ +object Form1: TForm1 + Left = 667 + Height = 368 + Top = 217 + Width = 320 + Caption = 'Croo-tab report demo' + ClientHeight = 368 + ClientWidth = 320 + OnCreate = FormCreate + LCLVersion = '1.3' + object Button1: TButton + Left = 112 + Height = 25 + Top = 56 + Width = 92 + AutoSize = True + Caption = 'Design report' + OnClick = Button1Click + TabOrder = 0 + end + object Button2: TButton + Left = 112 + Height = 25 + Top = 120 + Width = 84 + AutoSize = True + Caption = 'Show report' + OnClick = Button2Click + TabOrder = 1 + end + object Label1: TLabel + Left = 16 + Height = 15 + Top = 8 + Width = 130 + Caption = 'Croo-tab report demo' + ParentColor = False + end + object Label2: TLabel + Left = 16 + Height = 15 + Top = 24 + Width = 245 + Caption = 'Report used standart demo from firebird' + ParentColor = False + end + object SQLQuery1: TSQLQuery + FieldDefs = < + item + Name = 'CUST_NO' + DataType = ftInteger + Precision = -1 + Size = 0 + end + item + Name = 'CUSTOMER' + DataType = ftString + Precision = -1 + Size = 25 + end + item + Name = 'ORDER_YEAR' + DataType = ftSmallint + Precision = -1 + Size = 0 + end + item + Name = 'TOTAL_VALUE' + DataType = ftBCD + Precision = 9 + Size = 2 + end> + Database = IBConnection1 + Transaction = SQLTransaction1 + SQL.Strings = ( + 'select' + ' CUSTOMER.CUST_NO,' + ' CUSTOMER.CUSTOMER,' + ' EXTRACT(year from sales.order_date) as order_year,' + ' sales.total_value' + 'from' + ' SALES' + ' inner join CUSTOMER on (CUSTOMER.CUST_NO = SALES.CUST_NO)' + '' + ) + Params = <> + left = 24 + top = 288 + end + object SQLTransaction1: TSQLTransaction + Active = False + Database = IBConnection1 + left = 56 + top = 248 + end + object IBConnection1: TIBConnection + Connected = True + LoginPrompt = False + DatabaseName = 'employee' + KeepConnection = False + Password = 'masterkey' + Transaction = SQLTransaction1 + UserName = 'sysdba' + CharSet = 'utf8' + HostName = '127.0.0.1' + left = 24 + top = 248 + end + object frReport1: TfrReport + InitialZoom = pzDefault + Options = [] + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbHelp, pbExit] + DataType = dtDataSet + left = 66 + top = 183 + end + object frDesigner1: TfrDesigner + left = 104 + top = 183 + end + object lrCrossObject1: TlrCrossObject + left = 144 + top = 184 + end +end diff --git a/components/lazreport/samples/Demo_CrossTab/unit1.pas b/components/lazreport/samples/Demo_CrossTab/unit1.pas new file mode 100644 index 0000000000..55460c4038 --- /dev/null +++ b/components/lazreport/samples/Demo_CrossTab/unit1.pas @@ -0,0 +1,74 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LR_Class, LR_Desgn, lr_CrossTab, Forms, Controls, + Graphics, Dialogs, StdCtrls, sqldb, IBConnection; + +type + + { TForm1 } + + TForm1 = class(TForm) + Button1: TButton; + Button2: TButton; + frDesigner1: TfrDesigner; + frReport1: TfrReport; + IBConnection1: TIBConnection; + Label1: TLabel; + Label2: TLabel; + lrCrossObject1: TlrCrossObject; + SQLQuery1: TSQLQuery; + SQLTransaction1: TSQLTransaction; + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + function RepName:string; + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.Button1Click(Sender: TObject); +begin + if FileExistsUTF8(RepName) then + frReport1.LoadFromFile(RepName) + else + frReport1.FileName:=RepName; + frReport1.DesignReport; +end; + +procedure TForm1.Button2Click(Sender: TObject); +begin + if FileExistsUTF8(RepName) then + begin + frReport1.LoadFromFile(RepName); + frReport1.ShowReport; + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + IBConnection1.Connected:=true; + SQLQuery1.Open; +end; + +function TForm1.RepName: string; +begin + Result:=AppendPathDelim(ExtractFileDir(ParamStrUTF8(0)))+'demo_cross.lrf'; +end; + +end. + diff --git a/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas b/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas index ac23564388..ccdfe31fa5 100644 --- a/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas +++ b/components/lazreport/source/addons/DialogControls/lrdialogcontrols.pas @@ -1,6 +1,6 @@ { LazReport dialogs control - Copyright (C) 2012-2013 alexs alexs75.at.hotbox.ru + Copyright (C) 2012-2014 alexs alexs75.at.yandex.ru This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by @@ -75,7 +75,7 @@ type procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure UpdateControlPosition; override; procedure AttachToParent; override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; property Control: TControl read FControl write FControl; property AutoSize: Boolean read GetAutoSize write SetAutoSize; @@ -1433,18 +1433,18 @@ begin FControl.Parent := OwnerForm; end; -procedure TlrVisualControl.Assign(From: TfrView); +procedure TlrVisualControl.Assign(Source: TPersistent); begin - inherited Assign(From); - if From is TlrVisualControl then + inherited Assign(Source); + if Source is TlrVisualControl then begin - AutoSize:=TlrVisualControl(From).AutoSize; - Color:=TlrVisualControl(From).Color; - Caption:=TlrVisualControl(From).Caption; - Text:=TlrVisualControl(From).Text; - Font:=TlrVisualControl(From).Font; - Hint:=TlrVisualControl(From).Hint; - OnClick:=TlrVisualControl(From).OnClick; + AutoSize:=TlrVisualControl(Source).AutoSize; + Color:=TlrVisualControl(Source).Color; + Caption:=TlrVisualControl(Source).Caption; + Text:=TlrVisualControl(Source).Text; + Font:=TlrVisualControl(Source).Font; + Hint:=TlrVisualControl(Source).Hint; + OnClick:=TlrVisualControl(Source).OnClick; end; end; diff --git a/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.lfm b/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.lfm new file mode 100644 index 0000000000..ff3c59583d --- /dev/null +++ b/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.lfm @@ -0,0 +1,151 @@ +object lr_EditSQLDBParamsForm: Tlr_EditSQLDBParamsForm + Left = 592 + Height = 358 + Top = 442 + Width = 622 + Caption = 'Edit query param list' + ClientHeight = 358 + ClientWidth = 622 + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + Position = poScreenCenter + LCLVersion = '1.3' + object ButtonPanel1: TButtonPanel + Left = 6 + Height = 41 + Top = 311 + Width = 610 + OKButton.Name = 'OKButton' + OKButton.DefaultCaption = True + HelpButton.Name = 'HelpButton' + HelpButton.DefaultCaption = True + CloseButton.Name = 'CloseButton' + CloseButton.DefaultCaption = True + CancelButton.Name = 'CancelButton' + CancelButton.DefaultCaption = True + TabOrder = 0 + ShowButtons = [pbOK, pbCancel, pbHelp] + end + object GroupBox1: TGroupBox + Left = 0 + Height = 305 + Top = 0 + Width = 239 + Align = alLeft + Caption = 'Param values' + ClientHeight = 282 + ClientWidth = 235 + TabOrder = 1 + object ListBox1: TListBox + Left = 0 + Height = 282 + Top = 0 + Width = 235 + Align = alClient + ItemHeight = 0 + OnClick = ListBox1Click + ScrollWidth = 233 + TabOrder = 0 + TopIndex = -1 + end + end + object GroupBox2: TGroupBox + Left = 244 + Height = 305 + Top = 0 + Width = 378 + Align = alClient + Caption = 'Param value' + ClientHeight = 282 + ClientWidth = 374 + TabOrder = 2 + object Label1: TLabel + AnchorSideLeft.Control = GroupBox2 + AnchorSideTop.Control = GroupBox2 + Left = 6 + Height = 21 + Top = 6 + Width = 74 + BorderSpacing.Around = 6 + Caption = 'Param type' + ParentColor = False + end + object ComboBox1: TComboBox + AnchorSideLeft.Control = Label1 + AnchorSideTop.Control = Label1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GroupBox2 + AnchorSideRight.Side = asrBottom + Left = 12 + Height = 29 + Top = 33 + Width = 356 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + ItemHeight = 0 + ItemIndex = 0 + Items.Strings = ( + 'String' + 'Integer' + 'Float' + 'DateTime' + ) + Style = csDropDownList + TabOrder = 0 + Text = 'String' + end + object Label2: TLabel + AnchorSideLeft.Control = GroupBox2 + AnchorSideTop.Control = ComboBox1 + AnchorSideTop.Side = asrBottom + Left = 6 + Height = 21 + Top = 68 + Width = 78 + BorderSpacing.Around = 6 + Caption = 'Param value' + ParentColor = False + end + object Memo1: TMemo + AnchorSideLeft.Control = Label2 + AnchorSideTop.Control = Label2 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GroupBox2 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = BitBtn1 + Left = 12 + Height = 142 + Top = 95 + Width = 356 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Lines.Strings = ( + 'Memo1' + ) + TabOrder = 1 + end + object BitBtn1: TBitBtn + AnchorSideRight.Control = GroupBox2 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GroupBox2 + AnchorSideBottom.Side = asrBottom + Left = 247 + Height = 33 + Top = 243 + Width = 121 + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Select expresion' + OnClick = BitBtn1Click + TabOrder = 2 + end + end + object Splitter1: TSplitter + Left = 239 + Height = 305 + Top = 0 + Width = 5 + end +end diff --git a/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.pas b/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.pas new file mode 100644 index 0000000000..236f809ebf --- /dev/null +++ b/components/lazreport/source/addons/SqlDB/lr_editsqldbparamsunit.pas @@ -0,0 +1,150 @@ +unit lr_EditSQLDBParamsUnit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel, + StdCtrls, Buttons, ExtCtrls, lr_SQLQuery, DB; + +type + + { Tlr_EditSQLDBParamsForm } + + Tlr_EditSQLDBParamsForm = class(TForm) + BitBtn1: TBitBtn; + ButtonPanel1: TButtonPanel; + ComboBox1: TComboBox; + GroupBox1: TGroupBox; + GroupBox2: TGroupBox; + Label1: TLabel; + Label2: TLabel; + ListBox1: TListBox; + Memo1: TMemo; + Splitter1: TSplitter; + procedure BitBtn1Click(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure ListBox1Click(Sender: TObject); + private + FParams:TQueryParamList; + EditItem:integer; + public + procedure LoadParamList(AParams:TQueryParamList); + procedure SaveParamList(AParams:TQueryParamList); + end; + +implementation +uses lr_expres; + +{$R *.lfm} + +{ Tlr_EditSQLDBParamsForm } + +procedure Tlr_EditSQLDBParamsForm.ListBox1Click(Sender: TObject); +var + P:TQueryParam; +begin + if (ListBox1.Items.Count>0) and (ListBox1.ItemIndex > -1) and (ListBox1.ItemIndex<ListBox1.Items.Count) then + begin + if EditItem>-1 then + begin + P:=TQueryParam(FParams[EditItem]); + case ComboBox1.ItemIndex of + 0:P.ParamType:=ftString; //String + 1:P.ParamType:=ftInteger; //Integer + 2:P.ParamType:=ftFloat; //Float + 3:P.ParamType:=ftDateTime; //DateTime + else + P.ParamType:=ftUnknown; + end; + P.ParamValue:=Memo1.Text; + end; + EditItem:=ListBox1.ItemIndex; + P:=TQueryParam(FParams[EditItem]); + case P.ParamType of + ftString:ComboBox1.ItemIndex:=0; //String + ftInteger:ComboBox1.ItemIndex:=1; //Integer + ftFloat:ComboBox1.ItemIndex:=2; //Float + ftDateTime:ComboBox1.ItemIndex:=3; //DateTime + else + ComboBox1.ItemIndex:=-1; + end; + Memo1.Text:=P.ParamValue; + end; +end; + +procedure Tlr_EditSQLDBParamsForm.BitBtn1Click(Sender: TObject); +var + EF:TlrExpresionEditorForm; +begin + EF:=TlrExpresionEditorForm.Create(Application); + if EF.ShowModal = mrOk then + Memo1.Text:=EF.ResultExpresion; + EF.Free; +end; + +procedure Tlr_EditSQLDBParamsForm.FormCloseQuery(Sender: TObject; + var CanClose: boolean); +begin + if ModalResult = mrOk then + ListBox1Click(nil); +end; + +procedure Tlr_EditSQLDBParamsForm.FormCreate(Sender: TObject); +begin +{ Caption:=slrEditParamsForm_Caption; + GroupBox1.Caption:=slrEditParamsForm_ParamsList; + GroupBox2.Caption:=slrEditParamsForm_ParamValue; + Label1.Caption:=slrEditParamsForm_ParamType; + Label2.Caption:=slrEditParamsForm_ParamValue; + BitBtn1.Caption:=slrEditParamsForm_SelectExpresion;} + // + FParams:=TQueryParamList.Create; +end; + +procedure Tlr_EditSQLDBParamsForm.FormDestroy(Sender: TObject); +begin + FreeAndNil(FParams); +end; + +procedure Tlr_EditSQLDBParamsForm.LoadParamList(AParams: TQueryParamList); +var + i:integer; + P:TQueryParam; +begin + FParams.Clear; + ListBox1.Items.Clear; + for i:=0 to AParams.Count - 1 do + begin + P:=TQueryParam(AParams[i]); + FParams.Add(P.ParamType, P.ParamName, P.ParamValue); + ListBox1.Items.Add(P.ParamName); + end; + EditItem:=-1; + if ListBox1.Items.Count > 0 then + begin + ListBox1.ItemIndex:=0; + ListBox1Click(nil); + end; +end; + +procedure Tlr_EditSQLDBParamsForm.SaveParamList(AParams: TQueryParamList); +var + i:integer; + P, P1:TQueryParam; +begin + for i:=0 to FParams.Count - 1 do + begin + P:=TQueryParam(FParams[i]); + P1:=TQueryParam(AParams[i]); + P1.ParamType:=P.ParamType; + P1.ParamName:=P.ParamName; + P1.ParamValue:=P.ParamValue; + end; +end; + +end. + diff --git a/components/lazreport/source/addons/SqlDB/lr_sqldb.lpk b/components/lazreport/source/addons/SqlDB/lr_sqldb.lpk index e5af48d9b1..016672b32c 100644 --- a/components/lazreport/source/addons/SqlDB/lr_sqldb.lpk +++ b/components/lazreport/source/addons/SqlDB/lr_sqldb.lpk @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <CONFIG> <Package Version="4"> <Name Value="LR_SqlDB"/> @@ -8,12 +8,6 @@ <SearchPaths> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <Other> - <CompilerMessages> - <MsgFileName Value=""/> - </CompilerMessages> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> <Description Value="Add support to FCL SQLdb components for designing LazReport dialogs at runtime with lr_dialogdesign package"/> <License Value="modified LGPL-2 @@ -35,8 +29,8 @@ <UnitName Value="LR_IBConnection"/> </Item3> <Item4> - <Filename Value="lrsqldb_img.inc"/> - <Type Value="Include"/> + <Filename Value="lr_editsqldbparamsunit.pas"/> + <UnitName Value="lr_editsqldbparamsunit"/> </Item4> </Files> <Type Value="RunAndDesignTime"/> diff --git a/components/lazreport/source/addons/SqlDB/lr_sqldb.pas b/components/lazreport/source/addons/SqlDB/lr_sqldb.pas index fa3154b62d..85cc9d82f2 100644 --- a/components/lazreport/source/addons/SqlDB/lr_sqldb.pas +++ b/components/lazreport/source/addons/SqlDB/lr_sqldb.pas @@ -7,7 +7,8 @@ unit LR_SqlDB; interface uses - LR_PQConnection, lr_SQLQuery, LR_IBConnection, LazarusPackageIntf; + LR_PQConnection, lr_SQLQuery, LR_IBConnection, lr_EditSQLDBParamsUnit, + LazarusPackageIntf; implementation diff --git a/components/lazreport/source/addons/SqlDB/lr_sqlquery.pas b/components/lazreport/source/addons/SqlDB/lr_sqlquery.pas index 7c0efac2ee..f6827693ce 100644 --- a/components/lazreport/source/addons/SqlDB/lr_sqlquery.pas +++ b/components/lazreport/source/addons/SqlDB/lr_sqlquery.pas @@ -5,18 +5,33 @@ unit lr_SQLQuery; interface uses - Classes, SysUtils, Graphics, LR_Class, LR_DBComponent, sqldb, DB; + Classes, SysUtils, Graphics, LR_Class, LR_DBComponent, sqldb, DB, contnrs; type + TQueryParam = class + ParamType:TFieldType; + ParamName:string; + ParamValue:string; + end; + + { TQueryParamList } + + TQueryParamList = class(TFPObjectList) + function ParamByName(AParamName:string):TQueryParam; + function Add(AParamType:TFieldType; const AParamName, AParamValue:string):TQueryParam; + end; + { TLRSQLQuery } TLRSQLQuery = class(TLRDataSetControl) private FDatabase: string; + FParams: TQueryParamList; procedure SetDatabase(AValue: string); procedure DoMakeParams; procedure DoEditParams; + procedure SQLQueryBeforeOpen(ADataSet: TDataSet); protected function GetSQL: string; procedure SetSQL(AValue:string); @@ -24,12 +39,14 @@ type procedure AfterLoad;override; public constructor Create(AOwnerPage:TfrPage); override; + destructor Destroy; override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; published property SQL:string read GetSQL write SetSQL; property Database:string read FDatabase write SetDatabase; + property Params:TQueryParamList read FParams write FParams; end; { TLRSQLConnection } @@ -77,7 +94,8 @@ implementation {$R lrsqldb_img.res} -uses LR_Utils, DBPropEdits, PropEdits, Controls; +uses LR_Utils, DBPropEdits, PropEdits, Controls, Forms, + lr_EditSQLDBParamsUnit; var lrBMP_SQLQuery:TBitmap = nil; @@ -92,6 +110,34 @@ begin end; end; +{ TQueryParamList } + +function TQueryParamList.ParamByName(AParamName: string): TQueryParam; +var + i:integer; +begin + Result:=nil; + AParamName:=UpperCase(AParamName); + for i:=0 to Count - 1 do + begin + if UpperCase(TQueryParam(Items[i]).ParamName) = AParamName then + begin + Result:=TQueryParam(Items[i]); + exit; + end; + end; +end; + +function TQueryParamList.Add(AParamType: TFieldType; const AParamName, + AParamValue: string): TQueryParam; +begin + Result:=TQueryParam.Create; + inherited Add(Result); + Result.ParamType:=AParamType; + Result.ParamName:=AParamName; + Result.ParamValue:=AParamValue; +end; + { TLRSQLConnection } function TLRSQLConnection.GetCharSet: string; @@ -235,13 +281,89 @@ begin end; procedure TLRSQLQuery.DoMakeParams; +var + Q:TSQLQuery; + i:integer; begin - { TODO : Необходимо реализовать параметры по аналогии с ZEOS } + Q:=TSQLQuery(DataSet); + if Q.Params.Count > 0 then + begin + //Add new params... + for i:=0 to Q.Params.Count-1 do + begin + if not Assigned(FParams.ParamByName(Q.Params[i].Name)) then + FParams.Add(ftUnknown, Q.Params[i].Name, ''); + end; + + //Delete not exists params + for i:=FParams.Count-1 downto 0 do + begin + if not Assigned(Q.Params.FindParam(TQueryParam(FParams[i]).ParamName)) then + FParams.Delete(i); + end; + end + else + FParams.Clear; end; procedure TLRSQLQuery.DoEditParams; +var + lrEditParamsForm: Tlr_EditSQLDBParamsForm; begin - { TODO : Необходимо реализовать параметры по аналогии с ZEOS } + lrEditParamsForm:=Tlr_EditSQLDBParamsForm.Create(Application); + lrEditParamsForm.LoadParamList(FParams); + if lrEditParamsForm.ShowModal = mrOk then + begin + lrEditParamsForm.SaveParamList(FParams); + if Assigned(frDesigner) then + frDesigner.Modified:=true; + end; + lrEditParamsForm.Free; +end; + +procedure TLRSQLQuery.SQLQueryBeforeOpen(ADataSet: TDataSet); +var + i: Integer; + s: String; + SaveView: TfrView; + SavePage: TfrPage; + SaveBand: TfrBand; + Q:TSQLQuery; + P:TQueryParam; +begin + Q:=TSQLQuery(DataSet); + SaveView := CurView; + SavePage := CurPage; + SaveBand := CurBand; + + CurView := Self; + CurPage := OwnerPage; + CurBand := nil; + + for i := 0 to Q.Params.Count - 1 do + begin + S:=Q.Params[i].Name; + P:=FParams.ParamByName(S); + if Assigned(P) and (P.ParamValue <> '') and (DocMode = dmPrinting) then + begin + case P.ParamType of + ftDate, + ftDateTime:Q.Params[i].AsDateTime := frParser.Calc(P.ParamValue); + ftInteger:Q.Params[i].AsInteger := frParser.Calc(P.ParamValue); + ftFloat:Q.Params[i].AsFloat := frParser.Calc(P.ParamValue); + ftString:Q.Params[i].AsString := frParser.Calc(P.ParamValue); + else + Q.Params[i].Value := frParser.Calc(P.ParamValue); + end; + end; + end; + + if Assigned(Q.DataBase) then + if not Q.DataBase.Connected then Q.DataBase.Connected:=true; + + CurView := SaveView; + CurPage := SavePage; + CurBand := SaveBand; end; function TLRSQLQuery.GetSQL: string; @@ -289,25 +411,80 @@ begin inherited Create(AOwnerPage); BaseName := 'lrSQLQuery'; DataSet:=TSQLQuery.Create(OwnerForm); + DataSet.BeforeOpen:=@SQLQueryBeforeOpen; + FParams:=TQueryParamList.Create; +end; + +destructor TLRSQLQuery.Destroy; +begin + FreeAndNil(FParams); + inherited Destroy; +end; + +function StrToFieldType(AStrTypeName:string):TFieldType; +var + i:TFieldType; +begin + Result:=ftUnknown; + AStrTypeName:=UpperCase(AStrTypeName); + for i in TFieldType do + begin + if UpperCase(Fieldtypenames[i]) = AStrTypeName then + begin + Result:=i; + exit; + end; + end; end; procedure TLRSQLQuery.LoadFromXML(XML: TLrXMLConfig; const Path: String); +var + C: Integer; + i: Integer; begin inherited LoadFromXML(XML, Path); TSQLQuery(DataSet).SQL.Text := XML.GetValue(Path+'SQL/Value'{%H-}, ''); FDatabase:= XML.GetValue(Path+'Database/Value'{%H-}, ''); + + C:=XML.GetValue(Path+'Params/Count/Value', 0); + for i:=0 to C-1 do + FParams.Add( + StrToFieldType(XML.GetValue(Path+'Params/Item'+IntToStr(i)+'/ParamType', '')), + XML.GetValue(Path+'Params/Item'+IntToStr(i)+'/Name', ''), + XML.GetValue(Path+'Params/Item'+IntToStr(i)+'/Value', '') + ); end; procedure TLRSQLQuery.SaveToXML(XML: TLrXMLConfig; const Path: String); +var + i: Integer; + P: TQueryParam; begin inherited SaveToXML(XML, Path); XML.SetValue(Path+'SQL/Value', TSQLQuery(DataSet).SQL.Text); XML.SetValue(Path+'Database/Value', FDatabase); + + XML.SetValue(Path+'Params/Count/Value', FParams.Count); + for i:=0 to FParams.Count-1 do + begin + P:=TQueryParam(FParams[i]); + XML.SetValue(Path+'Params/Item'+IntToStr(i)+'/Name', P.ParamName); + XML.SetValue(Path+'Params/Item'+IntToStr(i)+'/Value', P.ParamValue); + XML.SetValue(Path+'Params/Item'+IntToStr(i)+'/ParamType', Fieldtypenames[P.ParamType]); + end; end; type - { TLRZConnectionProtocolProperty } + { TLRSQLQueryParamsProperty } + + TLRSQLQueryParamsProperty = class(TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: ansistring; override; + procedure Edit; override; + end; + TLRSQLConnectionProtocolProperty = class(TFieldProperty) public @@ -324,6 +501,24 @@ type procedure Edit; override; end; +{ TLRSQLQueryParamsProperty } + +function TLRSQLQueryParamsProperty.GetAttributes: TPropertyAttributes; +begin + Result:=[paDialog, paReadOnly]; +end; + +function TLRSQLQueryParamsProperty.GetValue: ansistring; +begin + Result:='(Params)'; +end; + +procedure TLRSQLQueryParamsProperty.Edit; +begin + if (GetComponent(0) is TLRSQLQuery) then + TLRSQLQuery(GetComponent(0)).DoEditParams; +end; + { TLRSQLQuerySQLProperty } function TLRSQLQuerySQLProperty.GetAttributes: TPropertyAttributes; @@ -373,6 +568,8 @@ initialization RegisterPropertyEditor(TypeInfo(string), TLRSQLQuery, 'Database', TLRSQLConnectionProtocolProperty); RegisterPropertyEditor(TypeInfo(string), TLRSQLQuery, 'SQL', TLRSQLQuerySQLProperty); + + RegisterPropertyEditor(TypeInfo(TQueryParamList), TLRSQLQuery, 'Params', TLRSQLQueryParamsProperty); finalization if Assigned(lrBMP_SQLQuery) then FreeAndNil(lrBMP_SQLQuery); diff --git a/components/lazreport/source/addons/TDbfDB/lr_tdbf.lpk b/components/lazreport/source/addons/TDbfDB/lr_tdbf.lpk index 914175508f..f7ad642941 100644 --- a/components/lazreport/source/addons/TDbfDB/lr_tdbf.lpk +++ b/components/lazreport/source/addons/TDbfDB/lr_tdbf.lpk @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <CONFIG> <Package Version="4"> <Name Value="LR_TDbf"/> @@ -8,27 +8,17 @@ <SearchPaths> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> - <Other> - <CompilerMessages> - <MsgFileName Value=""/> - </CompilerMessages> - <CompilerPath Value="$(CompPath)"/> - </Other> </CompilerOptions> <Description Value="Add support to DBF components for designing LazReport dialogs at runtime with lr_dialogdesign package"/> <License Value="modified LGPL-2 "/> <Version Minor="1" Release="1"/> - <Files Count="2"> + <Files Count="1"> <Item1> <Filename Value="lrtdbfdata.pas"/> <HasRegisterProc Value="True"/> <UnitName Value="lrTDbfData"/> </Item1> - <Item2> - <Filename Value="lrtdbfdata_img.inc"/> - <Type Value="Include"/> - </Item2> </Files> <Type Value="RunAndDesignTime"/> <RequiredPkgs Count="3"> diff --git a/components/lazreport/source/addons/lrOfficeImport/lrspreadsheetimportunit.pas b/components/lazreport/source/addons/lrOfficeImport/lrspreadsheetimportunit.pas index 6f712d06d2..79c0e0da78 100644 --- a/components/lazreport/source/addons/lrOfficeImport/lrspreadsheetimportunit.pas +++ b/components/lazreport/source/addons/lrOfficeImport/lrspreadsheetimportunit.pas @@ -167,7 +167,7 @@ begin T.MonitorFontChanges; T.Memo.Text:=FWorksheet.ReadAsUTF8Text(Cell); - frDesigner.Page.Objects.Add(t); +// frDesigner.Page.Objects.Add(t); end else diff --git a/components/lazreport/source/fr3tolrf.pas b/components/lazreport/source/fr3tolrf.pas index b4c0129463..ec6f1000d3 100644 --- a/components/lazreport/source/fr3tolrf.pas +++ b/components/lazreport/source/fr3tolrf.pas @@ -513,14 +513,16 @@ var View: TfrView; begin View := CreateView(Page, Node.NodeName); - if View<>nil then begin + if View<>nil then + begin View.BeginUpdate; - Page.Objects.Add(View); +// Page.Objects.Add(View); LoadView(Node, Page, View, ParentView); View.EndUpdate; // process any child cNode := Node.FirstChild; - while cNode<>nil do begin + while cNode<>nil do + begin ProcessObject(Page, cNode, View); cNode := cNode.NextSibling; end; diff --git a/components/lazreport/source/lazreport.lpk b/components/lazreport/source/lazreport.lpk index 4ff51482f4..1eb5f9cf69 100644 --- a/components/lazreport/source/lazreport.lpk +++ b/components/lazreport/source/lazreport.lpk @@ -24,7 +24,7 @@ Lazarus Port: Olivier Guilbaud, Jesus Reyes A. See license.txt and license-lazreport.txt for details. "/> <Version Minor="9" Release="9"/> - <Files Count="67"> + <Files Count="70"> <Item1> <Filename Value="lr_about.pas"/> <UnitName Value="LR_About"/> @@ -294,6 +294,18 @@ See license.txt and license-lazreport.txt for details. <Filename Value="lr_previewtoolsabstract.pas"/> <UnitName Value="lr_previewtoolsabstract"/> </Item67> + <Item68> + <Filename Value="lr_crossarray.pas"/> + <UnitName Value="lr_CrossArray"/> + </Item68> + <Item69> + <Filename Value="lr_crosstab.pas"/> + <UnitName Value="lr_CrossTab"/> + </Item69> + <Item70> + <Filename Value="lr_crosstabeditor.pas"/> + <UnitName Value="lr_crosstabeditor"/> + </Item70> </Files> <i18n> <EnableI18N Value="True"/> diff --git a/components/lazreport/source/lazreport.pas b/components/lazreport/source/lazreport.pas index 8be7b68a74..9e8329f208 100644 --- a/components/lazreport/source/lazreport.pas +++ b/components/lazreport/source/lazreport.pas @@ -14,7 +14,7 @@ uses LR_Prntr, LR_progr, lr_propedit, LR_Register, LR_RRect, LR_Shape, LR_Utils, LR_Var, LR_Vared, LR_View, LR_Newrp, Barcode, LR_DBRel, LR_DBComponent, lr_hyphen, LR_Intrp, fr3tolrf, lr_design_ins_filed, lr_previewtoolsabstract, - LazarusPackageIntf; + lr_CrossArray, lr_CrossTab, lr_CrossTabEditor, LazarusPackageIntf; implementation diff --git a/components/lazreport/source/lr_barc.pas b/components/lazreport/source/lr_barc.pas index 008c7a27dd..71f6c8a607 100644 --- a/components/lazreport/source/lr_barc.pas +++ b/components/lazreport/source/lr_barc.pas @@ -91,7 +91,7 @@ type constructor Create(AOwnerPage:TfrPage);override; destructor Destroy; override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; function GenerateBitmap: TBitmap; procedure LoadFromStream(Stream: TStream); override; procedure SaveToStream(Stream: TStream); override; @@ -112,6 +112,7 @@ type property FrameColor; property FrameStyle; property FrameWidth; + property Restrictions; end; { TfrBarCodeForm } @@ -484,10 +485,11 @@ begin inherited Destroy; end; -procedure TfrBarCodeView.Assign(From:TfrView); +procedure TfrBarCodeView.Assign(Source: TPersistent); begin - inherited Assign(From); - Param := (From as TfrBarCodeView).Param; + inherited Assign(Source); + if Source is TfrBarCodeView then + Param := TfrBarCodeView(Source).Param; end; function TfrBarCodeView.GenerateBitmap: TBitmap; diff --git a/components/lazreport/source/lr_chbox.pas b/components/lazreport/source/lr_chbox.pas index 20a8f1f0dc..f5c6f0beda 100644 --- a/components/lazreport/source/lr_chbox.pas +++ b/components/lazreport/source/lr_chbox.pas @@ -43,20 +43,22 @@ type procedure Print(Stream: TStream); override; procedure ExportData; override; procedure DefinePopupMenu(Popup: TPopupMenu); override; - + + procedure Assign(Source: TPersistent); override; procedure LoadFromStream(Stream: TStream); override; procedure SaveToStream(Stream: TStream); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; published property Checked : Boolean read fChecked write fChecked; + property DataField; property FillColor; property FrameColor; property Frames; property FrameStyle; property FrameWidth; property Script; - + property Restrictions; end; @@ -111,12 +113,18 @@ begin end; procedure TfrCheckBoxView.Draw(aCanvas: TCanvas); +var + IsChecked: Boolean; begin BeginDraw(aCanvas); Memo1.Assign(Memo); CalcGaps; ShowBackground; - DrawCheck(DRect, Self.Checked); + IsChecked := Self.Checked; + if Memo1.Count > 0 then + IsChecked := Memo1[0] = '1'; + DrawCheck(DRect, IsChecked); +// DrawCheck(DRect, Self.Checked); ShowFrame; RestoreCoord; end; @@ -153,10 +161,16 @@ begin if Popup=nil then; end; +procedure TfrCheckBoxView.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TfrCheckBoxView then + Self.Checked := TfrCheckBoxView(Source).Checked; +end; + procedure TfrCheckBoxView.LoadFromStream(Stream: TStream); begin inherited LoadFromStream(Stream); - Stream.Read(fChecked, SizeOf(fChecked)); end; @@ -169,7 +183,6 @@ end; procedure TfrCheckBoxView.LoadFromXML(XML: TLrXMLConfig; const Path: String); begin inherited LoadFromXML(XML, Path); - RestoreProperty('Checked',XML.GetValue(Path+'Data/Checked/Value','')); end; diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas index 537c5ab6ba..7289dc7fb3 100644 --- a/components/lazreport/source/lr_class.pas +++ b/components/lazreport/source/lr_class.pas @@ -84,9 +84,12 @@ type TfrReportOptions = set of TfrReportOption; TfrObjectType = (otlReportView, otlUIControl); - TlrDesignOption = (doUndoDisable); + TlrDesignOption = (doUndoDisable, doChildComponent); TlrDesignOptions = set of TlrDesignOption; + TlrRestriction = (lrrDontModify, lrrDontSize, lrrDontMove, lrrDontDelete); + TlrRestrictions = set of TlrRestriction; + TfrView = class; TfrBand = class; TfrPage = class; @@ -183,6 +186,7 @@ type procedure RestoreProperty(const Prop,aValue : String; aObj : TPersistent=nil); procedure SetName(const AValue: string); virtual; procedure AfterLoad;virtual; + procedure AfterCreate;virtual; function ExecMetod(const AName: String; p1, p2, p3: Variant; var Val: Variant):boolean;virtual; function GetLeft: Integer;virtual; function GetTop: Integer;virtual; @@ -200,8 +204,10 @@ type constructor Create(AOwnerPage:TfrPage); virtual; destructor Destroy; override; - - procedure Assign(From: TfrView); virtual; overload; + + { TODO : check this!! } + procedure AssignTo(Dest: TPersistent); override; + procedure Assign(Source: TPersistent); override; //virtual; overload; procedure BeginUpdate; procedure EndUpdate; @@ -227,22 +233,25 @@ type TfrView = class(TfrObject) private - fFillColor : TColor; + FFillColor : TColor; fCanvas : TCanvas; fFrameColor: TColor; fFrames : TfrFrameBorders; fFrameStyle: TfrFrameStyle; fFrameWidth: Double; + FRestrictions: TlrRestrictions; fStreamMode: TfrStreamMode; fFormat : Integer; fFormatStr : string; fFrameTyp : word; FTag: string; FURLInfo: string; + function GetDataField: string; function GetLeft: Double; function GetStretched: Boolean; function GetTop: Double; procedure P1Click(Sender: TObject); + procedure SetDataField(AValue: string); procedure SetFillColor(const AValue: TColor); procedure SetFormat(const AValue: Integer); procedure SetFormatStr(const AValue: String); @@ -269,7 +278,6 @@ type procedure OnHook(View: TfrView); virtual; procedure BeforeChange; procedure AfterChange; - procedure AfterCreate;virtual; procedure ResetLastValue; virtual; function GetFrames: TfrFrameBorders; virtual; procedure ModifyFlag(aFlag: Word; aValue:Boolean); @@ -280,6 +288,8 @@ type procedure SetWidth(const AValue: Double);virtual; function GetHeight: Double;virtual; function GetWidth: Double;virtual; + procedure PrepareObject;virtual; + property DataField : string read GetDataField write SetDataField; public Parent: TfrBand; ID: Integer; @@ -296,7 +306,7 @@ type constructor Create(AOwnerPage:TfrPage); override; destructor Destroy; override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure CalcGaps; virtual; procedure RestoreCoord; virtual; procedure Draw(aCanvas: TCanvas); virtual; abstract; @@ -318,7 +328,7 @@ type property Canvas : TCanvas read fCanvas write fCanvas; - property FillColor : TColor read fFillColor write SetFillColor; + property FillColor : TColor read FFillColor write SetFillColor; property Stretched : Boolean read GetStretched write SetStretched; property Frames : TfrFrameBorders read GetFrames write SetFrames; @@ -329,7 +339,7 @@ type property FormatStr : String read fFormatStr write SetFormatStr; property StreamMode: TfrStreamMode read fStreamMode write fStreamMode; - + property Restrictions:TlrRestrictions read FRestrictions write FRestrictions; published property Left: double read GetLeft write SetLeft; property Top: double read GetTop write SetTop; @@ -365,7 +375,7 @@ type procedure Draw(ACanvas: TCanvas); override; procedure DefinePopupMenu(Popup: TPopupMenu); override; published - //property Restrictions; + property Restrictions; end; { TfrNonVisualControl } @@ -383,7 +393,9 @@ type { TfrMemoView } - TfrMemoView = class(TfrStretcheable) + { TfrCustomMemoView } + + TfrCustomMemoView = class(TfrStretcheable) private FCursor: TCursor; FDetailReport: string; @@ -457,7 +469,7 @@ type constructor Create(AOwnerPage:TfrPage); override; destructor Destroy; override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure Draw(aCanvas: TCanvas); override; procedure Print(Stream: TStream); override; procedure ExportData; override; @@ -470,7 +482,6 @@ type procedure MonitorFontChanges; property Justify: boolean read GetJustify write SetJustify; - published property Cursor: TCursor read FCursor write SetCursor default crDefault; property DetailReport : string read FDetailReport write FDetailReport; property Font : TFont read fFont write SetFont; @@ -485,8 +496,21 @@ type property OnClick : TfrScriptStrings read FOnClick write SetOnClick; property OnMouseEnter : TfrScriptStrings read FOnMouseEnter write SetOnMouseEnter; property OnMouseLeave : TfrScriptStrings read FOnMouseLeave write SetOnMouseLeave; + end; - + TfrMemoView = class(TfrCustomMemoView) + published + property Cursor; + property DetailReport; + property Font; + property Alignment; + property Layout; + property Angle; + property WordBreak; + property WordWrap; + property AutoSize; + property HideDuplicates; + property HideZeroValues; property FillColor; property Memo; property Script; @@ -496,6 +520,10 @@ type property FrameWidth; property Format; property FormatStr; + property Restrictions; + property OnClick; + property OnMouseEnter; + property OnMouseLeave; end; { TfrBandView } @@ -521,7 +549,7 @@ type public constructor Create(AOwnerPage:TfrPage); override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure LoadFromStream(Stream: TStream); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; @@ -544,6 +572,7 @@ type property Script; property Stretched; + property Restrictions; end; { TfrSubReportView } @@ -552,13 +581,15 @@ type public SubPage: Integer; constructor Create(AOwnerPage:TfrPage); override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure Draw(aCanvas: TCanvas); override; procedure LoadFromStream(Stream: TStream); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToStream(Stream: TStream); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure DefinePopupMenu({%H-}Popup: TPopupMenu); override; + published + property Restrictions; end; { TfrPictureView } @@ -585,7 +616,7 @@ type constructor Create(AOwnerPage:TfrPage); override; destructor Destroy; override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure Draw(aCanvas: TCanvas); override; procedure LoadFromStream(Stream: TStream); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; @@ -597,6 +628,7 @@ type property KeepAspect:boolean read GetKeepAspect write SetKeepAspect; property Centered: boolean read GetCentered write SetCentered; + property DataField; property Memo; property Script; property Frames; @@ -605,7 +637,8 @@ type property FrameWidth; property Stretched; property SharedName: string read FSharedName write FSharedName; - property FillColor : TColor read fFillColor write SetFillColor; + property FillColor; //: TColor read FFillColor write SetFillColor; + property Restrictions; end; { TfrLineView } @@ -625,6 +658,7 @@ type property FrameStyle; property FrameWidth; property Stretched; + property Restrictions; end; TfrRect = Class(TPersistent) @@ -685,7 +719,7 @@ type procedure ResetLastValues; function getName: string; public - maxdy: Integer; + MaxDY: Integer; Typ: TfrBandType; PrintIfSubsetEmpty, NewPageAfter, Stretched, PageBreak: Boolean; @@ -755,8 +789,6 @@ type LastStaticColumnY : Integer; XAdjust : Integer; List : TFpList; - Mode : TfrPageMode; - PlayFrom : Integer; LastBand : TfrBand; ColPos : Integer; CurPos : Integer; @@ -765,7 +797,6 @@ type procedure DoAggregate(a: Array of TfrBandType); procedure AddRecord(b: TfrBand; rt: TfrBandRecType); procedure ClearRecList; - function PlayRecList: Boolean; procedure DrawPageFooters; function BandExists(b: TfrBand): Boolean; procedure LoadFromStream(Stream: TStream); @@ -773,6 +804,9 @@ type procedure ShowBand(b: TfrBand); protected + Mode : TfrPageMode; + PlayFrom : Integer; + function PlayRecList: Boolean; procedure InitReport; virtual; procedure DoneReport; virtual; procedure TossObjects; virtual; @@ -1048,6 +1082,7 @@ type fOnFormPageBookmarks: TFormPageBookmarksEvent; FPages: TfrPages; FEMFPages: TfrEMFPages; + FRebuildPrinter: boolean; FReportAutor: string; FReportCreateDate: TDateTime; FReportLastChange: TDateTime; @@ -1086,6 +1121,7 @@ type FCurrentFilter: TfrExportFilter; FPageNumbers : String; FCopies : Integer; +// FCurPage : TfrPage; // FDefaultTitle : String; FTitle : String; @@ -1097,8 +1133,6 @@ type fDefExportFilterClass: string; fDefExportFileName: string; - function FormatValue(V: Variant; AFormat: Integer; const AFormatStr: String): String; -// function GetLRTitle: String; procedure OnGetParsFunction(const aName: String; p1, p2, p3: Variant; var val: Variant); @@ -1151,6 +1185,7 @@ type destructor Destroy; override; procedure Clear; // service methods + function FormatValue(V: Variant; AFormat: Integer; const AFormatStr: String): String; function FindVariable(Variable: String): Integer; procedure GetVariableValue(const s: String; var aValue: Variant); procedure GetVarList(CatNo: Integer; List: TStrings); @@ -1231,6 +1266,7 @@ type property Options: TfrReportOptions read FReportOptions write FReportOptions; property Preview: TfrPreview read FPreview write FPreview; property PreviewButtons: TfrPreviewButtons read FPreviewButtons write FPreviewButtons; + property RebuildPrinter: boolean read FRebuildPrinter write FRebuildPrinter default False; property ReportType: TfrReportType read FReportType write FReportType default rtSimple; property ShowProgress: Boolean read FShowProgress write FShowProgress default True; property StoreInForm: Boolean read FStoreInForm write FStoreInForm default False; @@ -1312,6 +1348,9 @@ type procedure ShowEditor({%H-}t: TfrView); virtual; end; + TlrObjEditorProc = function(lrObj: TfrView) : boolean; + + TfrFunctionDescription = class(TObject) funName:string; funGroup:string; @@ -1351,7 +1390,9 @@ type function frCreateObject(Typ: Byte; const ClassName: String; AOwnerPage:TfrPage): TfrView; procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap; - const ButtonHint: String; EditorForm: TfrObjEditorForm; ObjectType:TfrObjectType; InitProc:TfrAddinInitProc); + const ButtonHint: String; EditorForm: TfrObjEditorForm; ObjectType:TfrObjectType; + InitProc:TfrAddinInitProc; EditorProc : TlrObjEditorProc = nil); + procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap; const ButtonHint: String; EditorForm: TfrObjEditorForm; InitProc:TfrAddinInitProc=nil); @@ -1408,6 +1449,7 @@ type ButtonHint: String; InitializeProc: TfrAddinInitProc; ObjectType:TfrObjectType; + EditorProc : TlrObjEditorProc; end; TfrExportFilterInfo = record @@ -1466,6 +1508,9 @@ var {$ENDIF} LRE_OLDV25_FRF_READ: Boolean = False; // read broken frf v25 reports, bug 25037 + // variables used through report building + TempBmp: TBitmap; // temporary bitmap used by TfrMemoView + implementation uses @@ -1498,7 +1543,6 @@ type var VHeight: Integer; // used for height calculation of TfrMemoView SBmp: TBitmap; // small bitmap used by TfrBandView drawing - TempBmp: TBitmap; // temporary bitmap used by TfrMemoView CurDate, CurTime: TDateTime; // date/time of report starting CurValue: Variant; // used for highlighting AggrBand: TfrBand = nil; // used for aggregate functions @@ -1512,13 +1556,12 @@ var BoolStr: Array[0..3] of String; HookList: TFpList; FRInitialized: Boolean = False; - - // variables used through report building + FHyp: THyphen = nil; PrevY, PrevBottomY, ColumnXAdjust: Integer; - Append, WasPF: Boolean; + AppendPage, WasPF: Boolean; CompositeMode: Boolean; MaxTitleSize: Integer = 0; - FHyp: THyphen = nil; + {-----------------------------------------------------------------------------} const @@ -1750,7 +1793,8 @@ end; procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap; const ButtonHint: String; EditorForm: TfrObjEditorForm; - ObjectType: TfrObjectType; InitProc: TfrAddinInitProc); + ObjectType: TfrObjectType; InitProc: TfrAddinInitProc; + EditorProc: TlrObjEditorProc = nil); begin frAddIns[frAddInsCount].ClassRef := ClassRef; frAddIns[frAddInsCount].EditorForm := EditorForm; @@ -1758,6 +1802,7 @@ begin frAddIns[frAddInsCount].ButtonHint := ButtonHint; frAddIns[frAddInsCount].InitializeProc := InitProc; frAddIns[frAddInsCount].ObjectType:=ObjectType; + frAddIns[frAddInsCount].EditorProc:= EditorProc; if frDesigner <> nil then begin if Assigned(InitProc) then InitProc; @@ -1767,8 +1812,9 @@ begin Inc(frAddInsCount); end; -procedure frRegisterObject(ClassRef: TfrViewClass; ButtonBmp: TBitmap; - const ButtonHint: String; EditorForm: TfrObjEditorForm; InitProc:TfrAddinInitProc=nil); +procedure frRegisterObject(ClassRef: TFRViewClass; ButtonBmp: TBitmap; + const ButtonHint: String; EditorForm: TfrObjEditorForm; + InitProc: TfrAddinInitProc); begin frRegisterObject(ClassRef, ButtonBmp, ButtonHint, EditorForm, otlReportView, InitProc); end; @@ -2334,7 +2380,7 @@ begin Memo1 := TStringList.Create; fFrameWidth := 1; fFrameColor := clBlack; - fFillColor := clNone; + FFillColor := clNone; fFormat := 2*256 + Ord(DecimalSeparator); BaseName := 'View'; FVisible := True; @@ -2354,25 +2400,28 @@ begin inherited Destroy; end; -procedure TfrView.Assign(From: TfrView); +procedure TfrView.Assign(Source: TPersistent); begin - inherited Assign(From); - - fName := From.Name; - Typ := From.Typ; - Selected := From.Selected; + inherited Assign(Source); - Flags := From.Flags; - fFrameWidth := From.FrameWidth; - fFrameColor := From.FrameColor; - fFrameStyle := From.FrameStyle; - fFillColor := From.FillColor; - fFormat := From.Format; - fFormatStr := From.FormatStr; - fVisible := From.Visible; - fFrames:=From.Frames; - FTag:=From.FTag; - FURLInfo:=From.FURLInfo; + if Source is TfrView then + begin + fName := TfrView(Source).Name; + Typ := TfrView(Source).Typ; + Selected := TfrView(Source).Selected; + Flags := TfrView(Source).Flags; + fFrameWidth := TfrView(Source).FrameWidth; + fFrameColor := TfrView(Source).FrameColor; + fFrameStyle := TfrView(Source).FrameStyle; + FFillColor := TfrView(Source).FillColor; + fFormat := TfrView(Source).Format; + fFormatStr := TfrView(Source).FormatStr; + fVisible := TfrView(Source).Visible; + fFrames := TfrView(Source).Frames; + FTag := TfrView(Source).FTag; + FURLInfo := TfrView(Source).FURLInfo; + FRestrictions := TfrView(Source).FRestrictions; + end; end; procedure TfrView.CalcGaps; @@ -2670,7 +2719,7 @@ begin fFrameStyle := TfrFrameStyle(wb); end; - Read(fFillColor, 4); + Read(FFillColor, 4); if StreamMode = smDesigning then begin @@ -2731,7 +2780,9 @@ begin S:=XML.GetValue(Path+'Frames/FrameBorders/Value',''); if S<>'' then - RestoreProperty('Frames',S); + RestoreProperty('Frames',S) + else + Frames:=[]; S:=XML.GetValue(Path+'Frames/FrameStyle/Value',''); if S<>'' then @@ -2750,6 +2801,10 @@ begin FTag:=XML.GetValue(Path+'Tag/Value', ''); FURLInfo:=XML.GetValue(Path+'FURLInfo/Value', ''); + + S:=XML.GetValue(Path+'Frames/Restrictions/Value',''); + if S<>'' then + RestoreProperty('Restrictions',S); end; procedure TfrView.SaveToStream(Stream: TStream); @@ -2782,7 +2837,7 @@ begin Write(fFrames,SizeOf(fFrames)); Write(fFrameStyle, SizeOf(fFrameStyle)); - Write(fFillColor, 4); + Write(FFillColor, 4); if StreamMode = smDesigning then begin @@ -2862,6 +2917,9 @@ begin XML.SetValue(Path+'Data/Memo1/Value', Memo1.Text); XML.SetValue(Path+'Tag/Value', FTag); XML.SetValue(Path+'FURLInfo/Value', FURLInfo); + + if IsPublishedProp(self,'Restrictions') then + XML.SetValue(Path+'Frames/Restrictions/Value', GetSaveProperty('Restrictions')); end; procedure TfrView.Resized; @@ -2890,11 +2948,6 @@ begin frDesigner.AfterChange; end; -procedure TfrView.AfterCreate; -begin - // -end; - procedure TfrView.ResetLastValue; begin // to be overriden in TfrMemoView @@ -2991,6 +3044,14 @@ begin MenuItemCheckFlag(Sender, flStretched); end; +procedure TfrView.SetDataField(AValue: string); +begin + if Memo.Count = 0 then + Memo.Add(AValue) + else + Memo[0]:=AValue; +end; + function TfrView.GetLeft: Double; begin if frDesigner<>nil then @@ -2999,6 +3060,14 @@ begin result := x; end; +function TfrView.GetDataField: string; +begin + if Memo.Count>0 then + Result:=Memo[0] + else + Result:=''; +end; + function TfrView.GetStretched: Boolean; begin Result:=((Flags and flStretched)<>0); @@ -3059,9 +3128,14 @@ begin result := dx; end; +procedure TfrView.PrepareObject; +begin + +end; + procedure TfrView.SetFillColor(const AValue: TColor); begin - if aValue<>fFillColor then + if aValue<>FFillColor then begin BeforeChange; fFillColor:=aValue; @@ -3176,7 +3250,7 @@ begin end; {----------------------------------------------------------------------------} -constructor TfrMemoView.Create(AOwnerPage: TfrPage); +constructor TfrCustomMemoView.Create(AOwnerPage: TfrPage); begin inherited Create(AOwnerPage); fOnClick:=TfrScriptStrings.Create; @@ -3201,7 +3275,7 @@ begin Adjust := 0; end; -destructor TfrMemoView.Destroy; +destructor TfrCustomMemoView.Destroy; begin FFont.Free; if FLastValue<>nil then @@ -3213,26 +3287,26 @@ begin inherited Destroy; end; -procedure TfrMemoView.SetFont(Value: TFont); +procedure TfrCustomMemoView.SetFont(Value: TFont); begin BeforeChange; fFont.Assign(Value); AfterChange; end; -procedure TfrMemoView.SetHideDuplicates(const AValue: Boolean); +procedure TfrCustomMemoView.SetHideDuplicates(const AValue: Boolean); begin if HideDuplicates<>AValue then ModifyFlag(flHideDuplicates, AValue); end; -procedure TfrMemoView.SetHideZeroValues(AValue: Boolean); +procedure TfrCustomMemoView.SetHideZeroValues(AValue: Boolean); begin if WordBreak<>AValue then ModifyFlag(flHideZeros, AValue); end; -procedure TfrMemoView.SetIsLastValueSet(const AValue: boolean); +procedure TfrCustomMemoView.SetIsLastValueSet(const AValue: boolean); begin if AValue then begin if FLastValue=nil then @@ -3245,7 +3319,7 @@ begin end; end; -procedure TfrMemoView.SetJustify(AValue: boolean); +procedure TfrCustomMemoView.SetJustify(AValue: boolean); begin // only if AValue=true change Adjust to reflect justify // otherwise let it alone, so previous value of alignment is respected @@ -3253,7 +3327,7 @@ begin Adjust := Adjust or %11; end; -procedure TfrMemoView.SetLayout(const AValue: TTextLayout); +procedure TfrCustomMemoView.SetLayout(const AValue: TTextLayout); begin if Layout<>AValue then begin @@ -3263,59 +3337,60 @@ begin end; end; -procedure TfrMemoView.SetOnClick(AValue: TfrScriptStrings); +procedure TfrCustomMemoView.SetOnClick(AValue: TfrScriptStrings); begin BeforeChange; fOnClick.Assign(AValue); AfterChange; end; -procedure TfrMemoView.SetOnMouseEnter(AValue: TfrScriptStrings); +procedure TfrCustomMemoView.SetOnMouseEnter(AValue: TfrScriptStrings); begin BeforeChange; FOnMouseEnter.Assign(AValue); AfterChange; end; -procedure TfrMemoView.SetOnMouseLeave(AValue: TfrScriptStrings); +procedure TfrCustomMemoView.SetOnMouseLeave(AValue: TfrScriptStrings); begin BeforeChange; FOnMouseLeave.Assign(AValue); AfterChange; end; -procedure TfrMemoView.SetWordBreak(AValue: Boolean); +procedure TfrCustomMemoView.SetWordBreak(AValue: Boolean); begin if WordBreak<>AValue then ModifyFlag(flWordBreak, AValue); end; -procedure TfrMemoView.SetWordWrap(const AValue: Boolean); +procedure TfrCustomMemoView.SetWordWrap(const AValue: Boolean); begin if WordWrap<>AValue then ModifyFlag(flWordWrap, AValue); end; -procedure TfrMemoView.Assign(From: TfrView); +procedure TfrCustomMemoView.Assign(Source: TPersistent); begin - inherited Assign(From); - FFont.Assign(TfrMemoView(From).Font); - Adjust := TfrMemoView(From).Adjust; - Highlight := TfrMemoView(From).Highlight; - HighlightStr := TfrMemoView(From).HighlightStr; - LineSpacing := TfrMemoView(From).LineSpacing; + inherited Assign(Source); - if From is TfrMemoView then + if Source is TfrCustomMemoView then begin - FOnClick.Assign(TfrMemoView(From).FOnClick); - FOnMouseEnter.Assign(TfrMemoView(From).FOnMouseEnter); - FOnMouseLeave.Assign(TfrMemoView(From).FOnMouseLeave); - FDetailReport:=TfrMemoView(From).FDetailReport; - FCursor:=TfrMemoView(From).FCursor; + FFont.Assign(TfrCustomMemoView(Source).Font); + Adjust := TfrCustomMemoView(Source).Adjust; + Highlight := TfrCustomMemoView(Source).Highlight; + HighlightStr := TfrCustomMemoView(Source).HighlightStr; + LineSpacing := TfrCustomMemoView(Source).LineSpacing; + + FOnClick.Assign(TfrCustomMemoView(Source).FOnClick); + FOnMouseEnter.Assign(TfrCustomMemoView(Source).FOnMouseEnter); + FOnMouseLeave.Assign(TfrCustomMemoView(Source).FOnMouseLeave); + FDetailReport:=TfrCustomMemoView(Source).FDetailReport; + FCursor:=TfrCustomMemoView(Source).FCursor; end; end; -procedure TfrMemoView.ExpandVariables; +procedure TfrCustomMemoView.ExpandVariables; var i: Integer; procedure GetData(var s: String); @@ -3356,7 +3431,7 @@ begin end; end; -procedure TfrMemoView.AssignFont(aCanvas: TCanvas); +procedure TfrCustomMemoView.AssignFont(aCanvas: TCanvas); begin {$IFDEF DebugLR} DebugLnEnter('AssignFont (%s) INIT: Self.Font.Size=%d aCanvas.Font.Size=%d', @@ -3379,8 +3454,8 @@ type TWordBreaks = string; const - gl:string='ÀŨÈÎÓÛÝÞßàåèîóûýþ'; - r_sogl:string='ÚÜúü'; + gl : string = 'АЕЁИОУЫЭЮЯаеёиоуыэюя'; + r_sogl :string = 'ЪЬьъ'; function BreakWord(s: string): TWordBreaks; @@ -3424,7 +3499,7 @@ begin {$ENDIF} end; -procedure TfrMemoView.WrapMemo; +procedure TfrCustomMemoView.WrapMemo; var size, size1, maxwidth: Integer; b: TWordBreaks; @@ -3653,7 +3728,7 @@ begin {$ENDIF} end; -procedure TfrMemoView.ShowMemo; +procedure TfrCustomMemoView.ShowMemo; var DR : TRect; SavX,SavY : Integer; @@ -3903,7 +3978,7 @@ begin *) end; -function TfrMemoView.CalcWidth(aMemo: TStringList): Integer; +function TfrCustomMemoView.CalcWidth(aMemo: TStringList): Integer; var CalcRect: TRect; s: String; @@ -3937,7 +4012,7 @@ begin {$ENDIF} end; -procedure TfrMemoView.Draw(aCanvas: TCanvas); +procedure TfrCustomMemoView.Draw(aCanvas: TCanvas); var NeedWrap: Boolean; newdx: Integer; @@ -4014,7 +4089,7 @@ begin {$Endif} end; -procedure TfrMemoView.Print(Stream: TStream); +procedure TfrCustomMemoView.Print(Stream: TStream); var St: String; CanExpandVar: Boolean; @@ -4072,7 +4147,7 @@ begin begin Font.Style:= frSetFontStyle(Highlight.FontStyle); Font.Color:= Highlight.FontColor; - fFillColor := Highlight.FillColor; + FFillColor := Highlight.FillColor; end; end; @@ -4103,7 +4178,7 @@ begin Font.Assign(OldFont); OldFont.Free; - fFillColor := OldFill; + FFillColor := OldFill; DrawMode := drAll; {$IFDEF DebugLR} WriteStr(St, DrawMode); @@ -4111,7 +4186,7 @@ begin {$ENDIF} end; -procedure TfrMemoView.ExportData; +procedure TfrCustomMemoView.ExportData; begin CurReport.InternalOnExportData(Self); Exporting := True; @@ -4120,7 +4195,7 @@ begin CurReport.InternalOnExported(Self); end; -function TfrMemoView.CalcHeight: Integer; +function TfrCustomMemoView.CalcHeight: Integer; var s: String; CanExpandVar: Boolean; @@ -4150,7 +4225,7 @@ begin begin Font.Style := frSetFontStyle(Highlight.FontStyle); Font.Color := Highlight.FontColor; - fFillColor := Highlight.FillColor; + FFillColor := Highlight.FillColor; end; if ((Flags and flAutoSize) <> 0) and (Memo1.Count > 0) and (DocMode <> dmDesigning) then @@ -4167,23 +4242,23 @@ begin end; Font.Assign(OldFont); OldFont.Free; - fFillColor := OldFill; + FFillColor := OldFill; {$IFDEF DebugLR} DebugLnExit('TfrMemoView.CalcHeight DONE result=%d',[Result]); {$ENDIF} end; -function TfrMemoView.MinHeight: Integer; +function TfrCustomMemoView.MinHeight: Integer; begin Result := TextHeight; end; -function TfrMemoView.RemainHeight: Integer; +function TfrCustomMemoView.RemainHeight: Integer; begin Result := Memo1.Count * TextHeight; end; -procedure TfrMemoView.LoadFromStream(Stream: TStream); +procedure TfrCustomMemoView.LoadFromStream(Stream: TStream); var w: Word; i: Integer; @@ -4250,14 +4325,14 @@ begin Flags := Flags or flWordWrap; end; -procedure TfrMemoView.LoadFromXML(XML: TLrXMLConfig; const Path: String); +procedure TfrCustomMemoView.LoadFromXML(XML: TLrXMLConfig; const Path: String); begin inherited LoadFromXML(XML, Path); Font.Name := XML.GetValue(Path+'Font/Name/Value', 'Arial'); // todo chk Font.Size := XML.GetValue(Path+'Font/Size/Value'{%H-}, 10); // todo chk - RestoreProperty('CharSet',XML.GetValue(Path+'Font/Charset/Value',''),Font); - RestoreProperty('Style',XML.GetValue(Path+'Font/Style/Value',''),Font); + RestoreProperty('CharSet', XML.GetValue(Path+'Font/Charset/Value', '0'), Font); + RestoreProperty('Style',XML.GetValue(Path+'Font/Style/Value',''), Font); Font.Color := StringToColor(XML.GetValue(Path+'Font/Color/Value','clBlack')); // todo chk if StreamMode = smDesigning then begin @@ -4281,7 +4356,7 @@ begin FDetailReport:= XML.GetValue(Path+'Data/DetailReport/Value', ''); end; -procedure TfrMemoView.SaveToStream(Stream: TStream); +procedure TfrCustomMemoView.SaveToStream(Stream: TStream); var i: Integer; w: Word; @@ -4322,7 +4397,7 @@ begin end; end; -procedure TfrMemoView.SaveToXML(XML: TLrXMLConfig; const Path: String); +procedure TfrCustomMemoView.SaveToXML(XML: TLrXMLConfig; const Path: String); begin inherited SaveToXML(XML, Path); XML.SetValue(Path+'Font/Name/Value', Font.name); @@ -4351,7 +4426,7 @@ begin XML.SetValue(Path+'Data/DetailReport/Value', FDetailReport); end; -procedure TfrMemoView.GetBlob(b: TfrTField); +procedure TfrCustomMemoView.GetBlob(b: TfrTField); var M: TMemoryStream; begin @@ -4371,17 +4446,17 @@ begin end; end; -procedure TfrMemoView.FontChange(sender: TObject); +procedure TfrCustomMemoView.FontChange(sender: TObject); begin AfterChange; end; -procedure TfrMemoView.ResetLastValue; +procedure TfrCustomMemoView.ResetLastValue; begin IsLastValueSet := False; end; -procedure TfrMemoView.DoRunScript(AScript: TfrScriptStrings); +procedure TfrCustomMemoView.DoRunScript(AScript: TfrScriptStrings); var FSaveView:TfrView; FSavePage:TfrPage; @@ -4406,7 +4481,7 @@ begin end; end; -procedure TfrMemoView.DoOnClick; +procedure TfrCustomMemoView.DoOnClick; var FSaveRep,FDetailRep:TfrReport; FSaveView:TfrView; @@ -4476,19 +4551,19 @@ begin end; end; -procedure TfrMemoView.DoMouseEnter; +procedure TfrCustomMemoView.DoMouseEnter; begin if (FOnMouseEnter.Count>0) and (Trim(FOnMouseEnter.Text)<>'') and (Assigned(CurReport))then DoRunScript(FOnMouseEnter); end; -procedure TfrMemoView.DoMouseLeave; +procedure TfrCustomMemoView.DoMouseLeave; begin if (FOnMouseLeave.Count>0) and (Trim(FOnMouseLeave.Text)<>'') and (Assigned(CurReport))then DoRunScript(FOnMouseLeave); end; -procedure TfrMemoView.DefinePopupMenu(Popup: TPopupMenu); +procedure TfrCustomMemoView.DefinePopupMenu(Popup: TPopupMenu); var m: TMenuItem; begin @@ -4530,12 +4605,12 @@ begin Popup.Items.Add(m); end; -procedure TfrMemoView.MonitorFontChanges; +procedure TfrCustomMemoView.MonitorFontChanges; begin FFont.OnChange:= @FontChange; end; -procedure TfrMemoView.P1Click(Sender: TObject); +procedure TfrCustomMemoView.P1Click(Sender: TObject); var t: TfrView; i: Integer; @@ -4554,8 +4629,8 @@ begin t := TfrView(frDesigner.Page.Objects[i]); if t.Selected then begin - (t as TfrMemoView).Format := EdFormat; - (t as TfrMemoView).FormatStr := EdFormatStr; + TfrCustomMemoView(t).Format := EdFormat; + TfrCustomMemoView(t).FormatStr := EdFormatStr; end; end; end; @@ -4566,42 +4641,42 @@ begin end; end; -function TfrMemoView.GetAutoSize: Boolean; +function TfrCustomMemoView.GetAutoSize: Boolean; begin Result:=((Flags and flAutoSize)<>0); end; -function TfrMemoView.GetHideDuplicates: Boolean; +function TfrCustomMemoView.GetHideDuplicates: Boolean; begin result:=((Flags and flHideDuplicates)<>0); end; -function TfrMemoView.GetHideZeroValues: Boolean; +function TfrCustomMemoView.GetHideZeroValues: Boolean; begin Result:=((Flags and flHideZeros)<>0); end; -function TfrMemoView.GetIsLastValueSet: boolean; +function TfrCustomMemoView.GetIsLastValueSet: boolean; begin result := FLastValue<>nil; end; -function TfrMemoView.GetJustify: boolean; +function TfrCustomMemoView.GetJustify: boolean; begin result := (Adjust and %11) = %11; end; -function TfrMemoView.GetLayout: TTextLayout; +function TfrCustomMemoView.GetLayout: TTextLayout; begin result := TTextLayout((adjust shr 3) and %11); end; -function TfrMemoView.GetWordBreak: Boolean; +function TfrCustomMemoView.GetWordBreak: Boolean; begin Result := ((Flags and flWordBreak)<>0); end; -function TfrMemoView.GetAlignment: TAlignment; +function TfrCustomMemoView.GetAlignment: TAlignment; begin if (Adjust and %11) = %11 then result := taLeftJustify @@ -4609,7 +4684,7 @@ begin Result:=Classes.TAlignment(Adjust and %11); end; -function TfrMemoView.GetAngle: Byte; +function TfrCustomMemoView.GetAngle: Byte; begin if Adjust and 4 <> 0 then Result := 90 @@ -4617,22 +4692,22 @@ begin Result := 0 end; -function TfrMemoView.GetWordWrap: Boolean; +function TfrCustomMemoView.GetWordWrap: Boolean; begin Result:=((Flags and flWordWrap)<>0); end; -procedure TfrMemoView.P2Click(Sender: TObject); +procedure TfrCustomMemoView.P2Click(Sender: TObject); begin MenuItemCheckFlag(Sender, flWordWrap); end; -procedure TfrMemoView.P3Click(Sender: TObject); +procedure TfrCustomMemoView.P3Click(Sender: TObject); begin MenuItemCheckFlag(Sender, flWordBreak); end; -procedure TfrMemoView.P4Click(Sender: TObject); +procedure TfrCustomMemoView.P4Click(Sender: TObject); var t: TfrView; i: Integer; @@ -4666,17 +4741,17 @@ begin frDesigner.AfterChange; end; -procedure TfrMemoView.P5Click(Sender: TObject); +procedure TfrCustomMemoView.P5Click(Sender: TObject); begin MenuItemCheckFlag(Sender, flAutoSize); end; -procedure TfrMemoView.P6Click(Sender: TObject); +procedure TfrCustomMemoView.P6Click(Sender: TObject); begin MenuItemCheckFlag(Sender, flHideZeros); end; -procedure TfrMemoView.SetAlignment(const AValue: TAlignment); +procedure TfrCustomMemoView.SetAlignment(const AValue: TAlignment); var b: byte; begin @@ -4691,7 +4766,7 @@ begin end; end; -procedure TfrMemoView.SetAngle(const AValue: Byte); +procedure TfrCustomMemoView.SetAngle(const AValue: Byte); begin if AValue <> Angle then begin @@ -4704,13 +4779,13 @@ begin end; end; -procedure TfrMemoView.SetAutoSize(const AValue: Boolean); +procedure TfrCustomMemoView.SetAutoSize(const AValue: Boolean); begin if AutoSize<>AValue then ModifyFlag(flAutoSize, AValue); end; -procedure TfrMemoView.SetCursor(AValue: TCursor); +procedure TfrCustomMemoView.SetCursor(AValue: TCursor); begin if FCursor=AValue then Exit; BeforeChange; @@ -4728,14 +4803,14 @@ begin Flags := flBandOnFirstPage + flBandOnLastPage; end; -procedure TfrBandView.Assign(From: TfrView); +procedure TfrBandView.Assign(Source: TPersistent); begin - inherited Assign(From); - if From is TfrBandView then + inherited Assign(Source); + if Source is TfrBandView then begin - BandType := TFrBandView(From).BandType; - DataSet := TFrBandView(From).DataSet; - GroupCondition:=TFrBandView(From).GroupCondition; + BandType := TFrBandView(Source).BandType; + DataSet := TFrBandView(Source).DataSet; + GroupCondition:=TFrBandView(Source).GroupCondition; end; end; @@ -5125,10 +5200,11 @@ begin BaseName := 'SubReport'; end; -procedure TfrSubReportView.Assign(From: TfrView); +procedure TfrSubReportView.Assign(Source: TPersistent); begin - inherited Assign(From); - SubPage := (From as TfrSubReportView).SubPage; + inherited Assign(Source); + if Source is TfrSubReportView then + SubPage := TfrSubReportView(Source).SubPage; end; procedure TfrSubReportView.Draw(aCanvas: TCanvas); @@ -5200,11 +5276,14 @@ begin inherited Destroy; end; -procedure TfrPictureView.Assign(From: TfrView); +procedure TfrPictureView.Assign(Source: TPersistent); begin - inherited Assign(From); - Picture.Assign(TfrPictureView(From).Picture); - FSharedName := TFrPictureView(From).SharedName; + inherited Assign(Source); + if Source is TfrPictureView then + begin + Picture.Assign(TfrPictureView(Source).Picture); + FSharedName := TFrPictureView(Source).SharedName; + end; end; procedure TfrPictureView.Draw(aCanvas: TCanvas); @@ -6728,13 +6807,14 @@ begin CurReport.DoBeginBand(Self); frInterpretator.DoScript(Script); - if Parent.RowsLayout and IsDataBand then begin - + if Parent.RowsLayout and IsDataBand then + begin if Visible then begin if Objects.Count > 0 then begin - if not (Typ in [btPageFooter, btOverlay, btNone]) then begin + if not (Typ in [btPageFooter, btOverlay, btNone]) then + begin if Parent.Skip then exit else @@ -6742,7 +6822,8 @@ begin end; EOFReached := True; // only masterdata band supported in RowsLayout columns report - if typ=btMasterData then begin + if typ=btMasterData then + begin DoDraw; Parent.NextColumn(Self); end; @@ -6750,13 +6831,11 @@ begin Result := True; end; end; - - end else begin - + end + else + begin if Parent.RowsLayout and (typ<>btColumnHeader) then - Parent.StartRowsLayoutNonDataBand(Self) - else // new page was requested in script if ForceNewPage then @@ -6821,13 +6900,10 @@ begin // if in rows layout, reset starting column after non-data band if Parent.RowsLayout and (typ<>btColumnHeader) then Parent.StartColumn; - end; CurReport.DoEndBand(Self); - Parent.LastBandType := typ; - {$IFDEF debugLr} DebugLnExit('TFrBand.Draw END %s y=%d PageNo=%d EOFReached=',[dbgsname(self),y, PageNo]); {$endif} @@ -7001,7 +7077,8 @@ end; procedure TfrPage.Delete(Index: Integer); begin - TfrView(Objects[Index]).Free; + if not (doChildComponent in TfrView(Objects[Index]).FDesignOptions) then + TfrView(Objects[Index]).Free; Objects.Delete(Index); end; @@ -7156,12 +7233,17 @@ begin for i := 0 to Objects.Count - 1 do begin bt :=TfrView(Objects[i]); - t := frCreateObject(bt.Typ, bt.ClassName, Self); - t.Assign(bt); - t.StreamMode := smPrinting; - RTObjects.Add(t); - if (t.Flags and flWantHook) <> 0 then - HookList.Add(t); + if not (doChildComponent in bt.DesignOptions) then + begin + t := frCreateObject(bt.Typ, bt.ClassName, nil); + t.Assign(bt); + t.StreamMode := smPrinting; + T.OwnerPage:=Self; + RTObjects.Add(t); + + if (t.Flags and flWantHook) <> 0 then + HookList.Add(t); + end; end; for i := 0 to RTObjects.Count - 1 do // select all objects exclude bands @@ -7455,6 +7537,7 @@ begin t.FField := Value.Field; end; end; + T.PrepareObject; end; {$ifdef DebugLR} DebugLnExit('TfrPage.PrepareObjects DONE'); @@ -7598,7 +7681,7 @@ begin if (PageNo <> 0) or ((Bands[btPageFooter].Flags and flBandOnFirstPage) <> 0) then while PageNo < MasterReport.EMFPages.Count do begin - if not (Append and WasPF) then + if not (AppendPage and WasPF) then begin if CurReport <> nil then CurReport.DoEndPage(PageNo); @@ -7629,7 +7712,7 @@ begin DrawPageFooters; CurBottomY := BottomMargin; MasterReport.EMFPages.Add(Self); - Append := False; + AppendPage := False; {$IFDEF DebugLR} DebugLn('---- Start of new page ----'); {$ENDIF} @@ -8036,17 +8119,17 @@ begin {$ENDIF} if Mode = pmNormal then begin - if Append then + if AppendPage then begin if PrevY = PrevBottomY then begin - Append := False; + AppendPage := False; WasPF := False; PageNo := MasterReport.EMFPages.Count; end; end; - if Append and WasPF then + if AppendPage and WasPF then CurBottomY := PrevBottomY else CurBottomY := BottomMargin; @@ -8056,7 +8139,7 @@ begin {$IFDEF DebugLR} DebugLn('XAdjust=%d CurBottomY=%d PrevY=%d',[XAdjust,CurBottomY,PrevY]); {$ENDIF} - if not Append then + if not AppendPage then begin MasterReport.EMFPages.Add(Self); CurY := TopMargin; @@ -8319,8 +8402,9 @@ var procedure AddObject(ot: Byte; clname: String); begin Stream.Read(b, 1); - Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b])); - t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]); + t :=frCreateObject(ot, clname, Pages[b]); +{ Pages[b].Objects.Add(frCreateObject(ot, clname, Pages[b])); + t :=TfrView(Pages[b].Objects.Items[Pages[b].Objects.Count - 1]);} end; begin @@ -8388,8 +8472,9 @@ var t: TfrView; procedure AddObject(aPage: TFrPage; ot: Byte; clname: String); begin - aPage.Objects.Add(frCreateObject(ot, clname, aPage)); - t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]); +{ aPage.Objects.Add(frCreateObject(ot, clname, aPage)); + t :=TfrView(aPage.Objects.Items[aPage.Objects.Count - 1]);} + t:=frCreateObject(ot, clname, aPage); end; var i,j,aCount,oCount: Integer; @@ -8464,12 +8549,15 @@ begin for j := 0 to Pages[i].Objects.Count - 1 do // then adding objects begin t :=TfrView(Pages[i].Objects[j]); - b := Byte(t.Typ); - Stream.Write(b, 1); - if t.Typ = gtAddIn then - frWriteString(Stream, t.ClassName); - Stream.Write(i, 1); - t.SaveToStream(Stream); + if not (doChildComponent in T.FDesignOptions) then + begin + b := Byte(t.Typ); + Stream.Write(b, 1); + if t.Typ = gtAddIn then + frWriteString(Stream, t.ClassName); + Stream.Write(i, 1); + t.SaveToStream(Stream); + end; end; end; b := $FE; @@ -8487,7 +8575,7 @@ end; procedure TfrPages.SavetoXML(XML: TLrXMLConfig; const Path: String); var - i, j: Integer; + i, j, C: Integer; t: TfrView; aPath,aSubPath: String; begin @@ -8499,13 +8587,18 @@ begin begin aPath := Path+'Page'+IntToStr(i+1)+'/'; Pages[i].SaveToXML(XML, aPath); - XML.SetValue(aPath+'ObjectCount/Value'{%H-}, Pages[i].Objects.count); + C:=0; for j:=0 to Pages[i].Objects.count - 1 do begin - aSubPath := aPath + 'Object'+IntTostr(j+1)+'/'; T := TfrView(Pages[i].Objects[j]); - T.SaveToXML(XML, aSubPath); + if not (doChildComponent in T.FDesignOptions) then + begin + aSubPath := aPath + 'Object'+IntTostr(C + 1)+'/'; + T.SaveToXML(XML, aSubPath); + Inc(C); + end; end; + XML.SetValue(aPath+'ObjectCount/Value'{%H-}, C); end; Parent.FVal.WriteBinaryDataToXML(XML, Path+'FVal/'); XML.SetValue(Path+'ParentVars/Value',Parent.Variables.Text); @@ -8679,7 +8772,7 @@ begin t.StreamMode := smPrinting; t.LoadFromStream(Stream); t.StreamMode := smDesigning; - Page.Objects.Add(t); +// Page.Objects.Add(t); end; end; end; @@ -8699,14 +8792,19 @@ begin for i := 0 to Page.Objects.Count - 1 do begin t :=TfrView(Page.Objects[i]); - t.StreamMode := smPrinting; - Stream.Write(t.Typ, 1); - if t.Typ = gtAddIn then - frWriteString(Stream, t.ClassName); - t.Memo1.Assign(t.Memo); - t.SaveToStream(Stream); + if not (doChildComponent in T.DesignOptions) then + begin + t.StreamMode := smPrinting; + Stream.Write(t.Typ, 1); + if t.Typ = gtAddIn then + frWriteString(Stream, t.ClassName); + t.Memo1.Assign(t.Memo); + t.SaveToStream(Stream); + end; end; end; + + P^.pgOr:=P^.Page.Orientation; end; procedure TfrEMFPages.Insert(Index: Integer; APage: TfrPage); @@ -9217,6 +9315,8 @@ var i: Integer; begin inherited Create(AOwner); + FRebuildPrinter:=false; + if not FRInitialized then begin FRInitialized := True; @@ -9464,9 +9564,7 @@ begin st.free; end; -function TfrReport.FormatValue(V: Variant; - AFormat: Integer; - const AFormatStr: String): String; +function TfrReport.FormatValue(V: Variant; AFormat: Integer; const AFormatStr: String): String; var f1, f2: Integer; c: Char; @@ -9541,20 +9639,6 @@ begin DecimalSeparator := c; end; -{ -function TfrReport.GetLRTitle: String; -begin - if csDesigning in ComponentState then - Result:=fDefaultTitle - else - begin - if fTitle<>'' then - Result:=fTitle - else - Result:=fDefaultTitle; - end; -end; -} procedure TfrReport.GetVariableValue(const s: String; var aValue: Variant); var Value: TfrValue; @@ -10313,7 +10397,6 @@ begin {$IFDEF DebugLR} DebugLnEnter('TfrReport.PrepareReport INIT'); {$ENDIF} - AggrBand:= nil; DocMode := dmPrinting; CurDate := Date; @@ -10352,7 +10435,7 @@ var begin Result := True; Terminated := False; - Append := False; + AppendPage := False; DisableDrawing := False; FinalPass := True; FirstTime := True; @@ -10635,6 +10718,7 @@ begin begin if Pages[i] is TfrPageReport then begin + //FCurPage := Pages[i]; CurPage := Pages[i]; if CurPage.Skip or (not CurPage.Visible) then Continue; @@ -10648,14 +10732,14 @@ begin debugLn('p3'); {$ENDIF} - Append := False; + AppendPage := False; if ((i = Pages.Count - 1) and CompositeMode and (not b or Dataset.Eof)) or ((i <> Pages.Count - 1) and Pages[i + 1].PrintToPrevPage) then begin Dec(PageNo); - Append := True; + AppendPage := True; end; - if not Append then + if not AppendPage then begin PageNo := MasterReport.EMFPages.Count; InternalOnProgress(PageNo); @@ -11069,7 +11153,7 @@ begin frDesigner.Create(nil){%H-}; frDesigner.PreparedReportEditor:=true; Stream := TMemoryStream.Create; - SaveToStream(Stream); + SaveToXMLStream(Stream); //**! Pages.Clear; EMFPages.ObjectsToPage(PageIndex); p := EMFPages[PageIndex]; @@ -11084,7 +11168,7 @@ begin finally Pages.FPages.Clear; Stream.Position := 0; - LoadFromStream(Stream); + LoadFromXMLStream(Stream); /// Stream.Free; frDesigner.Free; frDesigner := Designer; @@ -11510,7 +11594,7 @@ begin frDataManager.AfterParamsDialog; if FinalPass then Doc.DoEndDoc; - Append := CompositeMode; + AppendPage := CompositeMode; CompositeMode := False; if Terminated then break; end; @@ -12318,6 +12402,11 @@ begin // end; +procedure TfrObject.AfterCreate; +begin + +end; + function TfrObject.ExecMetod(const AName: String; p1, p2, p3: Variant; var Val: Variant): boolean; begin @@ -12455,6 +12544,9 @@ begin fMemo:=TfrMemoStrings.Create; fScript:=TfrScriptStrings.Create; FDesignOptions:=[]; + + if Assigned(OwnerPage) then + OwnerPage.Objects.Add(Self); end; destructor TfrObject.Destroy; @@ -12465,16 +12557,26 @@ begin inherited Destroy; end; -procedure TfrObject.Assign(From: TfrView); +procedure TfrObject.AssignTo(Dest: TPersistent); begin - x := From.x; - y := From.y; - dx := From.dx; - dy := From.dy; + // +end; - Memo.Assign(From.Memo); - Script.Assign(From.Script); - Visible:=From.Visible; +procedure TfrObject.Assign(Source: TPersistent); +begin + inherited Assign(Source); + + if Source is TfrObject then + begin + x := TfrObject(Source).x; + y := TfrObject(Source).y; + dx := TfrObject(Source).dx; + dy := TfrObject(Source).dy; + + Memo.Assign(TfrObject(Source).Memo); + Script.Assign(TfrObject(Source).Script); + Visible:=TfrObject(Source).Visible; + end; end; procedure TfrObject.BeginUpdate; @@ -12655,7 +12757,6 @@ begin end; FForm.Name:=S; - // UpdateControlPosition; for i:=0 to Objects.Count - 1 do begin @@ -12823,3 +12924,4 @@ finalization end. + diff --git a/components/lazreport/source/lr_crossarray.pas b/components/lazreport/source/lr_crossarray.pas new file mode 100644 index 0000000000..6c6456d7db --- /dev/null +++ b/components/lazreport/source/lr_crossarray.pas @@ -0,0 +1,325 @@ +{ LazReport cross-tab control + + Copyright (C) 2014 alexs alexs75.at.yandex.ru + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version with the following modification: + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules,and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms + and conditions of the license of that module. An independent module is a + module which is not derived from or based on this library. If you modify + this library, you may extend this exception to your version of the library, + but you are not obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +unit lr_CrossArray; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, DB; + +type + TExItem = class + FCelCol:string; + FValue:Variant; + Bookmark:TBookMark; + end; + +type + + { TExRow } + + TExRow = class(TFPList) + private + FRow:string; + function GetCell(ACol: Variant): Variant; + function GetCellData(ACol: Variant): TExItem; + procedure SetCell(ACol: Variant; AValue: Variant); + function Find(ACol:Variant; out Index: Integer): Boolean; + public + destructor Destroy; override; + property Cell[ACol:Variant]:Variant read GetCell write SetCell; default; + property CellData[ACol:Variant]:TExItem read GetCellData; + end; + + { TExVarArray } + + TExVarArray = class + private + FColCount: integer; + FRowCount: integer; + FRows:TFPList; + FColHeader:TStringList; + FRowHeader:TStringList; + function GetCell(ACol, ARow: variant): variant; + function GetCellData(ACol, ARow : variant): TExItem; + function GetColCount: integer; + function GetColHeader(ACol: integer): string; + function GetRowCount: integer; + function GetRowHeader(ARow: integer): string; + procedure SetCell(ACol, ARow: variant; AValue: variant); + function Find(ARow:variant; out Index: Integer): Boolean; + public + constructor Create; + destructor Destroy; override; + procedure Clear; + property Cell[ACol, ARow : variant]:variant read GetCell write SetCell;default; + property CellData[ACol, ARow : variant]:TExItem read GetCellData; + property ColCount:integer read GetColCount; + property RowCount:integer read GetRowCount; + property ColHeader[ACol:integer]:string read GetColHeader; + property RowHeader[ARow:integer]:string read GetRowHeader; + end; + +implementation +uses math, variants; + +{ TExRow } + +function TExRow.GetCell(ACol: Variant): Variant; +var + i:integer; +begin + if Find(ACol, i) then + Result:=TExItem(Items[i]).FValue + else + Result:=null; +end; + +function TExRow.GetCellData(ACol: Variant): TExItem; +var + i:integer; +begin + if Find(ACol, i) then + Result:=TExItem(Items[i]) + else + Result:=nil; +end; + +procedure TExRow.SetCell(ACol: Variant; AValue: Variant); +var + R:TExItem; + i:integer; +begin + if Find(ACol, i) then + TExItem(Items[i]).FValue:=AValue + else + begin + R:=TExItem.Create; + R.FValue:=AValue; + R.FCelCol:=ACol; + Insert(i, R); + end; +end; + +function TExRow.Find(ACol: Variant; out Index: Integer): Boolean; +var + I,L,R,Dir: Integer; + S1, S2:string; +begin + Result := false; + // Use binary search. + L := 0; + R := Count - 1; + while L<=R do + begin + I := (L+R) div 2; +// Dir := CompareStr(TExItem(Items[i]).FCelCol, VarToStr(ACol)); + S1:=TExItem(Items[i]).FCelCol; + S2:=VarToStr(ACol); + Dir := CompareStr(S1, S2); + if Dir < 0 then + L := I+1 + else + begin + R := I-1; + if Dir = 0 then + begin + Result := true; + L := I; + end; + end; + end; + Index := L; +end; + +destructor TExRow.Destroy; +var + i: Integer; +begin + for i:=0 to Count-1 do + begin + TExItem(Items[i]).Free; + Items[i]:=nil; + end; + inherited Destroy; +end; + +{ TExVarArray } + +function TExVarArray.GetCell(ACol, ARow: variant): variant; +var + i:integer; +begin + if Find(ARow, i) then + Result:=TExRow(FRows[i]).Cell[ACol] + else + Result:=null; +end; + +function TExVarArray.GetCellData(ACol, ARow: variant): TExItem; +var + i:integer; +begin + if Find(ARow, i) then + Result:=TExRow(FRows[i]).CellData[ACol] + else + Result:=nil; +end; + +function TExVarArray.GetColCount: integer; +begin + Result:=FColHeader.Count; +end; + +function TExVarArray.GetColHeader(ACol: integer): string; +begin + if (ACol>=0) and (ACol<FColHeader.Count) then + Result:=FColHeader[ACol] + else + Result:=''; +end; + +function TExVarArray.GetRowCount: integer; +begin + Result:=FRowHeader.Count; +end; + +function TExVarArray.GetRowHeader(ARow: integer): string; +begin + if (ARow>=0) and (ARow<FRowHeader.Count) then + Result:=FRowHeader[ARow] + else + Result:=''; +end; + +procedure TExVarArray.SetCell(ACol, ARow: variant; AValue: variant); +var + R:TExRow; + i:integer; +begin + if Find(ARow, i) then + R:=TExRow(FRows[i]) + else + begin + R:=TExRow.Create; + R.FRow:=ARow; + FRows.Insert(i, R); + end; + R.Cell[ACol]:=AValue; + FRowCount:=Max(FRowCount, FRows.Count); + FColCount:=Max(FColCount, R.Count); + + i:=FColHeader.IndexOf(VarToStr(ACol)); + if i<0 then + FColHeader.Add(VarToStr(ACol)); + + i:=FRowHeader.IndexOf(VarToStr(ARow)); + if i<0 then + FRowHeader.Add(VarToStr(ARow)); + +end; + +function TExVarArray.Find(ARow: variant; out Index: Integer): Boolean; +var + I,L,R,Dir: Integer; + S1, S2:string; +begin + Result := false; + // Use binary search. + L := 0; + R := FRows.Count - 1; + S2:=VarToStr(ARow); + while L<=R do + begin + I := (L+R) div 2; +// Dir := CompareStr(TExRow(FRows[i]).FRow, VarToStr(ARow)); + S1:=TExRow(FRows[i]).FRow; + Dir := CompareStr(S1, S2); + if Dir < 0 then + L := I+1 + else + begin + R := I-1; + if Dir = 0 then + begin + Result := true; + L := I; + end; + end; + end; + Index := L; +end; + + +constructor TExVarArray.Create; +begin + inherited Create; + FRows:=TFPList.Create; + FColHeader:=TStringList.Create; + FColHeader.Sorted:=true; + FRowHeader:=TStringList.Create; + FRowHeader.Sorted:=true; +end; + +destructor TExVarArray.Destroy; +var + i: Integer; +begin + for i:=0 to FRows.Count - 1 do + begin + TExRow(FRows.Items[i]).Free; + FRows.Items[i]:=nil; + end; + FRows.Free; + FreeAndNil(FColHeader); + FreeAndNil(FRowHeader); + inherited Destroy; +end; + +procedure TExVarArray.Clear; +var + i: Integer; +begin + FColHeader.Clear; + FRowHeader.Clear; + + for i:=0 to FRows.Count - 1 do + begin + TExRow(FRows.Items[i]).Free; + FRows.Items[i]:=nil; + end; + FRows.Clear; +end; + +end. + diff --git a/components/lazreport/source/lr_crosstab.pas b/components/lazreport/source/lr_crosstab.pas new file mode 100644 index 0000000000..6c12ae6cdb --- /dev/null +++ b/components/lazreport/source/lr_crosstab.pas @@ -0,0 +1,1090 @@ +{ LazReport cross-tab control + + Copyright (C) 2014 alexs alexs75.at.yandex.ru + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version with the following modification: + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules,and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms + and conditions of the license of that module. An independent module is a + module which is not derived from or based on this library. If you modify + this library, you may extend this exception to your version of the library, + but you are not obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +unit lr_CrossTab; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LR_Class, Graphics, LR_DSet, lr_CrossArray, DB; + +const + CrossFuncCount = 6; + CrossFuncList : array [0..CrossFuncCount - 1] of string = + ('NONE', 'SUM', 'MIN', 'MAX', 'AVG', 'COUNT'); +type + TlrCrossObject = class(TComponent) + + end; + +type + { TlrCrossDesignView } + + TlrCrossDesignView = class(TfrCustomMemoView) + public + constructor Create(AOwnerPage:TfrPage); override; + destructor Destroy; override; + published + property Cursor; + property DetailReport; + property Font; + property Alignment; + property Layout; + property Angle; + property WordBreak; + property WordWrap; +// property AutoSize; +// property HideDuplicates; + property HideZeroValues; + property FillColor; + property Memo; + property Script; + property Frames; + property FrameColor; + property FrameStyle; + property FrameWidth; + property Format; + property FormatStr; +// property Restrictions; + property OnClick; + property OnMouseEnter; + property OnMouseLeave; + end; + + { TlrCrossDesignDataView } + + TlrCrossDesignDataView = class(TlrCrossDesignView) + private + FAlternativeColor: TColor; + public + constructor Create(AOwnerPage:TfrPage); override; + procedure Assign(Source: TPersistent); override; + procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; + procedure SavetoXML(XML: TLrXMLConfig; const Path: String); override; + published + property AlternativeColor:TColor read FAlternativeColor write FAlternativeColor default clNone; //AlternativeFillColor + end; + + { TlrCrossView } + + TlrCrossView = class(TfrStretcheable) + private + FExVarArray:TExVarArray; + FRowTotalArray : TExRow; + FColTotalArray : TExRow; + FShowTotalCHCell: Boolean; + FShowTotalRHCell: Boolean; + FTotal : Variant; + FData:TDataSet; + + FCellFields: TStrings; + FColumnFields: TStrings; + FRowFields: TStrings; + FDataSetName: string; + FShowColumnHeader: Boolean; + FShowColumnTotal: Boolean; + FShowCorner: Boolean; + FShowGrandTotal: Boolean; + FShowRowHeader: Boolean; + FShowRowTotal: Boolean; + FShowTitle: Boolean; + TextHeight: Integer; + LineSpacing: Integer; + + FDataCell:TlrCrossDesignDataView; + FRowTitleCell:TlrCrossDesignView; + FRowTotalCell:TlrCrossDesignView; + FColTitleCell:TlrCrossDesignView; + FColTotalCell:TlrCrossDesignView; + FGrandTotalCell:TlrCrossDesignView; + + FTotalCHCell:TlrCrossDesignView; + FTotalRHCell:TlrCrossDesignView; + + FBandDataRowRT : TfrBandView; + FBandCrossRowRT : TfrBandView; + + procedure InitCrossData; + procedure DoneCrossData; + procedure CreateDesignObjects; + procedure SetCellFields(AValue: TStrings); + procedure SetColTitleCell(AValue: TlrCrossDesignView); + procedure SetColTotalCell(AValue: TlrCrossDesignView); + procedure SetColumnFields(AValue: TStrings); + procedure SetDataCell(AValue: TlrCrossDesignDataView); + procedure SetGrandTotalCell(AValue: TlrCrossDesignView); + procedure SetRowFields(AValue: TStrings); + + procedure OnPrintColumn(ColNo: Integer; var AWidth: Integer); + procedure OnEnterRect(AMemo: TStringList; AView: TfrView); + procedure SetRowTitleCell(AValue: TlrCrossDesignView); + procedure SetRowTotalCell(AValue: TlrCrossDesignView); + procedure SetTotalCHCell(AValue: TlrCrossDesignView); + procedure SetTotalRHCell(AValue: TlrCrossDesignView); + protected + function CalcHeight: Integer; override; + function MinHeight: Integer; override; + function RemainHeight: Integer; override; + procedure SetName(const AValue: string); override; + procedure PrepareObject; override; + procedure AfterCreate;override; + public + constructor Create(AOwnerPage:TfrPage);override; + destructor Destroy; override; + + procedure Print(Stream: TStream); override; + procedure Draw(aCanvas: TCanvas); override; + + procedure Assign(Source: TPersistent); override; + procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; + procedure SavetoXML(XML: TLrXMLConfig; const Path: String); override; + function ColCount:integer; + function RowCount:integer; + + published + property ShowColumnHeader: Boolean read FShowColumnHeader write FShowColumnHeader default True; + property ShowColumnTotal: Boolean read FShowColumnTotal write FShowColumnTotal default True; + property ShowCorner: Boolean read FShowCorner write FShowCorner default True; + property ShowRowHeader: Boolean read FShowRowHeader write FShowRowHeader default True; + property ShowRowTotal: Boolean read FShowRowTotal write FShowRowTotal default True; + property ShowTitle: Boolean read FShowTitle write FShowTitle default True; + property ShowGrandTotal: Boolean read FShowGrandTotal write FShowGrandTotal default True; + property ShowTotalCHCell: Boolean read FShowTotalCHCell write FShowTotalCHCell default True; + property ShowTotalRHCell: Boolean read FShowTotalRHCell write FShowTotalRHCell default True; + + property DataCell:TlrCrossDesignDataView read FDataCell write SetDataCell; + property RowTitleCell:TlrCrossDesignView read FRowTitleCell write SetRowTitleCell; + property RowTotalCell:TlrCrossDesignView read FRowTotalCell write SetRowTotalCell; + property ColTitleCell:TlrCrossDesignView read FColTitleCell write SetColTitleCell; + property ColTotalCell:TlrCrossDesignView read FColTotalCell write SetColTotalCell; + property GrandTotalCell:TlrCrossDesignView read FGrandTotalCell write SetGrandTotalCell; + property TotalCHCell:TlrCrossDesignView read FTotalCHCell write SetTotalCHCell; + property TotalRHCell:TlrCrossDesignView read FTotalRHCell write SetTotalRHCell; + + property Restrictions; + property FillColor; + property DataSet:string read FDataSetName write FDataSetName; + property CellFields:TStrings read FCellFields write SetCellFields; + property ColumnFields:TStrings read FColumnFields write SetColumnFields; + property RowFields:TStrings read FRowFields write SetRowFields; + end; + +const + NumericFieldTypes = [ftSmallint, ftInteger, ftWord, ftFloat, ftCurrency, + ftBCD, ftAutoInc, ftLargeint]; + +implementation +uses lr_CrossTabEditor, LR_Utils, strutils, variants, Math; + +{$R *.res} + +var + lrBMPCrossView : TBitMap = nil; + +{ TlrCrossView } + +type + + { TlrCrossPage } + + TlrCrossPage = class(TfrPage) + constructor Create(AOwnerPage:TfrPage); override; + end; + + +{ TlrCrossDesignDataView } + +constructor TlrCrossDesignDataView.Create(AOwnerPage: TfrPage); +begin + inherited Create(AOwnerPage); + FAlternativeColor:=clNone; +end; + +procedure TlrCrossDesignDataView.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TlrCrossDesignDataView then + FAlternativeColor:=TlrCrossDesignDataView(Source).FAlternativeColor; +end; + +procedure TlrCrossDesignDataView.LoadFromXML(XML: TLrXMLConfig; + const Path: String); +begin + inherited LoadFromXML(XML, Path); + FAlternativeColor := StringToColor(XML.GetValue(Path+'AlternativeColor/Value', 'clNone')); +end; + +procedure TlrCrossDesignDataView.SavetoXML(XML: TLrXMLConfig; const Path: String + ); +begin + inherited SavetoXML(XML, Path); + XML.SetValue(Path+'AlternativeColor/Value', ColorToString(FAlternativeColor)); +end; + +{ TlrCrossDesignView } + +constructor TlrCrossDesignView.Create(AOwnerPage: TfrPage); +begin + inherited Create(AOwnerPage); + FDesignOptions:=FDesignOptions + [doUndoDisable, doChildComponent]; + Restrictions:=Restrictions + [lrrDontSize, lrrDontMove, lrrDontDelete]; +// Frames:=[frbLeft, frbTop, frbRight, frbBottom]; + FrameStyle:=frsSolid; +end; + +destructor TlrCrossDesignView.Destroy; +begin + if Assigned(OwnerPage) then + OwnerPage.Objects.Remove(Self); + inherited Destroy; +end; + +{ TlrCrossPage } + +constructor TlrCrossPage.Create(AOwnerPage: TfrPage); +begin + inherited Create(AOwnerPage); + PrintToPrevPage:=true; +end; + +function TlrCrossView.ColCount: integer; +begin + if Assigned(FExVarArray) then + Result:=FExVarArray.ColCount + else + Result:=0; +end; + +function TlrCrossView.RowCount: integer; +begin + if Assigned(FExVarArray) then + Result:=FExVarArray.RowCount + else + Result:=0; +end; + +procedure TlrCrossView.InitCrossData; +var + FD:TField; + FR:TField; + FC:TField; + S, SR, SC: String; + P:TBookMark; + V, VT:Variant; + FCalcTotal:boolean; + j: Integer; + i: Integer; + FuncNo:integer; + S1: String; + ExItem:TExItem; + +function DoFunc(V1, V2:Variant):Variant; +begin + case FuncNo of + 1:Result:=V1 + V2; //SUM + 2:if V1<V2 then Result:=V1 + else Result:=V2; //MIN + 3:if V1>V2 then Result:=V1 + else Result:=V2; //MAX + else + Result:=V2; //NONE + end + //COUNT + //AVG +end; + +begin + DoneCrossData; + FData:=nil; + FD:=nil; + FR:=nil; + FC:=nil; + FuncNo:=1; + + FExVarArray:=TExVarArray.Create; + FRowTotalArray := TExRow.Create; + FColTotalArray := TExRow.Create; + + FData:=frGetDataSet(DataSet); + if (not Assigned(FData)) or not (FData.Active) then + exit; + + if CellFields.Count>0 then + begin + S:=CellFields[0]; + if Pos('|', S)>0 then + begin + S1:=Copy2SymbDel(S, '|'); + for i:=0 to CrossFuncCount-1 do + if CrossFuncList[i] = S then + begin + FuncNo:=i; + break; + end; + S:=S1; + end; + + FD:=FData.FindField(S); + + end; + + if RowFields.Count>0 then + FR:=FData.FindField(RowFields[0]); + + if ColumnFields.Count>0 then + FC:=FData.FindField(ColumnFields[0]); + + if not (Assigned(FD) and Assigned(FR) and Assigned(FC)) then + exit; + + + FCalcTotal:=FD.DataType in NumericFieldTypes; + + P:=FData.Bookmark; + FData.DisableControls; + try + FData.First; + while not FData.EOF do + begin + if FCalcTotal then + begin + V:=FExVarArray.Cell[FC.DisplayText, FR.DisplayText]; + if V = null then + begin + if FuncNo in [2,3] then + V:=FD.AsFloat + else + V:=0; + end; + FExVarArray.Cell[FC.DisplayText, FR.DisplayText]:=DoFunc(V, FD.AsFloat); + end + else + FExVarArray.Cell[FC.DisplayText, FR.DisplayText]:=FD.DisplayText; + + ExItem:=FExVarArray.CellData[FC.DisplayText, FR.DisplayText]; + if Assigned(ExItem) then + ExItem.Bookmark:=FData.Bookmark; + FData.Next; + end; + finally + FData.Bookmark:=P; + FData.EnableControls; + end; + + if FCalcTotal then + begin + FTotal:=0; + for j:=0 to FExVarArray.RowCount - 1 do + begin + SR:=FExVarArray.RowHeader[j]; + + if FuncNo in [2,3] then + VT:=FExVarArray.Cell[FExVarArray.ColHeader[0], SR] + else + VT:=0; + + for i:=0 to FExVarArray.ColCount - 1 do + begin + SC:=FExVarArray.ColHeader[i]; + V:=FExVarArray.Cell[SC, SR]; + if V<>null then + VT:=DoFunc(VT, V); + end; + FRowTotalArray[SR]:=VT; + FTotal:=DoFunc(FTotal, VT); + end; + + for i:=0 to FExVarArray.ColCount - 1 do + begin + SC:=FExVarArray.ColHeader[i]; + + if FuncNo in [2,3] then + VT:=FExVarArray.Cell[SC, FExVarArray.RowHeader[0]] + else + VT:=0; + + for j:=0 to FExVarArray.RowCount - 1 do + begin + SR:=FExVarArray.RowHeader[j]; + V:=FExVarArray.Cell[SC, SR]; + if V<>null then + VT:=DoFunc(VT, V); + end; + FColTotalArray[SC]:=VT; + end; + end; +end; + +procedure TlrCrossView.DoneCrossData; +begin + if Assigned(FExVarArray) then + FreeAndNil(FExVarArray); + if Assigned(FRowTotalArray) then + FreeAndNil(FRowTotalArray); + + if Assigned(FColTotalArray) then + FreeAndNil(FColTotalArray); + + FTotal:=null; +end; + +procedure TlrCrossView.CreateDesignObjects; + +function DoCreateDesignObjects(AName, ACaption:string; AWidth, AHeight:integer):TlrCrossDesignView; +begin + Result:=TlrCrossDesignView.Create(OwnerPage); + Result.Name:=Name+'_'+AName; + Result.Memo.Text:=ACaption; + Result.dx:=AWidth; + Result.dY:=AHeight; +end; + +begin + if Assigned(FDataCell) then exit; + + FDataCell:=TlrCrossDesignDataView.Create(OwnerPage); + FDataCell.Name:=Name+'_'+'DataCell'; + FDataCell.Memo.Text:='Data'; + FDataCell.dx:=60; + FDataCell.dY:=18; +// DoCreateDesignObjects('DataCell', 'Data', 60, 18); + + FRowTitleCell:=DoCreateDesignObjects('RowTitleCell', 'Row title', 60, 18); + FRowTotalCell:=DoCreateDesignObjects('RowTotalCell', 'Row total', 60, 18); + FColTitleCell:=DoCreateDesignObjects('ColTitleCell', 'Col title', 60, 18); + FColTotalCell:=DoCreateDesignObjects('ColTotalCell', 'Col total', 60, 18); + FGrandTotalCell:=DoCreateDesignObjects('GrandTotalCell', 'Grand total', 60, 18); + + FTotalCHCell:=DoCreateDesignObjects('TotalCHCell', 'Total CH cell', 60, 18); + FTotalRHCell:=DoCreateDesignObjects('TotalRHCell', 'Total RH cell', 60, 18); + + FDataCell.Restrictions:=FDataCell.Restrictions - [lrrDontSize]; + FRowTitleCell.Restrictions:=FDataCell.Restrictions - [lrrDontSize]; + FRowTotalCell.Restrictions:=FDataCell.Restrictions - [lrrDontSize]; +end; + +procedure TlrCrossView.SetCellFields(AValue: TStrings); +begin + FCellFields.Assign(AValue); +end; + +procedure TlrCrossView.SetColTitleCell(AValue: TlrCrossDesignView); +begin + FColTitleCell.Assign(AValue); +end; + +procedure TlrCrossView.SetColTotalCell(AValue: TlrCrossDesignView); +begin + FColTotalCell.Assign(AValue); +end; + +procedure TlrCrossView.SetColumnFields(AValue: TStrings); +begin + FColumnFields.Assign(AValue); +end; + +procedure TlrCrossView.SetDataCell(AValue: TlrCrossDesignDataView); +begin + FDataCell.Assign(AValue); +end; + +procedure TlrCrossView.SetGrandTotalCell(AValue: TlrCrossDesignView); +begin + FGrandTotalCell.Assign(AValue); +end; + +procedure TlrCrossView.SetRowFields(AValue: TStrings); +begin + FRowFields.Assign(AValue); +end; + +procedure TlrCrossView.OnPrintColumn(ColNo: Integer; var AWidth: Integer); +begin +{ +if (ColNo > 0) and (ColNo <= FRxColInfoList.Count) then + Width := TRxColInfo(FRxColInfoList[ColNo-1]).ColWidth; +} + Width := FDataCell.DX; +end; + +procedure TlrCrossView.OnEnterRect(AMemo: TStringList; AView: TfrView); +var + S, SC, SR: String; + ColNo: Integer; + RecNo: Integer; + V : Variant; + ExItem:TExItem; +begin + ColNo:=FBandCrossRowRT.Parent.DataSet.RecNo; + RecNo:=FBandDataRowRT.Parent.DataSet.RecNo; + + S:=AMemo[0]; + if S='-Cell-' then + begin + SC:=FExVarArray.ColHeader[ColNo]; + SR:=FExVarArray.RowHeader[RecNo]; + + V:=FExVarArray.Cell[SC, SR]; + if V<>null then + S:=CurReport.FormatValue(V, AView.Format, AView.FormatStr) + else + S:=''; + + if (DataCell.AlternativeColor <> clNone) and (RecNo mod 2 = 1) then + AView.FillColor:=DataCell.AlternativeColor + else + AView.FillColor:=DataCell.FillColor; + + ExItem:=FExVarArray.CellData[SC, SR]; + if Assigned(ExItem) and Assigned(ExItem.Bookmark) then + FData.Bookmark:=ExItem.Bookmark; + end + else + if S = '-RowTitle-' then + begin + S:=FExVarArray.RowHeader[RecNo]; + end + else + if S = '-ColTitle-' then + begin + S:=FExVarArray.ColHeader[ColNo]; + end + else + if S = '-RowFooter-' then + begin + SR:=FExVarArray.RowHeader[RecNo]; + SC:=FExVarArray.ColHeader[ColNo]; + V:=FRowTotalArray[SR]; + if V<>null then + S:=CurReport.FormatValue(V, AView.Format, AView.FormatStr) + else + S:=''; + end + else + if S= '-ColFooter-' then + begin + SR:=FExVarArray.RowHeader[RecNo]; + SC:=FExVarArray.ColHeader[ColNo]; + V:=FColTotalArray[SC]; + if V<>null then + S:=CurReport.FormatValue(V, AView.Format, AView.FormatStr) + else + S:=''; + end + else + if S = '-GrandTotal-' then + begin + if FTotal<>null then + S:=CurReport.FormatValue(FTotal, AView.Format, AView.FormatStr) + else + S:=''; + end; + + AMemo[0]:= S; +end; + +procedure TlrCrossView.SetRowTitleCell(AValue: TlrCrossDesignView); +begin + FRowTitleCell.Assign(AValue); +end; + +procedure TlrCrossView.SetRowTotalCell(AValue: TlrCrossDesignView); +begin + FRowTotalCell.Assign(AValue); +end; + +procedure TlrCrossView.SetTotalCHCell(AValue: TlrCrossDesignView); +begin + FTotalCHCell.Assign(AValue); +end; + +procedure TlrCrossView.SetTotalRHCell(AValue: TlrCrossDesignView); +begin + FTotalRHCell.Assign(AValue); +end; + +function TlrCrossView.CalcHeight: Integer; +var + RC:integer; +begin + TextHeight:=20; + RC:=RowCount; + if RC>0 then + RC:=RC + Ord(FShowColumnHeader) + Ord(FShowColumnTotal); + Result := RC * TextHeight; +end; + +function TlrCrossView.MinHeight: Integer; +begin + Result := CalcHeight; +end; + +function TlrCrossView.RemainHeight: Integer; +begin + Result := CalcHeight; +end; + +procedure TlrCrossView.SetName(const AValue: string); +begin + inherited SetName(AValue); + if Assigned(FDataCell) then + begin + FDataCell.Name:=Name+'_'+'Data'; + FRowTitleCell.Name:=Name+'_'+'RowTitleCell'; + FRowTotalCell.Name:=Name+'_'+'RowTotalCell'; + FColTitleCell.Name:=Name+'_'+'ColTitleCell'; + FColTotalCell.Name:=Name+'_'+'ColTotalCell'; + FGrandTotalCell.Name:=Name+'_'+'GrandTotalCell'; + TotalCHCell.Name:=Name+'_'+'TotalCHCell'; + TotalRHCell.Name:=Name+'_'+'TotalRHCell'; + end; +end; + +procedure TlrCrossView.PrepareObject; +begin + inherited PrepareObject; + InitCrossData; +end; + +procedure TlrCrossView.AfterCreate; +begin + inherited AfterCreate; +{ TODO : Set default size } +// DX:=10 + 22 * 3; +end; + +procedure TlrCrossView.Print(Stream: TStream); +var + FPage : TlrCrossPage; + + FBandDataHeader : TfrBandView; + FBandDataFooter : TfrBandView; + + FBandCrossHeader : TfrBandView; + FBandCrossFooter : TfrBandView; + + FBandDataRow : TfrBandView; + FBandCrossRow : TfrBandView; + + FYPos : integer; + FView : TfrMemoView; + FXPos: Integer; + FSavePage : TfrPage; + FSavePrintColumnEvent :TPrintColumnEvent; + FSaveEnterRectEvent : TEnterRectEvent; + + XX:integer; + YY: Integer; +begin + Memo1.Assign(Memo); + CurReport.InternalOnEnterRect(Memo1, Self); + frInterpretator.DoScript(Script); + if not Visible then Exit; + + + FSavePage := CurPage; + FSavePrintColumnEvent:=CurReport.OnPrintColumn; + FSaveEnterRectEvent:=CurReport.OnEnterRect; + + CurReport.OnPrintColumn:=@OnPrintColumn; + CurReport.OnEnterRect:=@OnEnterRect; + + BeginDraw(Canvas); + + FYPos:=0; + FXPos:=Self.x; + + + FPage:=TlrCrossPage.Create(nil); + FPage.ChangePaper(OwnerPage.pgSize, OwnerPage.Width, OwnerPage.Height, OwnerPage.Orientation); + + if FShowTotalRHCell then + begin + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FTotalRHCell); + FView.SetBounds(FXPos, FYPos, FTotalRHCell.DX, FTotalRHCell.dy); + end; + + + if FShowColumnHeader then + begin + XX:=FXPos; + if FShowRowHeader then + XX:=XX + FRowTitleCell.DX + 2; + + FBandDataHeader := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandDataHeader.BandType := btMasterHeader; + FBandDataHeader.SetBounds(XX, 0, 1000, 18); + FBandDataHeader.Name:=Name+'_DataHeader'; + FBandDataHeader.Stretched:=true; + + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FColTitleCell); + FView.SetBounds(XX, FYPos, FDataCell.DX, FColTitleCell.dy); + FView.Memo.Text:='-ColTitle-'; + FYPos := FYPos + FColTitleCell.dY + 2; + end; + + if FShowRowHeader or FShowTotalRHCell then + begin + FBandCrossHeader := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandCrossHeader.BandType := btCrossHeader; + FBandCrossHeader.SetBounds(FXPos, 0, FRowTitleCell.DX, 1000); + FBandCrossHeader.Name:=Name+'_CrossHeader'; + + if FShowRowHeader then + begin + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FRowTitleCell); + FView.SetBounds(FXPos, FYPos, FRowTitleCell.DX, FRowTitleCell.dy); + FView.Memo.Text:='-RowTitle-'; + end; + FXPos:=FXPos + FRowTitleCell.DX + 2; + end; + + //Make main data band + FBandDataRow := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandDataRow.BandType := btMasterData; + FBandDataRow.DataSet := IntToStr(RowCount); + FBandDataRow.SetBounds(0, FYPos, 1000, 18); + FBandDataRow.Flags:=FBandDataRow.Flags or flStretched; + FBandDataRow.Name:=Name+'_MasterData'; + + FBandCrossRow := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandCrossRow.BandType := btCrossData; + FBandCrossRow.Dataset := IntToStr(ColCount); + FBandCrossRow.SetBounds(FXPos, 0, FDataCell.DX, 1000); + FBandCrossRow.Name:=Name+'_CrossData'; + + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FDataCell); + FView.SetBounds(FXPos, FYPos, FDataCell.DX, FDataCell.dy); + FView.Memo.Text:='-Cell-'; + + if FShowRowTotal or FShowGrandTotal then + begin + XX:=FXPos + FDataCell.X + FDataCell.DX + 2; + FBandCrossFooter := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandCrossFooter.BandType := btCrossFooter; + FBandCrossFooter.SetBounds(XX, 0, FRowTotalCell.DX, 1000); + FBandCrossFooter.Flags:=FBandDataRow.Flags or flStretched; + FBandCrossFooter.Name:=Name+'_CrossFooter'; + + if FShowRowTotal then + begin + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FRowTotalCell); + FView.SetBounds(XX, FYPos, FRowTotalCell.DX, FRowTotalCell.dy); + FView.Memo.Text:='-RowFooter-'; + end; + end; + + if FShowColumnTotal or FShowGrandTotal then + begin + YY:=FYPos + FDataCell.Y + FDataCell.DY + 2; + FBandDataFooter := TfrBandView(frCreateObject(gtBand, '', FPage)); + FBandDataFooter.BandType := btMasterFooter; + FBandDataFooter.SetBounds(0, YY, 1000, FColTotalCell.DY); + FBandDataFooter.Flags:=FBandDataRow.Flags or flStretched; + FBandDataFooter.Name:=Name+'_BandDataFooter'; + + if FShowColumnTotal then + begin + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FColTotalCell); + FView.SetBounds(FXPos, YY, FColTotalCell.DX, FColTotalCell.DY); + FView.Memo.Text:='-ColFooter-'; + end; + end; + + if FShowTotalCHCell then + begin + XX:=FXPos + FDataCell.X + FDataCell.DX + 2; + YY:=FYPos - FColTitleCell.dy - 2; + + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FTotalCHCell); + FView.SetBounds(XX, YY, FTotalCHCell.DX, FTotalCHCell.DY); + end; + + if FShowGrandTotal then + begin + XX:=FXPos + FDataCell.X + FDataCell.DX + 2; + YY:=FYPos + FDataCell.Y + FDataCell.DY + 2; + + FView := frCreateObject(gtMemo, '', FPage) as TfrMemoView; + FView.Assign(FGrandTotalCell); + FView.SetBounds(XX, YY, FGrandTotalCell.DX, FGrandTotalCell.DY); + FView.Memo.Text:='-GrandTotal-'; + end; + + + FPage.InitReport; + FBandDataRowRT:=TfrBandView(FPage.FindRTObject(FBandDataRow.Name)); + FBandCrossRowRT:=TfrBandView(FPage.FindRTObject(FBandCrossRow.Name)); + + FPage.Mode := pmBuildList; + FPage.FormPage; + + FPage.CurY := FBandDataRow.y + Self.Y; + FPage.CurBottomY := FSavePage.CurBottomY; + FPage.ColCount := 1; + + FPage.PlayFrom := 0; + FPage.PlayRecList; + + FPage.DoneReport; + FPage.Free; + + CurPage:=FSavePage; + CurReport.OnPrintColumn := FSavePrintColumnEvent; + CurReport.OnEnterRect := FSaveEnterRectEvent; + + FBandDataRowRT:=nil; + FBandCrossRowRT:=nil; +end; + +procedure TlrCrossView.Draw(aCanvas: TCanvas); +var + FY:integer; + FX: Integer; +begin + Frames:=[frbLeft, frbTop, frbRight, frbBottom]; + FrameStyle:=frsSolid; + BeginDraw(aCanvas); + CalcGaps; + + ShowBackGround; + ShowFrame; + + FX:=X + 10; + FY:=Y + 10; + + FTotalRHCell.X:=FX; + FTotalRHCell.Y:=FY; + FTotalRHCell.dx:=FRowTitleCell.dx; + + FColTitleCell.X:=FX + FRowTitleCell.dX + 4; + FColTitleCell.y:=FY; + FColTitleCell.DX:=FDataCell.DX; + + FTotalCHCell.x:=FColTitleCell.x + FColTitleCell.DX + 4; + FTotalCHCell.y:=FY; + FTotalCHCell.DX:=FRowTotalCell.DX; + + Inc(FY, FColTitleCell.dy + 4); + + FRowTitleCell.X:=FX; + FRowTitleCell.y:=FY; + + FDataCell.x:=FX + FRowTitleCell.dX + 4; + FDataCell.y:=FY; + + FRowTotalCell.X:=FX + FRowTitleCell.dX + FDataCell.dX + 8; + FRowTotalCell.y:=FY; + + Inc(FY, FColTitleCell.dy + 4); + + FColTotalCell.X:=FX + FRowTitleCell.dX + 4; + FColTotalCell.y:=FY; + FColTotalCell.DX:=FDataCell.DX; + + + FGrandTotalCell.X:=FX + FRowTitleCell.dX + FDataCell.dX + 8; + FGrandTotalCell.y:=FY; + FGrandTotalCell.DX:=FRowTotalCell.DX; + + aCanvas.Draw(X + dx - 20, Y + dy - 20, lrBMPCrossView); +end; + +constructor TlrCrossView.Create(AOwnerPage: TfrPage); +begin + inherited Create(AOwnerPage); + FDesignOptions:= FDesignOptions + [doUndoDisable]; + + Typ := gtAddIn; + BaseName := 'CrossView'; + TextHeight:=0; + LineSpacing:=2; + + FShowColumnHeader:=True; + FShowColumnTotal:=True; + FShowCorner:=True; + FShowRowHeader:=True; + FShowRowTotal:=True; + FShowTitle:=True; + FShowGrandTotal:=true; + FShowTotalCHCell:=true; + FShowTotalRHCell:=true; + + FCellFields:=TStringList.Create; + FColumnFields:=TStringList.Create; + FRowFields:=TStringList.Create; + + CreateDesignObjects; +end; + +destructor TlrCrossView.Destroy; +begin + FreeAndNil(FDataCell); + FreeAndNil(FRowTitleCell); + FreeAndNil(FRowTotalCell); + FreeAndNil(FColTitleCell); + FreeAndNil(FColTotalCell); + FreeAndNil(FGrandTotalCell); + + FreeAndNil(FCellFields); + FreeAndNil(FColumnFields); + FreeAndNil(FRowFields); + DoneCrossData; + inherited Destroy; +end; + +procedure TlrCrossView.Assign(Source: TPersistent); +begin + inherited Assign(Source); + if Source is TlrCrossView then + begin + FShowColumnHeader:=TlrCrossView(Source).FShowColumnHeader; + FShowColumnTotal:=TlrCrossView(Source).FShowColumnTotal; + FShowCorner:=TlrCrossView(Source).FShowCorner; + FShowRowHeader:=TlrCrossView(Source).FShowRowHeader; + FShowRowTotal:=TlrCrossView(Source).FShowRowTotal; + FShowTitle:=TlrCrossView(Source).FShowTitle; + FShowGrandTotal:=TlrCrossView(Source).FShowGrandTotal; + FShowTotalCHCell:=TlrCrossView(Source).FShowTotalCHCell; + FShowTotalRHCell:=TlrCrossView(Source).FShowTotalRHCell; + + FillColor:=TlrCrossView(Source).FillColor; + DataSet:=TlrCrossView(Source).DataSet; + CellFields.Assign(TlrCrossView(Source).CellFields); + ColumnFields.Assign(TlrCrossView(Source).ColumnFields); + RowFields.Assign(TlrCrossView(Source).RowFields); + + + FDataCell.Assign(TlrCrossView(Source).FDataCell); + FRowTitleCell.Assign(TlrCrossView(Source).FRowTitleCell); + FRowTotalCell.Assign(TlrCrossView(Source).FRowTotalCell); + FColTitleCell.Assign(TlrCrossView(Source).FColTitleCell); + FColTotalCell.Assign(TlrCrossView(Source).FColTotalCell); + FGrandTotalCell.Assign(TlrCrossView(Source).FGrandTotalCell); + FTotalCHCell.Assign(TlrCrossView(Source).FTotalCHCell); + FTotalRHCell.Assign(TlrCrossView(Source).FTotalRHCell); + + end; +end; + +procedure TlrCrossView.LoadFromXML(XML: TLrXMLConfig; const Path: String); +begin + inherited LoadFromXML(XML, Path); + FShowColumnHeader:= XML.GetValue(Path+'ShowColumnHeader/Value', true); + FShowColumnTotal:= XML.GetValue(Path+'ShowColumnTotal/Value', true); + FShowCorner:= XML.GetValue(Path+'ShowCorner/Value', true); + FShowRowHeader:= XML.GetValue(Path+'ShowRowHeader/Value', true); + FShowRowTotal:= XML.GetValue(Path+'ShowRowTotal/Value', true); + FShowTitle:= XML.GetValue(Path+'ShowTitle/Value', true); + FShowGrandTotal:= XML.GetValue(Path+'ShowGrandTotal/Value', true); + FShowTotalCHCell:= XML.GetValue(Path+'ShowTotalCHCell/Value', true); + FShowTotalRHCell:= XML.GetValue(Path+'ShowTotalRHCell/Value', true); + + FDataSetName:=XML.GetValue(Path+'DataSetName/Value', ''); + + FCellFields.Text:=XML.GetValue(Path+'CellFields/Value', ''); + FColumnFields.Text:=XML.GetValue(Path+'ColumnFields/Value', ''); + FRowFields.Text:=XML.GetValue(Path+'RowFields/Value', ''); + + FDataCell.LoadFromXML(XML, Path+'DataCell/'); + FRowTitleCell.LoadFromXML(XML, Path+'RowTitleCell/'); + FRowTotalCell.LoadFromXML(XML, Path+'RowTotalCell/'); + FColTitleCell.LoadFromXML(XML, Path+'ColTitleCell/'); + FColTotalCell.LoadFromXML(XML, Path+'ColTotalCell/'); + FGrandTotalCell.LoadFromXML(XML, Path+'GrandTotalCell/'); + + FTotalCHCell.LoadFromXML(XML, Path+'TotalCHCell/'); + FTotalRHCell.LoadFromXML(XML, Path+'TotalRHCell/'); + + FDataCell.DY:=18; + FRowTitleCell.DY:=18; + FRowTotalCell.DY:=18; + FColTitleCell.DY:=18; + FColTotalCell.DY:=18; + FGrandTotalCell.DY:=18; + FTotalCHCell.DY:=18; + FTotalRHCell.DY:=18; +end; + +procedure TlrCrossView.SavetoXML(XML: TLrXMLConfig; const Path: String); +begin + inherited SavetoXML(XML, Path); + XML.SetValue(Path+'ShowColumnHeader/Value', FShowColumnHeader); + XML.SetValue(Path+'ShowColumnTotal/Value', FShowColumnTotal); + XML.SetValue(Path+'ShowCorner/Value'{%H-}, FShowCorner); + XML.SetValue(Path+'ShowRowHeader/Value', FShowRowHeader); + XML.SetValue(Path+'ShowRowTotal/Value', FShowRowTotal); + XML.SetValue(Path+'ShowTitle/Value', FShowTitle); + XML.SetValue(Path+'ShowGrandTotal/Value', FShowGrandTotal); + XML.SetValue(Path+'DataSetName/Value', FDataSetName); + XML.SetValue(Path+'ShowTotalCHCell/Value', FShowTotalCHCell); + XML.SetValue(Path+'ShowTotalRHCell/Value', FShowTotalRHCell); + + XML.SetValue(Path+'CellFields/Value', FCellFields.Text); + XML.SetValue(Path+'ColumnFields/Value', FColumnFields.Text); + XML.SetValue(Path+'RowFields/Value', FRowFields.Text); + + FDataCell.SaveToXML(XML, Path+'DataCell/'); + FRowTitleCell.SaveToXML(XML, Path+'RowTitleCell/'); + FRowTotalCell.SaveToXML(XML, Path+'RowTotalCell/'); + FColTitleCell.SaveToXML(XML, Path+'ColTitleCell/'); + FColTotalCell.SaveToXML(XML, Path+'ColTotalCell/'); + FGrandTotalCell.SaveToXML(XML, Path+'GrandTotalCell/'); + + FTotalCHCell.SaveToXML(XML, Path+'TotalCHCell/'); + FTotalRHCell.SaveToXML(XML, Path+'TotalRHCell/'); +end; + +procedure InitCrossView; +begin + if not assigned(lrBMPCrossView) then + begin + lrBMPCrossView := TBitmap.Create; + lrBMPCrossView.LoadFromResourceName(HInstance, 'lr_crossview'); + frRegisterObject(TlrCrossView, lrBMPCrossView, TlrCrossView.ClassName, nil, otlReportView, nil, @lrCrossTabEditor); + end; +end; + +initialization + InitCrossView; +finalization + if Assigned(lrBMPCrossView) then + FreeAndNil(lrBMPCrossView); +end. + diff --git a/components/lazreport/source/lr_crosstab.res b/components/lazreport/source/lr_crosstab.res new file mode 100644 index 0000000000..4cc2ebef8a Binary files /dev/null and b/components/lazreport/source/lr_crosstab.res differ diff --git a/components/lazreport/source/lr_crosstabeditor.lfm b/components/lazreport/source/lr_crosstabeditor.lfm new file mode 100644 index 0000000000..4f9bc15844 --- /dev/null +++ b/components/lazreport/source/lr_crosstabeditor.lfm @@ -0,0 +1,1153 @@ +object lrCrossTabEditorForm: TlrCrossTabEditorForm + Left = 607 + Height = 549 + Top = 269 + Width = 687 + Caption = 'lrCrossTabEditorForm' + ClientHeight = 549 + ClientWidth = 687 + Position = poScreenCenter + LCLVersion = '1.3' + object GroupBox1: TGroupBox + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = Owner + AnchorSideRight.Control = Label2 + AnchorSideBottom.Control = Label2 + Left = 6 + Height = 262 + Top = 6 + Width = 331 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Caption = 'Source data' + ClientHeight = 242 + ClientWidth = 329 + TabOrder = 0 + object ComboBox1: TComboBox + AnchorSideLeft.Control = GroupBox1 + AnchorSideTop.Control = GroupBox1 + AnchorSideRight.Control = GroupBox1 + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 31 + Top = 6 + Width = 317 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + ItemHeight = 0 + OnChange = ComboBox1Change + Style = csDropDownList + TabOrder = 0 + end + object ListBox1: TListBox + AnchorSideLeft.Control = GroupBox1 + AnchorSideTop.Control = ComboBox1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = GroupBox1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GroupBox1 + AnchorSideBottom.Side = asrBottom + Left = 6 + Height = 193 + Top = 43 + Width = 317 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + DragMode = dmAutomatic + ItemHeight = 0 + OnDragDrop = ListBox2DragDrop + OnDragOver = ListBox2DragOver + ScrollWidth = 315 + TabOrder = 1 + TopIndex = -1 + end + end + object GroupBox2: TGroupBox + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Owner + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Label2 + Left = 350 + Height = 262 + Top = 6 + Width = 331 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Caption = 'Cross-tab structure' + ClientHeight = 242 + ClientWidth = 329 + TabOrder = 1 + object ListBox2: TListBox + AnchorSideLeft.Control = GroupBox2 + AnchorSideTop.Control = Label1 + AnchorSideRight.Control = Label1 + AnchorSideBottom.Control = GroupBox2 + AnchorSideBottom.Side = asrBottom + Left = 6 + Height = 109 + Top = 127 + Width = 152 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + DragMode = dmAutomatic + ItemHeight = 0 + OnDragDrop = ListBox2DragDrop + OnDragOver = ListBox2DragOver + ScrollWidth = 150 + TabOrder = 0 + TopIndex = -1 + end + object ListBox3: TListBox + AnchorSideLeft.Control = Label1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Label1 + AnchorSideRight.Control = GroupBox2 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GroupBox2 + AnchorSideBottom.Side = asrBottom + Left = 171 + Height = 109 + Top = 127 + Width = 152 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + DragMode = dmAutomatic + ItemHeight = 0 + OnDragDrop = ListBox2DragDrop + OnDragOver = ListBox2DragOver + OnMouseDown = ListBox3MouseDown + ScrollWidth = 150 + TabOrder = 1 + TopIndex = -1 + end + object ListBox4: TListBox + AnchorSideLeft.Control = Label1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = GroupBox2 + AnchorSideRight.Control = GroupBox2 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Label1 + Left = 171 + Height = 109 + Top = 6 + Width = 152 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + DragMode = dmAutomatic + ItemHeight = 0 + OnDragDrop = ListBox2DragDrop + OnDragOver = ListBox2DragOver + ScrollWidth = 150 + TabOrder = 2 + TopIndex = -1 + end + object Label1: TLabel + AnchorSideLeft.Control = GroupBox2 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = GroupBox2 + AnchorSideTop.Side = asrCenter + Left = 164 + Height = 1 + Top = 121 + Width = 1 + ParentColor = False + end + object SpeedButton1: TSpeedButton + AnchorSideRight.Control = Label1 + AnchorSideBottom.Control = Label1 + Left = 123 + Height = 27 + Top = 88 + Width = 35 + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Around = 6 + Flat = True + Glyph.Data = { + 5A0B0000424D5A0B00000000000036000000280000001F000000170000000100 + 200000000000240B000064000000640000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FF0000FFFF0000FFFF0000FFFF0000FFFF00 + 00FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00 + 00FFFF0000FFFF0000FFFF0000FFFF0000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF0000FFFF0000FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0 + D4FFC8D0D4FFFF0000FFFF0000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00 + 00FFFF0000FFFF0000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 00FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00 + 00FFFF0000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF000000FF000000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF00000000000000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF000000FF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF000000FF000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000BF0000FFBF00 + 00FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF00 + 00FF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000BF0000FFBF0000FFBF00 + 00FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000BF0000FFBF0000FF808080FF8080 + 80FF808080FF808080FF808080FF808080FFBF0000FFBF0000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000BF0000FFBF0000FFBF0000FFBF0000FFBF00 + 00FFBF0000FFBF0000FFBF0000FFBF0000FFBF0000FF00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000BF0000FFBF0000FFBF0000FFBF0000FFBF0000FFBF00 + 00FFBF0000FFBF0000FFBF0000FFBF0000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000 + } + OnClick = SpeedButton1Click + end + end + object GroupBox3: TGroupBox + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = Label2 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = ButtonPanel1 + Left = 6 + Height = 214 + Top = 281 + Width = 675 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + ClientHeight = 212 + ClientWidth = 673 + TabOrder = 2 + object CheckGroup1: TCheckGroup + AnchorSideTop.Control = GroupBox3 + AnchorSideRight.Control = GroupBox3 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = GroupBox3 + AnchorSideBottom.Side = asrBottom + Left = 508 + Height = 212 + Top = 0 + Width = 165 + Anchors = [akTop, akRight, akBottom] + AutoFill = False + AutoSize = True + ChildSizing.LeftRightSpacing = 6 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 1 + ClientHeight = 210 + ClientWidth = 163 + Items.Strings = ( + 'Show column header' + 'Show column total' + 'Show corner 1' + 'Show row header' + 'Show row total' + 'Show title' + 'Show grand total' + 'Show corner 2' + ) + OnItemClick = CheckGroup1ItemClick + TabOrder = 0 + Data = { + 080000000202020202020202 + } + end + object PaintBox1: TPaintBox + AnchorSideLeft.Control = GroupBox3 + AnchorSideTop.Control = GroupBox3 + AnchorSideRight.Control = CheckGroup1 + AnchorSideBottom.Control = GroupBox3 + AnchorSideBottom.Side = asrBottom + Left = 6 + Height = 200 + Top = 6 + Width = 496 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Color = clWhite + ParentColor = False + OnPaint = PaintBox1Paint + end + object SpeedButton2: TSpeedButton + AnchorSideLeft.Control = PaintBox1 + AnchorSideTop.Control = PaintBox1 + Left = 12 + Height = 23 + Top = 12 + Width = 74 + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Select style' + OnClick = SpeedButton2Click + end + end + object ButtonPanel1: TButtonPanel + Left = 6 + Height = 42 + Top = 501 + Width = 675 + OKButton.Name = 'OKButton' + OKButton.DefaultCaption = True + HelpButton.Name = 'HelpButton' + HelpButton.DefaultCaption = True + CloseButton.Name = 'CloseButton' + CloseButton.DefaultCaption = True + CancelButton.Name = 'CancelButton' + CancelButton.DefaultCaption = True + TabOrder = 3 + ShowButtons = [pbOK, pbCancel, pbHelp] + end + object Label2: TLabel + AnchorSideLeft.Control = Owner + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Owner + AnchorSideTop.Side = asrCenter + Left = 343 + Height = 1 + Top = 274 + Width = 1 + ParentColor = False + end + object PopupMenu1: TPopupMenu + Images = ImageList1 + left = 192 + top = 304 + object MenuItem1: TMenuItem + Caption = 'White' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 0 + OnClick = MenuItem1Click + end + object MenuItem2: TMenuItem + Tag = 1 + Caption = 'Gray' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0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FFD8D8D8FFD8D8D8FFD8D8D8FFD8D8 + D8FFD8D8D8FFD8D8D8FFD8D8D8FFD8D8D8FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 1 + OnClick = MenuItem1Click + end + object MenuItem3: TMenuItem + Tag = 2 + Caption = 'Orange' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF9BEBFFFF9BEBFFFF9BEBFFFF9BEB + FFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEB + FFFF9BEBFFFF9BEBFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF9BEBFFFF9BEB + FFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBFFFF9BEBF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DAFFFF46DA + FFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 2 + OnClick = MenuItem1Click + end + object MenuItem4: TMenuItem + Tag = 3 + Caption = 'Green' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 3 + OnClick = MenuItem1Click + end + object MenuItem5: TMenuItem + Tag = 4 + Caption = 'Green and Orange' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 4 + OnClick = MenuItem1Click + end + object MenuItem6: TMenuItem + Tag = 5 + Caption = 'Blue' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F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0FFF0F0F0FFC0C0 + C0FFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 5 + OnClick = MenuItem1Click + end + object MenuItem7: TMenuItem + Tag = 6 + Caption = 'Blue and White' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFF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BD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 6 + OnClick = MenuItem1Click + end + object MenuItem14: TMenuItem + Tag = 7 + Caption = 'Сyan' + Bitmap.Data = { + 46050000424D4605000000000000360000002800000012000000120000000100 + 2000000000001005000064000000640000000000000000000000F0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0 + F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FF + } + ImageIndex = 7 + OnClick = MenuItem1Click + end + end + object ImageList1: TImageList + Height = 18 + Width = 18 + left = 247 + top = 304 + Bitmap = { + 4C69080000001200000012000000F0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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C0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DAFFFF46DA + FFFF46DAFFFF46DAFFFF46DAFFFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0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C0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A4 + 7BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFF00A47BFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 9EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D29EFF00D2 + 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00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC98FF00CC + 98FF00CC98FF00CC98FF00CC98FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CCFFFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF00CCFFFF00CCFFFF00CCFFFF00CCFFFF00CC + FFFF00CCFFFF00CCFFFF00CC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F0 + F0FFF0F0F0FFF0F0F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD + 97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFFDBD97FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3 + BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFFED3BAFFC0C0C0FFF0F0F0FFF0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FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A + 00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FF4A4A00FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0 + C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0F0FFC0C0C0FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A + 19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FF8A8A19FFC0C0C0FFF0F0F0FFF0F0 + F0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0C0FFC0C0 + C0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0F0FFF0F0 + F0FFF0F0F0FFF0F0F0FFF0F0F0FF + } + end + object PopupMenu2: TPopupMenu + left = 615 + top = 204 + object MenuItem9: TMenuItem + Caption = 'None' + OnClick = MenuItem9Click + end + object MenuItem8: TMenuItem + Tag = 1 + Caption = 'Sum' + OnClick = MenuItem9Click + end + object MenuItem10: TMenuItem + Tag = 2 + Caption = 'Min' + OnClick = MenuItem9Click + end + object MenuItem11: TMenuItem + Tag = 3 + Caption = 'Max' + OnClick = MenuItem9Click + end + object MenuItem12: TMenuItem + Tag = 4 + Caption = 'Average' + Enabled = False + OnClick = MenuItem9Click + end + object MenuItem13: TMenuItem + Tag = 5 + Caption = 'Count' + Enabled = False + OnClick = MenuItem9Click + end + end +end diff --git a/components/lazreport/source/lr_crosstabeditor.pas b/components/lazreport/source/lr_crosstabeditor.pas new file mode 100644 index 0000000000..585cc572bd --- /dev/null +++ b/components/lazreport/source/lr_crosstabeditor.pas @@ -0,0 +1,659 @@ +{ LazReport cross-tab control + + Copyright (C) 2014 alexs alexs75.at.yandex.ru + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version with the following modification: + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules,and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms + and conditions of the license of that module. An independent module is a + module which is not derived from or based on this library. If you modify + this library, you may extend this exception to your version of the library, + but you are not obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +unit lr_CrossTabEditor; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, types, FileUtil, Forms, Controls, Graphics, Dialogs, + StdCtrls, Buttons, ButtonPanel, ExtCtrls, Menus, DB, LR_Class, lr_CrossTab; + +type + TCrossCellType = (cctData, cctColHdr, cctRowHdr, cctColTotal, + cctRowTotal, cctGrandTotal, cctCorner1, cctCorner2); + + TCrossColorStyle = record + DataCell:TColor; + DataCellAlt:TColor; + RowTitleCell:TColor; + RowTotalCell:TColor; + ColTitleCell:TColor; + ColTotalCell:TColor; + GrandTotalCell:TColor; + TotalCHCell:TColor; + TotalRHCell:TColor; + end; + + { TlrCrossTabEditorForm } + + TlrCrossTabEditorForm = class(TForm) + ButtonPanel1: TButtonPanel; + CheckGroup1: TCheckGroup; + ComboBox1: TComboBox; + GroupBox1: TGroupBox; + GroupBox2: TGroupBox; + GroupBox3: TGroupBox; + ImageList1: TImageList; + Label1: TLabel; + Label2: TLabel; + ListBox1: TListBox; + ListBox2: TListBox; + ListBox3: TListBox; + ListBox4: TListBox; + MenuItem1: TMenuItem; + MenuItem10: TMenuItem; + MenuItem11: TMenuItem; + MenuItem12: TMenuItem; + MenuItem13: TMenuItem; + MenuItem14: TMenuItem; + MenuItem2: TMenuItem; + MenuItem3: TMenuItem; + MenuItem4: TMenuItem; + MenuItem5: TMenuItem; + MenuItem6: TMenuItem; + MenuItem7: TMenuItem; + MenuItem8: TMenuItem; + MenuItem9: TMenuItem; + PaintBox1: TPaintBox; + PopupMenu1: TPopupMenu; + PopupMenu2: TPopupMenu; + SpeedButton1: TSpeedButton; + SpeedButton2: TSpeedButton; + procedure CheckGroup1ItemClick(Sender: TObject; Index: integer); + procedure ComboBox1Change(Sender: TObject); + procedure ListBox2DragDrop(Sender, Source: TObject; X, Y: Integer); + procedure ListBox2DragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure ListBox3MouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure MenuItem1Click(Sender: TObject); + procedure MenuItem9Click(Sender: TObject); + procedure PaintBox1Paint(Sender: TObject); + procedure SpeedButton1Click(Sender: TObject); + procedure SpeedButton2Click(Sender: TObject); + private + FCross:TlrCrossView; + FCurStyle:TCrossColorStyle; + procedure FillDataSets; + procedure Localize; + //preview paint + procedure ShowBackGround; + procedure ShowFrame(AView:TfrStretcheable; ARect:TRect; AFillColor:TColor); + + function IsCellShow(ACellType:TCrossCellType):boolean; + procedure UpdateStilesPopup; + public + constructor CreateEditForm(lrObj: TfrView); + procedure SaveData; + end; + + +function lrCrossTabEditor(lrObj: TfrView) : boolean; +implementation +uses LR_Utils, LR_DBRel, PropEdits, strutils; + +const + CT2Ind : array [TCrossCellType] of integer = ( + 0, //cctData + 0, //cctColHdr, + 3, //cctRowHdr, + 1, //cctColTotal, + 4, //cctRowTotal + 6, //cctGrandTotal + 2, //cctCorner1, + 7 //cctCorner2 + ); + + CountStyles = 8; + CrossStyles : array [0..CountStyles - 1] of TCrossColorStyle = + ( + //White + (DataCell:clNone; + DataCellAlt:clNone; + RowTitleCell:clNone; RowTotalCell:clNone; + ColTitleCell:clNone; ColTotalCell:clNone; GrandTotalCell:clNone; + TotalCHCell:clNone; TotalRHCell:clNone), + + //Gray + (DataCell:clInfoBk; + DataCellAlt:clNone; + RowTitleCell:clGray; RowTotalCell:clWhite; + ColTitleCell:clGray; ColTotalCell:clWhite; GrandTotalCell:clGray; + TotalCHCell:clGray; TotalRHCell:clGray), + + //Orange + (DataCell:$9BEBFF; + DataCellAlt:clNone; + RowTitleCell:$46DAFF; RowTotalCell:$46DAFF; + ColTitleCell:$46DAFF; ColTotalCell:$9BEBFF; GrandTotalCell:$9BEBFF; + TotalCHCell:$46DAFF; TotalRHCell:$46DAFF), + + //Green + (DataCell:$00D29E; + DataCellAlt:clNone; + RowTitleCell:$00A47B; RowTotalCell:$00D29E; + ColTitleCell:$00A47B; ColTotalCell:$00D29E; GrandTotalCell:$00D29E; + TotalCHCell:$00A47B; TotalRHCell:$00A47B), + + //Green and Orange + (DataCell:$9BEBFF; + DataCellAlt:clNone; + RowTitleCell:$00A47B; RowTotalCell:$9BEBFF; + ColTitleCell:$00A47B; ColTotalCell:$9BEBFF; GrandTotalCell:$9BEBFF; + TotalCHCell:$00A47B; TotalRHCell:$00A47B), + + //Blue + (DataCell:$FED3BA; + DataCellAlt:clNone; + RowTitleCell:$FDBD97; RowTotalCell:$FED3BA; + ColTitleCell:$FDBD97; ColTotalCell:$FED3BA; GrandTotalCell:$FED3BA; + TotalCHCell:$FDBD97; TotalRHCell:$FDBD97), + + //Blue and White + (DataCell:clWhite; + DataCellAlt:$FDBD97; + RowTitleCell:$FDBD97; RowTotalCell:clWhite; + ColTitleCell:$FDBD97; ColTotalCell:clWhite; GrandTotalCell:clWhite; + TotalCHCell:$FDBD97; TotalRHCell:$FDBD97), + + //Сyan + (DataCell:$E6E6E6; + DataCellAlt:clMoneyGreen; + RowTitleCell:$4A4A00; RowTotalCell:$8A8A19; + ColTitleCell:$4A4A00; ColTotalCell:$8A8A19; GrandTotalCell:$8A8A19; + TotalCHCell:$4A4A00; TotalRHCell:$4A4A00) + + ); + +function lrCrossTabEditor(lrObj: TfrView): boolean; +var + lrCrossTabEditorForm: TlrCrossTabEditorForm; +begin + Result:=false; + lrCrossTabEditorForm:=TlrCrossTabEditorForm.CreateEditForm(lrObj); + if lrCrossTabEditorForm.ShowModal = mrOk then + begin + lrCrossTabEditorForm.SaveData; + Result:=true; + end; + lrCrossTabEditorForm.Free; +end; + +{$R *.lfm} + +type + { TlrCrossViewDataSetProperty } + + TlrCrossViewDataSetProperty = class(TStringProperty) + private + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +{ TlrCrossViewDataSetProperty } + +function TlrCrossViewDataSetProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog, paValueList, paSortList]; +end; + +procedure TlrCrossViewDataSetProperty.Edit; +begin + if (GetComponent(0) is TlrCrossView) then + lrCrossTabEditor(TlrCrossView(GetComponent(0))) +end; + +procedure TlrCrossViewDataSetProperty.GetValues(Proc: TGetStrProc); +var + I: Integer; + Values: TStringList; +var + Lst : TStringList; +begin + Lst := TStringList.Create; + try + if Curreport.DataType = dtDataSet then + frGetComponents(CurReport.Owner, TDataSet, Lst, nil) + else + frGetComponents(CurReport.Owner, TDataSource, Lst, nil); + + for i:=0 to Lst.Count-1 do + Proc(Lst[i]); + finally + Lst.Free; + end; +end; + + { TlrCrossTabEditorForm } + +procedure TlrCrossTabEditorForm.ComboBox1Change(Sender: TObject); +var + DataSet: TfrTDataSet; +begin + ListBox1.Items.Clear; + if ComboBox1.Items.Count>0 then + begin + DataSet := nil; + DataSet := frGetDataSet(ComboBox1.Items[ComboBox1.ItemIndex]); + if Assigned(DataSet) then + begin + try + frGetFieldNames(DataSet, ListBox1.Items); + except + end; + end; + end; +end; + +procedure TlrCrossTabEditorForm.CheckGroup1ItemClick(Sender: TObject; + Index: integer); +begin + PaintBox1.Refresh; +end; + +procedure TlrCrossTabEditorForm.ListBox2DragDrop(Sender, Source: TObject; X, + Y: Integer); +var + LB2: TListBox; + LB1: TListBox; +begin + if (Source is TListBox) and (Sender <> Source) then + begin + LB1:=TListBox(Source); + LB2:=TListBox(Sender); + if (LB1.ItemIndex>-1) and (LB1.Items.Count>LB1.ItemIndex) then + begin + if (LB2 <> ListBox1) then + begin + if LB2 = ListBox3 then + LB2.Items.Add(LB1.Items[LB1.ItemIndex]+'|SUM') + else + LB2.Items.Add(LB1.Items[LB1.ItemIndex]); + end; + if (LB1<>ListBox1) then + LB1.Items.Delete(LB1.ItemIndex); + end; + end; +end; + +procedure TlrCrossTabEditorForm.ListBox2DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + if Source is TListBox then + Accept := (Sender <> Source) and + ( + (TListBox(Sender) = ListBox1) + or + ((TListBox(Sender) = ListBox2) and (ListBox2.Items.Count<1)) //temp fix - not create cross-tab for multiple fields + or + ((TListBox(Sender) = ListBox3) and (ListBox3.Items.Count<1)) //temp fix - not create cross-tab for multiple fields + or + ((TListBox(Sender) = ListBox4) and (ListBox4.Items.Count<1)) //temp fix - not create cross-tab for multiple fields + ) +end; + +procedure TlrCrossTabEditorForm.ListBox3MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + P: TPoint; +begin + if X > ListBox3.Width - ListBox3.Width div 4 then + begin + P:=ListBox3.ClientToScreen(Point(X, Y)); + PopupMenu2.PopUp(P.X, P.Y); + end; +end; + +procedure TlrCrossTabEditorForm.MenuItem1Click(Sender: TObject); +var + T:integer; +begin + T:=TMenuItem(Sender).Tag; + if (T>=0) and (T<CountStyles) then + begin + FCurStyle:=CrossStyles[t]; + PaintBox1.Invalidate; + end; + UpdateStilesPopup; +end; + +procedure TlrCrossTabEditorForm.MenuItem9Click(Sender: TObject); +begin + if ListBox3.Items.Count>0 then + ListBox3.Items[0]:=Copy2Symb(ListBox3.Items[0], '|') + '|' + CrossFuncList[TMenuItem(Sender).Tag]; +end; + +procedure TlrCrossTabEditorForm.PaintBox1Paint(Sender: TObject); +var + X, Y:integer; + YY, DY: Integer; + XX, DX: Integer; +begin + ShowBackGround; + ShowFrame(FCross, Rect(0, 0, PaintBox1.Width - 4, PaintBox1.Height -4), FCross.FillColor); + DX:=90; + DY:=Canvas.TextHeight('Wg'); + + X:=10; + Y:=SpeedButton2.Top + SpeedButton2.Height + 20; + + if IsCellShow(cctCorner2) then + ShowFrame(FCross.TotalRHCell, Rect(X, Y, X + DX, Y + DY), FCurStyle.TotalRHCell); + + if IsCellShow(cctRowHdr) then + begin + if IsCellShow(cctColHdr) then + YY:=Y + DY + else + YY:=Y; + ShowFrame(FCross.RowTitleCell, Rect(X, YY, X + DX, YY + DY), FCurStyle.RowTitleCell); + X := X + DX; + end; + + if IsCellShow(cctCorner1) then + begin + if IsCellShow(cctRowHdr) then + XX:=X + DX + else + XX:= X; + ShowFrame(FCross.TotalCHCell, Rect(XX, Y, XX + DX, Y + DY), FCurStyle.TotalCHCell); + end; + + if IsCellShow(cctColHdr) or IsCellShow(cctCorner1) then + begin + if IsCellShow(cctColHdr) then + ShowFrame(FCross.ColTitleCell, Rect(X, Y, X + DX, Y + DY), FCurStyle.ColTitleCell); + Y:=Y + DY; + end; + + + ShowFrame(FCross.DataCell, Rect(X, Y, X + DX, Y + DY), FCurStyle.DataCell); + + if IsCellShow(cctRowTotal) then + begin + if IsCellShow(cctRowHdr) then + XX:=X + DX + else + XX:=X; + ShowFrame(FCross.RowTotalCell, Rect(XX, Y, XX + DX, Y + DY), FCurStyle.RowTotalCell); + end; + + Y:=Y + DY; + + if IsCellShow(cctColTotal) then + begin + ShowFrame(FCross.ColTotalCell, Rect(X, Y, X + DX, Y + DY), FCurStyle.ColTotalCell); + X:=X + DX; + end; + + if IsCellShow(cctGrandTotal) then + ShowFrame(FCross.GrandTotalCell, Rect(X, Y, X + DX, Y + DY), FCurStyle.GrandTotalCell); +end; + +procedure TlrCrossTabEditorForm.SpeedButton1Click(Sender: TObject); +var + S:string; +begin + S:=ListBox2.Items.Text; + ListBox2.Items.Text:=ListBox4.Items.Text; + ListBox4.Items.Text:=S; +end; + +procedure TlrCrossTabEditorForm.SpeedButton2Click(Sender: TObject); +var + R: types.TPoint; +begin + R:=GroupBox3.ClientToScreen(Point(SpeedButton2.Left, SpeedButton2.Top + SpeedButton2.Height)); + PopupMenu1.PopUp(R.X, R.Y); +end; + +procedure TlrCrossTabEditorForm.FillDataSets; +var + Lst : TStringList; +begin + Lst := TStringList.Create; + try + if Curreport.DataType = dtDataSet then + frGetComponents(CurReport.Owner, TDataSet, Lst, nil) + else + frGetComponents(CurReport.Owner, TDataSource, Lst, nil); + Lst.Sort; + ComboBox1.Items.Assign(Lst); + ComboBox1.Enabled:=(Lst.Count>0); + finally + Lst.Free; + end; +end; + +procedure TlrCrossTabEditorForm.Localize; +begin + Caption:='Cross tab editor'; +end; + +procedure TlrCrossTabEditorForm.ShowBackGround; +var + fp: TColor; +begin + fp := FCross.FillColor; + if (fp = clNone) then + fp := clWhite; + + PaintBox1.Canvas.Brush.Bitmap := nil; + PaintBox1.Canvas.Brush.Style := bsSolid; + PaintBox1.Canvas.Brush.Color := fp; + PaintBox1.Canvas.FillRect(Rect(0,0, Width, Height)) +end; + +procedure TlrCrossTabEditorForm.ShowFrame(AView: TfrStretcheable; ARect: TRect; + AFillColor: TColor); +procedure Line1(x, y, x1, y1: Integer); +var + i, w: Integer; +begin + + if PaintBox1.Canvas.Pen.Style = psSolid then + begin + if AView.FrameStyle<>frsDouble then + begin + PaintBox1.Canvas.MoveTo(x, y); + PaintBox1.Canvas.LineTo(x1, y1); + end + else + begin + if x = x1 then + begin + PaintBox1.Canvas.MoveTo(x - Round(AView.FrameWidth), y); + PaintBox1.Canvas.LineTo(x1 - Round(AView.FrameWidth), y1); + PaintBox1.Canvas.Pen.Color := AView.FillColor; + PaintBox1.Canvas.MoveTo(x, y); + PaintBox1.Canvas.LineTo(x1, y1); + PaintBox1.Canvas.Pen.Color := AView.FrameColor; + PaintBox1.Canvas.MoveTo(x + Round(AView.FrameWidth), y); + PaintBox1.Canvas.LineTo(x1 + Round(AView.FrameWidth), y1); + end + else + begin + PaintBox1.Canvas.MoveTo(x, y - Round(AView.FrameWidth)); + PaintBox1.Canvas.LineTo(x1, y1 - Round(AView.FrameWidth)); + PaintBox1.Canvas.Pen.Color := AView.FillColor; + PaintBox1.Canvas.MoveTo(x, y); + PaintBox1.Canvas.LineTo(x1, y1); + PaintBox1.Canvas.Pen.Color := AView.FrameColor; + PaintBox1.Canvas.MoveTo(x, y + Round(AView.FrameWidth)); + PaintBox1.Canvas.LineTo(x1, y1 + Round(AView.FrameWidth)); + end; + end + end + else + begin + PaintBox1.Canvas.Brush.Color:=AView.FillColor; + w := PaintBox1.Canvas.Pen.Width; + PaintBox1.Canvas.Pen.Width := 1; + if x = x1 then + begin + for i := 0 to w - 1 do + begin + PaintBox1.Canvas.MoveTo(x - w div 2 + i, y); + PaintBox1.Canvas.LineTo(x - w div 2 + i, y1); + end + end + else + begin + for i := 0 to w - 1 do + begin + PaintBox1.Canvas.MoveTo(x, y - w div 2 + i); + PaintBox1.Canvas.LineTo(x1, y - w div 2 + i); + end; + end; + PaintBox1.Canvas.Pen.Width := w; + end; +end; + +begin + if AFillColor<>clNone then + begin + PaintBox1.Canvas.Brush.Bitmap := nil; + PaintBox1.Canvas.Brush.Style := bsSolid; + PaintBox1.Canvas.Brush.Color := AFillColor; + PaintBox1.Canvas.FillRect(ARect) + end; + + if AView.FrameStyle<>frsDouble then + PaintBox1.Canvas.Pen.Style := TPenStyle(AView.FrameStyle); + + if (frbRight in FCross.Frames) then + Line1(ARect.Right, ARect.Top, ARect.Right, ARect.Bottom); + if (frbLeft in FCross.Frames) then + Line1(ARect.Left, ARect.Top, ARect.Left, ARect.Bottom); + if (frbBottom in FCross.Frames) then + Line1(ARect.Left, ARect.Bottom, ARect.Right, ARect.Bottom); + if (frbTop in FCross.Frames) then + Line1(ARect.Left, ARect.Top, ARect.Right, ARect.Top); + + if AView.Memo.Count>0 then + PaintBox1.Canvas.TextRect(ARect, ARect.Left + 2, ARect.Top, AView.Memo[0]); +end; + +function TlrCrossTabEditorForm.IsCellShow(ACellType: TCrossCellType): boolean; +begin + if ACellType = cctData then + Result := true + else + Result:=CheckGroup1.Checked[CT2Ind[ACellType]]; +end; + +procedure TlrCrossTabEditorForm.UpdateStilesPopup; +var + i: Integer; +begin + for i:=0 to CountStyles-1 do + PopupMenu1.Items[i].Checked := + (FCurStyle.DataCell = CrossStyles[i].DataCell) and + (FCurStyle.RowTitleCell = CrossStyles[i].RowTitleCell) and + (FCurStyle.RowTotalCell = CrossStyles[i].RowTotalCell) and + (FCurStyle.ColTitleCell = CrossStyles[i].ColTitleCell) and + (FCurStyle.ColTotalCell = CrossStyles[i].ColTotalCell) and + (FCurStyle.GrandTotalCell = CrossStyles[i].GrandTotalCell) and + (FCurStyle.TotalCHCell = CrossStyles[i].TotalCHCell) and + (FCurStyle.TotalRHCell = CrossStyles[i].TotalRHCell); +end; + +constructor TlrCrossTabEditorForm.CreateEditForm(lrObj: TfrView); +begin + inherited Create(Application); + Localize; + FCross:=TlrCrossView(lrObj); + FillDataSets; + ComboBox1.Text:=FCross.DataSet; + if ComboBox1.ItemIndex>-1 then + ComboBox1Change(nil); + + ListBox2.Items.Assign(FCross.RowFields); + ListBox3.Items.Assign(FCross.CellFields); + ListBox4.Items.Assign(FCross.ColumnFields); + + CheckGroup1.Checked[0]:=FCross.ShowColumnHeader; + CheckGroup1.Checked[1]:=FCross.ShowColumnTotal; + CheckGroup1.Checked[2]:=FCross.ShowTotalCHCell; + CheckGroup1.Checked[7]:=FCross.ShowTotalRHCell; + CheckGroup1.Checked[3]:=FCross.ShowRowHeader; + CheckGroup1.Checked[4]:=FCross.ShowRowTotal; + CheckGroup1.Checked[5]:=FCross.ShowTitle; + CheckGroup1.Checked[6]:=FCross.ShowGrandTotal; + + FCurStyle.DataCell:=FCross.DataCell.FillColor; + FCurStyle.DataCellAlt:=FCross.DataCell.AlternativeColor; + FCurStyle.RowTitleCell:=FCross.RowTitleCell.FillColor; + FCurStyle.RowTotalCell:=FCross.RowTotalCell.FillColor; + FCurStyle.ColTitleCell:=FCross.ColTitleCell.FillColor; + FCurStyle.ColTotalCell:=FCross.ColTotalCell.FillColor; + FCurStyle.GrandTotalCell:=FCross.GrandTotalCell.FillColor; + FCurStyle.TotalCHCell:=FCross.TotalCHCell.FillColor; + FCurStyle.TotalRHCell:=FCross.TotalRHCell.FillColor; + + UpdateStilesPopup; +end; + +procedure TlrCrossTabEditorForm.SaveData; +begin + FCross.DataSet:=ComboBox1.Text; + FCross.RowFields.Assign(ListBox2.Items); + FCross.CellFields.Assign(ListBox3.Items); + FCross.ColumnFields.Assign(ListBox4.Items); + + FCross.ShowColumnHeader := CheckGroup1.Checked[0]; + FCross.ShowColumnTotal := CheckGroup1.Checked[1]; + FCross.ShowTotalCHCell := CheckGroup1.Checked[2]; + FCross.ShowTotalRHCell := CheckGroup1.Checked[7]; + FCross.ShowRowHeader := CheckGroup1.Checked[3]; + FCross.ShowRowTotal := CheckGroup1.Checked[4]; + FCross.ShowTitle := CheckGroup1.Checked[5]; + FCross.ShowGrandTotal := CheckGroup1.Checked[6]; + + FCross.DataCell.FillColor := FCurStyle.DataCell; + FCross.DataCell.AlternativeColor:= FCurStyle.DataCellAlt; + FCross.RowTitleCell.FillColor := FCurStyle.RowTitleCell; + FCross.RowTotalCell.FillColor := FCurStyle.RowTotalCell; + FCross.ColTitleCell.FillColor := FCurStyle.ColTitleCell; + FCross.ColTotalCell.FillColor := FCurStyle.ColTotalCell; + FCross.GrandTotalCell.FillColor := FCurStyle.GrandTotalCell; + FCross.TotalCHCell.FillColor := FCurStyle.TotalCHCell; + FCross.TotalRHCell.FillColor := FCurStyle.TotalRHCell; +end; + +initialization + RegisterPropertyEditor(TypeInfo(String), TlrCrossView, 'DataSet', TlrCrossViewDataSetProperty); +end. + diff --git a/components/lazreport/source/lr_desgn.pas b/components/lazreport/source/lr_desgn.pas index 9486f3bf94..640e2d46eb 100644 --- a/components/lazreport/source/lr_desgn.pas +++ b/components/lazreport/source/lr_desgn.pas @@ -1398,7 +1398,7 @@ begin end; //Show indicator if hightlight it's not empty - if (t is TfrMemoView) and (Trim(TfrmemoView(t).HighlightStr)<>'') then + if (t is TfrCustomMemoView) and (Trim(TfrCustomMemoView(t).HighlightStr)<>'') then FDesigner.ImgIndic.Draw(Canvas, t.x+1, t.y+iy, 1); end; end; @@ -1745,10 +1745,11 @@ var procedure AddObject(ot: Byte); begin - Objects.Add(frCreateObject(ot, '', FDesigner.Page)); - t := TfrView(Objects.Last); - if t is TfrMemoView then - TfrMemoView(t).MonitorFontChanges; +{ Objects.Add(frCreateObject(ot, '', FDesigner.Page)); + t := TfrView(Objects.Last);} + t:=frCreateObject(ot, '', FDesigner.Page); + if t is TfrCustomMemoView then + TfrCustomMemoView(t).MonitorFontChanges; end; procedure CreateSection; @@ -1760,8 +1761,9 @@ var ObjectInserted := frBandTypesForm.ShowModal = mrOk; if ObjectInserted then begin - Objects.Add(TfrBandView.Create(FDesigner.Page)); - t := TfrView(Objects.Last); +{ Objects.Add(TfrBandView.Create(FDesigner.Page)); + t := TfrView(Objects.Last);} + t:=TfrBandView.Create(FDesigner.Page); (t as TfrBandView).BandType := frBandTypesForm.SelectedTyp; s := frGetBandName(frBandTypesForm.SelectedTyp); THackView(t).BaseName := s; @@ -1774,8 +1776,9 @@ var procedure CreateSubReport; begin - Objects.Add(TfrSubReportView.Create(FDesigner.Page)); - t := TfrView(Objects.Last); +{ Objects.Add(TfrSubReportView.Create(FDesigner.Page)); + t := TfrView(Objects.Last);} + t:=TfrSubReportView.Create(FDesigner.Page); (t as TfrSubReportView).SubPage := CurReport.Pages.Count; CurReport.Pages.Add; end; @@ -1846,8 +1849,9 @@ begin if Tag >= gtAddIn then begin k := Tag - gtAddIn; - Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page)); - t := TfrView(Objects.Last); +{ Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page)); + t := TfrView(Objects.Last);} + t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page); end else AddObject(Tag); @@ -1874,8 +1878,9 @@ begin if Tag >= gtAddIn then begin k := Tag - gtAddIn; - Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page)); - t := TfrView(Objects.Last); +{ Objects.Add(frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page)); + t := TfrView(Objects.Last);} + t:=frCreateObject(gtAddIn, frAddIns[k].ClassRef.ClassName, FDesigner.Page); end else AddObject(Tag); @@ -1901,7 +1906,7 @@ begin begin dx := 40; dy := 40; - if t is TfrMemoView then + if t is TfrCustomMemoView then FDesigner.GetDefaultSize(dx, dy); OldRect := Rect(Left, Top, Left + dx, Top + dy); end; @@ -1927,9 +1932,9 @@ begin if t.Typ <> gtBand then t.Frames:=LastFrames; - if t is TfrMemoView then + if t is TfrCustomMemoView then begin - with t as TfrMemoView do + with t as TfrCustomMemoView do begin Font.Name := LastFontName; Font.Size := LastFontSize; @@ -2426,7 +2431,7 @@ begin for i := 0 to Objects.Count - 1 do begin t := TfrView(Objects[i]); - if t.Selected then + if (t.Selected) and not (lrrDontSize in T.Restrictions) then begin if FDesigner.ShapeMode = smAll then AddRgn(hr, t); @@ -2526,6 +2531,9 @@ begin end; t := TfrView(Objects[TopSelected]); + if (lrrDontSize in T.Restrictions) then + exit; + if FDesigner.ShapeMode = smFrame then DrawPage(dmShape) else @@ -2680,7 +2688,10 @@ begin for i := 0 to Objects.Count - 1 do begin t := TfrView(Objects[i]); - if not t.Selected then continue; + if (not t.Selected) or (AResize and (lrrDontSize in T.Restrictions)) or + ((lrrDontMove in T.Restrictions) and not AResize) then + continue; + if FDesigner.ShapeMode = smAll then AddRgn(hr, t); if aResize then @@ -2948,11 +2959,11 @@ begin end; {$ENDIF} - if (SelNum>0) and (FirstSelected is TfrMemoView) then + if (SelNum>0) and (FirstSelected is TfrCustomMemoView) then begin // font of selected memo has preference, select it - LastFontname := TfrMemoView(FirstSelected).Font.Name; - LastFontSize := TfrMemoView(FirstSelected).Font.Size; + LastFontname := TfrCustomMemoView(FirstSelected).Font.Name; + LastFontSize := TfrCustomMemoView(FirstSelected).Font.Size; end else if C2.Items.IndexOf(LastFontName)>=0 then // last font name remains valid, keep it together with lastFontSize @@ -3839,13 +3850,13 @@ end; procedure TfrDesignerForm.CutToClipboard; var i: Integer; - t: TfrView; + T: TfrView; begin ClearClipBoard; for i := 0 to Objects.Count - 1 do begin t := TfrView(Objects[i]); - if t.Selected then + if (t.Selected) and not (lrrDontDelete in T.Restrictions) and not (doChildComponent in T.DesignOptions) then begin ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page)); TfrView(ClipBd.Last).Assign(t); @@ -3854,9 +3865,11 @@ begin for i := Objects.Count - 1 downto 0 do begin t := TfrView(Objects[i]); - if t.Selected then Page.Delete(i); + if t.Selected and not (lrrDontDelete in T.Restrictions) and not (doChildComponent in T.DesignOptions) then + Page.Delete(i); end; SelNum := 0; + PageView.Invalidate; end; procedure TfrDesignerForm.CopyToClipboard; @@ -3868,9 +3881,9 @@ begin for i := 0 to Objects.Count - 1 do begin t := TfrView(Objects[i]); - if t.Selected then + if t.Selected and not (doChildComponent in T.DesignOptions) then begin - ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page)); + ClipBd.Add(frCreateObject(t.Typ, t.ClassName, nil)); TfrView(ClipBd.Last).Assign(t); end; end; @@ -4146,7 +4159,7 @@ begin for i := Objects.Count - 1 downto 0 do begin t := TfrView(Objects[i]); - if t.Selected then + if t.Selected and not (lrrDontDelete in T.Restrictions) then Page.Delete(i); end; SetPageTitles; @@ -4166,10 +4179,11 @@ begin t := TfrView(Objects[TopSelected]); if t.Typ = gtBand then Result := [ssBand] - else if t is TfrMemoView then - Result := [ssMemo] - else - Result := [ssOther]; + else + if t is TfrCustomMemoView then + Result := [ssMemo] + else + Result := [ssOther]; end else if SelNum > 1 then Result := [ssMultiple]; @@ -4183,250 +4197,9 @@ begin ScrollBox1.Autoscroll := False; ScrollBox1.Autoscroll := True; ScrollBox1.VertScrollBar.Range := ScrollBox1.VertScrollBar.Range + 10; - //ScrollBox1.VertScrollBar.Range := ScrollBox1.VertScrollBar.Range + 10; end; {$HINTS OFF} -{ -procedure TfrDesignerForm.InsertDbFields; -var - i, x, y, dx, dy, pdx, adx, tdx, tdy: Integer; - HeaderL, DataL: TFpList; - t, t1: TfrView; - b: TfrBandView; - f: TfrTField; - f1: TFieldDef; - fSize: Integer; - fName: String; - - function FindDataset(DataSet: TfrTDataSet): String; - var - i,j: Integer; - - function EnumComponents(f: TComponent): String; - var - i: Integer; - c: TComponent; - d: TfrDBDataSet; - begin - Result := ''; - for i := 0 to f.ComponentCount - 1 do - begin - c := f.Components[i]; - if c is TfrDBDataSet then - begin - d := c as TfrDBDataSet; - if d.GetDataSet = DataSet then - begin - if d.Owner = CurReport.Owner then - Result := d.Name else - Result := d.Owner.Name + '.' + d.Name; - break; - end; - end; - end; - end; - - begin - Result := ''; - for i := 0 to Screen.FormCount - 1 do - begin - Result := EnumComponents(Screen.Forms[i]); - if Result <> '' then Exit; - end; - - with Screen do - begin - for i := 0 to CustomFormCount - 1 do - with CustomForms[i] do - if (ClassName = 'TDataModuleForm') then - for j := 0 to ComponentCount - 1 do - begin - if (Components[j] is TDataModule) then - Result:=EnumComponents(Components[j]); - if Result <> '' then Exit; - end; - end; - end; -begin - if frInsertFieldsForm=nil then - exit; - - with frInsertFieldsForm do - begin - if (DataSet=nil) or (FieldsL.Items.Count = 0) or (FieldsL.SelCount = 0) then - exit; - - HeaderL := TFpList.Create; - DataL := TFpList.Create; - try - x := Page.LeftMargin; y := Page.TopMargin; - Unselect; - SelNum := 0; - for i := 0 to FieldsL.Items.Count - 1 do - if FieldsL.Selected[i] then - begin - f := TfrTField(DataSet.FindField(FieldsL.Items[i])); - fSize := 0; - if f <> nil then - begin - fSize := f.DisplayWidth; - fName := f.DisplayName; - end - else - begin - f1 := DataSet.FieldDefs[i]; - fSize := f1.Size; - fName := f1.Name; - end; - - if (fSize = 0) or (fSize > 255) then - fSize := 6; - - t := frCreateObject(gtMemo, '', Page); - t.CreateUniqueName; - t.x := x; - t.y := y; - GetDefaultSize(t.dx, t.dy); - with t as TfrMemoView do - begin - Font.Name := LastFontName; - Font.Size := LastFontSize; - if HeaderCB.Checked then - Font.Style := [fsBold]; - MonitorFontChanges; - end; - PageView.Canvas.Font.Assign(TfrMemoView(t).Font); - t.Selected := True; - Inc(SelNum); - if HeaderCB.Checked then - begin - t.Memo.Add(fName); - t.dx := PageView.Canvas.TextWidth(fName + ' ') div GridSize * GridSize; - end - else - begin - t.Memo.Add('[' + DatasetCB.Items[DatasetCB.ItemIndex] + - '."' + FieldsL.Items[i] + '"]'); - t.dx := (fSize * PageView.Canvas.TextWidth('=')) div GridSize * GridSize; - end; - dx := t.dx; - Page.Objects.Add(t); - if HeaderCB.Checked then - HeaderL.Add(t) else - DataL.Add(t); - if HeaderCB.Checked then - begin - t := frCreateObject(gtMemo, '', Page); - t.CreateUniqueName; - t.x := x; - t.y := y; - GetDefaultSize(t.dx, t.dy); - if HorzRB.Checked then - Inc(t.y, 72) else - Inc(t.x, dx + GridSize * 2); - with t as TfrMemoView do - begin - Font.Name := LastFontName; - Font.Size := LastFontSize; - MonitorFontChanges; - end; - t.Selected := True; - Inc(SelNum); - t.Memo.Add('[' + DatasetCB.Items[DatasetCB.ItemIndex] + - '."' + FieldsL.Items[i] + '"]'); - t.dx := (fSize * PageView.Canvas.TextWidth('=')) div GridSize * GridSize; - Page.Objects.Add(t); - DataL.Add(t); - end; - if HorzRB.Checked then - Inc(x, t.dx + GridSize) else - Inc(y, t.dy + GridSize); - - if t is TfrControl then - TfrControl(T).UpdateControlPosition; - end; - - if HorzRB.Checked then - begin - t := TfrView(DataL[DataL.Count - 1]); - adx := t.x + t.dx; - pdx := Page.RightMargin - Page.LeftMargin; - x := Page.LeftMargin; - if adx > pdx then - begin - for i := 0 to DataL.Count - 1 do - begin - t := TfrView(DataL[i]); - t.x := Round((t.x - x) / (adx / pdx)) + x; - t.dx := Round(t.dx / (adx / pdx)); - end; - if HeaderCB.Checked then - for i := 0 to DataL.Count - 1 do - begin - t := TfrView(HeaderL[i]); - t1 := TfrView(DataL[i]); - t.x := Round((t.x - x) / (adx / pdx)) + x; - if t.dx > t1.dx then - t.dx := t1.dx; - end; - end; - end; - - if BandCB.Checked then - begin - if HeaderCB.Checked then - t := TfrView(HeaderL[DataL.Count - 1]) - else - t := TfrView(DataL[DataL.Count - 1]); - dy := t.y + t.dy - Page.TopMargin; - b := frCreateObject(gtBand, '', Page) as TfrBandView; - b.CreateUniqueName; - b.y := Page.TopMargin; - b.dy := dy; - b.Selected := True; - Inc(SelNum); - if not HeaderCB.Checked or not HorzRB.Checked then - begin - Page.Objects.Add(b); - b.BandType := btMasterData; - b.DataSet := FindDataset(DataSet); - end - else - begin - if frCheckBand(btPageHeader) then - begin - Dec(SelNum); - b.Free; - end - else - begin - b.BandType := btPageHeader; - Page.Objects.Add(b); - end; - b := frCreateObject(gtBand, '', Page) as TfrBandView; - b.BandType := btMasterData; - b.DataSet := FindDataset(DataSet); - b.CreateUniqueName; - b.y := Page.TopMargin + 72; - b.dy := dy; - b.Selected := True; - Inc(SelNum); - Page.Objects.Add(b); - end; - end; - SelectionChanged; - SendBandsToDown; - PageView.GetMultipleSelected; - RedrawPage; - AddUndoAction(acInsert); - finally - HeaderL.Free; - DataL.Free; - end; - end; -end; -} {$ifdef sbod} procedure TfrDesignerForm.DrawStatusPanel(const ACanvas: TCanvas; const rect: TRect); @@ -4660,7 +4433,7 @@ begin if CurReport.FindObject(t.Name) <> nil then t.CreateUniqueName; - Objects.Add(t); +// Objects.Add(t); end; procedure TfrDesignerForm.ResetDuplicateCount; @@ -4804,8 +4577,8 @@ begin E1.Text := FloatToStrF(FrameWidth, ffGeneral, 2, 2); frSetGlyph(FillColor, ClB1, 1); frSetGlyph(FrameColor, ClB3, 2); - if t is TfrMemoView then - with t as TfrMemoView do + if t is TfrCustomMemoView then + with t as TfrCustomMemoView do begin frSetGlyph(Font.Color, ClB2, 0); if C2.ItemIndex <> C2.Items.IndexOf(Font.Name) then @@ -4915,8 +4688,8 @@ begin if t.Selected and ((t.Typ <> gtBand) or (b = 16)) then with t do begin - if t is TfrMemoView then - with t as TfrMemoView do + if t is TfrCustomMemoView then + with t as TfrCustomMemoView do case b of 7: if C2.ItemIndex >= 0 then begin @@ -5058,9 +4831,9 @@ end; procedure TfrDesignerForm.HlB1Click(Sender: TObject); var - t: TfrMemoView; + t: TfrCustomMemoView; begin - t := TfrMemoView(Objects[TopSelected]); + t := TfrCustomMemoView(Objects[TopSelected]); frHilightForm := TfrHilightForm.Create(nil); with frHilightForm do begin @@ -5317,8 +5090,8 @@ begin CL:=clNone; if Sender=ClB1 then CL:=t.FillColor; - if (Sender=ClB2) and (t is TfrMemoView) then - CL:=TfrMemoView(t).Font.Color; + if (Sender=ClB2) and (t is TfrCustomMemoView) then + CL:=TfrCustomMemoView(t).Font.Color; if Sender=ClB3 then CL:=t.FrameColor; ColorSelector.Color:=CL; @@ -5455,6 +5228,10 @@ var begin SetCaptureControl(nil); t := TfrView(Objects[TopSelected]); + + if lrrDontModify in T.Restrictions then + exit; + if t.Typ = gtMemo then ShowMemoEditor else @@ -5510,6 +5287,12 @@ begin for i := 0 to frAddInsCount - 1 do if frAddIns[i].ClassRef.ClassName = t.ClassName then begin + if Assigned(frAddIns[i].EditorProc) then + begin + if frAddIns[i].EditorProc(t) then + Modified:=true; + end + else if frAddIns[i].EditorForm <> nil then begin PageView.NPEraseSelection; @@ -5681,7 +5464,7 @@ begin acInsert: p^.ObjID := t.ID; acDelete, acEdit: begin - t1 := frCreateObject(t.Typ, t.ClassName, Page); + t1 := frCreateObject(t.Typ, t.ClassName, nil); t1.Assign(t); t1.ID := t.ID; p^.ObjID := t.ID; @@ -5717,6 +5500,7 @@ var i,j: Integer; t: TfrView; List: TFpList; + F:boolean; procedure AddCurrent; var @@ -5742,7 +5526,13 @@ begin for i := j to Objects.Count - 1 do begin t := TfrView(Objects[i]); - if (not (doUndoDisable in T.DesignOptions)) and ((AUndoAction in [acDuplication, acZOrder]) or t.Selected) then + F:= ((AUndoAction = acDelete) and not (lrrDontDelete in t.Restrictions)) + or + ((AUndoAction = acEdit) and not (lrrDontModify in t.Restrictions)) + or + (not (AUndoAction in [acDelete, acEdit])); + + if (not (doUndoDisable in T.DesignOptions)) and ((AUndoAction in [acDuplication, acZOrder]) or t.Selected) and F then AddCurrent; end; @@ -5894,7 +5684,6 @@ begin t1.Assign(t); if CurReport.FindObject(t1.Name) <> nil then t1.CreateUniqueName; - Objects.Add(t1); end; SelectionChanged; SendBandsToDown; @@ -6175,15 +5964,16 @@ procedure TfrDesignerForm.ScrollBox1DragDrop(Sender, Source: TObject; X, Y: Integer); var Control :TControl; - t : TfrMemoView; + t : TfrCustomMemoView; dx, dy:integer; begin Control:=lrDesignAcceptDrag(Source); if Assigned(lrFieldsList) and ((Control = lrFieldsList.lbFieldsList) or (Control = lrFieldsList.ValList)) then begin - Objects.Add(frCreateObject(gtMemo, '', Page)); - t:=TfrMemoView(Objects.Last); +{ Objects.Add(frCreateObject(gtMemo, '', Page)); + t:=TfrCustomMemoView(Objects.Last);} + t:=frCreateObject(gtMemo, '', Page) as TfrCustomMemoView; if Assigned(t) then begin t.MonitorFontChanges; @@ -6315,7 +6105,7 @@ begin begin t1 := TfrView(Objects[i]); if t1.Selected then - if not (((t is TfrMemoView) and (t1 is TfrMemoView)) or + if not (((t is TfrCustomMemoView) and (t1 is TfrCustomMemoView)) or ((t.Typ <> gtAddIn) and (t.Typ = t1.Typ)) or ((t.Typ = gtAddIn) and (t.ClassName = t1.ClassName))) then begin @@ -7233,8 +7023,8 @@ begin Case Sb.Tag of 5 : t.FillColor:=aColor; {ClB1} - 17 : if (t is TfrMemoView) then {ClB2} - TfrMemoView(t).Font.Color:=aColor; + 17 : if (t is TfrCustomMemoView) then {ClB2} + TfrCustomMemoView(t).Font.Color:=aColor; 19 : t.FrameColor:=aColor; {ClB3} end; end; @@ -7804,12 +7594,12 @@ begin end; type - { TfrMemoViewDetailReportProperty } + { TfrCustomMemoViewDetailReportProperty } - TfrMemoViewDetailReportProperty = class(TStringProperty) + TfrCustomMemoViewDetailReportProperty = class(TStringProperty) private FSaveRep:TfrReport; - FEditView:TfrMemoView; + FEditView:TfrCustomMemoView; FDetailRrep: TlrDetailReport; procedure DoSaveReportEvent(Report: TfrReport; var ReportName: String; SaveAs: Boolean; var Saved: Boolean); @@ -7819,7 +7609,41 @@ type procedure GetValues(Proc: TGetStrProc); override; end; -procedure TfrMemoViewDetailReportProperty.DoSaveReportEvent(Report: TfrReport; + + TfrViewDataFieldProperty = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + end; + +{ TfrPictureViewDataFieldProperty } + +function TfrViewDataFieldProperty.GetAttributes: TPropertyAttributes; +begin + Result := inherited GetAttributes + [paDialog{, paValueList, paSortList}]; +end; + +type + TfrHackView = class(TfrView); + +procedure TfrViewDataFieldProperty.Edit; +begin + if (GetComponent(0) is TfrView) and Assigned(CurReport) then + begin + frFieldsForm := TfrFieldsForm.Create(Application); + try + if frFieldsForm.ShowModal = mrOk then + begin + TfrHackView(GetComponent(0)).DataField:=frFieldsForm.DBField; + frDesigner.Modified:=true; + end; + finally + frFieldsForm.Free; + end; + end; +end; + +procedure TfrCustomMemoViewDetailReportProperty.DoSaveReportEvent(Report: TfrReport; var ReportName: String; SaveAs: Boolean; var Saved: Boolean); begin if Assigned(FDetailRrep) then @@ -7833,12 +7657,12 @@ begin Saved:=false; end; -function TfrMemoViewDetailReportProperty.GetAttributes: TPropertyAttributes; +function TfrCustomMemoViewDetailReportProperty.GetAttributes: TPropertyAttributes; begin Result := inherited GetAttributes + [paDialog, paValueList, paSortList]; end; -procedure TfrMemoViewDetailReportProperty.Edit; +procedure TfrCustomMemoViewDetailReportProperty.Edit; var FSaveDesigner:TfrReportDesigner; FSaveView:TfrView; @@ -7851,9 +7675,9 @@ var ///***DocMode: (dmDesigning, dmPrinting); // current mode begin - if (GetComponent(0) is TfrMemoView) and Assigned(CurReport) then + if (GetComponent(0) is TfrCustomMemoView) and Assigned(CurReport) then begin - FEditView:=GetComponent(0) as TfrMemoView; + FEditView:=GetComponent(0) as TfrCustomMemoView; if FEditView.DetailReport = '' then FEditView.DetailReport:=FEditView.Name + '_DetailReport'; @@ -7922,7 +7746,7 @@ begin end; end; -procedure TfrMemoViewDetailReportProperty.GetValues(Proc: TGetStrProc); +procedure TfrCustomMemoViewDetailReportProperty.GetValues(Proc: TGetStrProc); var I: Integer; Values: TStringList; @@ -8073,7 +7897,7 @@ begin t.x := x; t.y := y; TfrDesignerForm(frDesigner).GetDefaultSize(t.dx, t.dy); - with t as TfrMemoView do + with t as TfrCustomMemoView do begin Font.Name := LastFontName; Font.Size := LastFontSize; @@ -8081,7 +7905,7 @@ begin Font.Style := [fsBold]; MonitorFontChanges; end; - TfrDesignerForm(frDesigner).PageView.Canvas.Font.Assign(TfrMemoView(t).Font); + TfrDesignerForm(frDesigner).PageView.Canvas.Font.Assign(TfrCustomMemoView(t).Font); t.Selected := True; Inc(TfrDesignerForm(frDesigner).SelNum); if HeaderCB.Checked then @@ -8096,7 +7920,7 @@ begin t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize; end; dx := t.dx; - TfrDesignerForm(frDesigner).Page.Objects.Add(t); +// TfrDesignerForm(frDesigner).Page.Objects.Add(t); if HeaderCB.Checked then HeaderL.Add(t) else DataL.Add(t); @@ -8110,7 +7934,7 @@ begin if HorzRB.Checked then Inc(t.y, 72) else Inc(t.x, dx + TfrDesignerForm(frDesigner).GridSize * 2); - with t as TfrMemoView do + with t as TfrCustomMemoView do begin Font.Name := LastFontName; Font.Size := LastFontSize; @@ -8121,7 +7945,7 @@ begin t.Memo.Add('[' + DatasetCB.Items[DatasetCB.ItemIndex] + '."' + FieldsL.Items[i] + '"]'); t.dx := (fSize * TfrDesignerForm(frDesigner).PageView.Canvas.TextWidth('=')) div TfrDesignerForm(frDesigner).GridSize * TfrDesignerForm(frDesigner).GridSize; - TfrDesignerForm(frDesigner).Page.Objects.Add(t); +// TfrDesignerForm(frDesigner).Page.Objects.Add(t); DataL.Add(t); end; if HorzRB.Checked then @@ -8174,7 +7998,7 @@ begin Inc(TfrDesignerForm(frDesigner).SelNum); if not HeaderCB.Checked or not HorzRB.Checked then begin - TfrDesignerForm(frDesigner).Page.Objects.Add(b); +// TfrDesignerForm(frDesigner).Page.Objects.Add(b); b.BandType := btMasterData; b.DataSet := FindDataset(DataSet); end @@ -8188,7 +8012,7 @@ begin else begin b.BandType := btPageHeader; - TfrDesignerForm(frDesigner).Page.Objects.Add(b); +// TfrDesignerForm(frDesigner).Page.Objects.Add(b); end; b := frCreateObject(gtBand, '', TfrDesignerForm(frDesigner).Page) as TfrBandView; b.BandType := btMasterData; @@ -8198,7 +8022,7 @@ begin b.dy := dy; b.Selected := True; Inc(TfrDesignerForm(frDesigner).SelNum); - TfrDesignerForm(frDesigner).Page.Objects.Add(b); +// TfrDesignerForm(frDesigner).Page.Objects.Add(b); end; end; TfrDesignerForm(frDesigner).SelectionChanged; @@ -8241,7 +8065,8 @@ initialization LastAdjust := 0; //** RegRootKey := 'Software\FastReport\' + Application.Title; - RegisterPropertyEditor(TypeInfo(String), TfrMemoView, 'DetailReport', TfrMemoViewDetailReportProperty); + RegisterPropertyEditor(TypeInfo(String), TfrCustomMemoView, 'DetailReport', TfrCustomMemoViewDetailReportProperty); + RegisterPropertyEditor(TypeInfo(String), TfrView, 'DataField', TfrViewDataFieldProperty); FlrInternalTools:=TlrInternalTools.Create; finalization diff --git a/components/lazreport/source/lr_pgrid.pas b/components/lazreport/source/lr_pgrid.pas index 0d9b32badb..50b06716f6 100644 --- a/components/lazreport/source/lr_pgrid.pas +++ b/components/lazreport/source/lr_pgrid.pas @@ -303,13 +303,13 @@ begin b := TfrBandView(frCreateObject(gtBand, '', Page)); b.SetBounds(10, 20, 1000, 25); b.BandType := btReportTitle; - Page.Objects.Add(b); +// Page.Objects.Add(b); v := frCreateObject(gtMemo, '', Page); v.SetBounds(20, 20, Page.PrnInfo.PgW - 40, 25); TfrMemoView(v).Alignment:=taCenter; TfrMemoView(v).Font.Assign(FTitleFont); v.Memo.Add(FCaption); - Page.Objects.Add(v); +// Page.Objects.Add(v); end; // if we have a template we need to be sure that bands on template @@ -323,7 +323,7 @@ begin b.Flags:=b.Flags+flBandRepeatHeader; b.SetBounds(XPos, YPos, 1000, 20); b.Flags:=b.Flags or flStretched; - Page.Objects.Add(b); +// Page.Objects.Add(b); v := frCreateObject(gtMemo, '', Page); v.SetBounds(XPos, YPos, 20, 20); @@ -333,7 +333,7 @@ begin TfrMemoView(v).Frames:=frAllFrames; TfrMemoView(v).Layout:=tlTop; v.Memo.Add('[Header]'); - Page.Objects.Add(v); +// Page.Objects.Add(v); YPos := YPos + 22; @@ -342,13 +342,13 @@ begin b.Dataset := FReportDataSet.Name; b.SetBounds(0, YPos, 1000, 18); b.Flags:=b.Flags or flStretched; - Page.Objects.Add(b); +// Page.Objects.Add(b); b := TfrBandView(frCreateObject(gtBand, '', Page)); b.BandType := btCrossData; b.Dataset := FColumnDataSet.Name; b.SetBounds(XPos, 0, 20, 1000); - Page.Objects.Add(b); +// Page.Objects.Add(b); v := frCreateObject(gtMemo, '', Page); v.SetBounds(XPos, YPos, 20, 18); @@ -357,7 +357,7 @@ begin TfrMemoView(v).Font.Assign(FFont); TfrMemoView(v).Frames:=frAllFrames; TfrMemoView(v).Layout:=tlTop; - Page.Objects.Add(v); +// Page.Objects.Add(v); FDataSet.DisableControls; BM:=FDataSet.GetBookmark; diff --git a/components/lazreport/source/lr_prdlg.lfm b/components/lazreport/source/lr_prdlg.lfm index 12d23af946..fd494cca6e 100644 --- a/components/lazreport/source/lr_prdlg.lfm +++ b/components/lazreport/source/lr_prdlg.lfm @@ -15,9 +15,9 @@ object frPrintForm: TfrPrintForm Position = poScreenCenter LCLVersion = '1.3' object Image1: TImage - Left = 192 + Left = 336 Height = 16 - Top = 64 + Top = 176 Width = 18 AutoSize = True Picture.Data = { @@ -40,9 +40,9 @@ object frPrintForm: TfrPrintForm AnchorSideBottom.Control = E1 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 19 - Top = 87 - Width = 40 + Height = 21 + Top = 90 + Width = 44 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 Caption = 'Copies' @@ -56,14 +56,14 @@ object frPrintForm: TfrPrintForm AnchorSideBottom.Control = Owner AnchorSideBottom.Side = asrBottom Left = 6 - Height = 178 - Top = 112 - Width = 318 + Height = 173 + Top = 117 + Width = 316 Anchors = [akTop, akLeft, akRight, akBottom] BorderSpacing.Around = 6 Caption = 'Page range' - ClientHeight = 158 - ClientWidth = 316 + ClientHeight = 150 + ClientWidth = 312 TabOrder = 0 object Label2: TLabel AnchorSideLeft.Control = GroupBox2 @@ -74,9 +74,9 @@ object frPrintForm: TfrPrintForm AnchorSideBottom.Control = GroupBox2 AnchorSideBottom.Side = asrBottom Left = 6 - Height = 51 + Height = 43 Top = 101 - Width = 304 + Width = 300 Anchors = [akTop, akLeft, akRight, akBottom] AutoSize = False BorderSpacing.Around = 6 @@ -90,7 +90,7 @@ object frPrintForm: TfrPrintForm Left = 6 Height = 23 Top = 6 - Width = 42 + Width = 40 HelpContext = 108 BorderSpacing.Around = 6 Caption = 'All' @@ -105,7 +105,7 @@ object frPrintForm: TfrPrintForm Left = 6 Height = 23 Top = 35 - Width = 103 + Width = 108 HelpContext = 118 BorderSpacing.Around = 6 Caption = 'Current &page' @@ -118,7 +118,7 @@ object frPrintForm: TfrPrintForm Left = 6 Height = 23 Top = 72 - Width = 83 + Width = 86 HelpContext = 124 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 @@ -133,10 +133,10 @@ object frPrintForm: TfrPrintForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = GroupBox2 AnchorSideRight.Side = asrBottom - Left = 95 + Left = 98 Height = 31 Top = 64 - Width = 215 + Width = 208 HelpContext = 133 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 @@ -150,10 +150,10 @@ object frPrintForm: TfrPrintForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom - Left = 330 - Height = 31 - Top = 75 - Width = 54 + Left = 328 + Height = 33 + Top = 80 + Width = 56 HelpContext = 40 Anchors = [akTop, akLeft, akRight] AutoSize = True @@ -169,10 +169,10 @@ object frPrintForm: TfrPrintForm AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom - Left = 330 - Height = 31 - Top = 112 - Width = 54 + Left = 328 + Height = 33 + Top = 119 + Width = 56 HelpContext = 50 Anchors = [akTop, akRight] AutoSize = True @@ -188,24 +188,24 @@ object frPrintForm: TfrPrintForm AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom Left = 6 - Height = 63 + Height = 68 Top = 6 Width = 378 Anchors = [akTop, akLeft, akRight] AutoSize = True BorderSpacing.Around = 6 Caption = 'Printer' - ClientHeight = 43 - ClientWidth = 376 + ClientHeight = 45 + ClientWidth = 374 TabOrder = 3 object PropButton: TButton AnchorSideTop.Control = GroupBox1 AnchorSideRight.Control = GroupBox1 AnchorSideRight.Side = asrBottom - Left = 295 - Height = 31 + Left = 289 + Height = 33 Top = 6 - Width = 75 + Width = 79 HelpContext = 152 Anchors = [akTop, akRight] AutoSize = True @@ -219,9 +219,9 @@ object frPrintForm: TfrPrintForm AnchorSideTop.Control = GroupBox1 AnchorSideRight.Control = PropButton Left = 6 - Height = 31 + Height = 33 Top = 6 - Width = 283 + Width = 277 HelpContext = 142 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 @@ -229,7 +229,8 @@ object frPrintForm: TfrPrintForm OnChange = CB1Click OnClick = CB1Click OnDrawItem = CB1DrawItem - Style = csDropDownList + ReadOnly = True + Style = csOwnerDrawFixed TabOrder = 1 end end @@ -238,9 +239,9 @@ object frPrintForm: TfrPrintForm AnchorSideLeft.Side = asrBottom AnchorSideBottom.Control = E1 AnchorSideBottom.Side = asrBottom - Left = 139 + Left = 143 Height = 23 - Top = 83 + Top = 88 Width = 70 Anchors = [akLeft, akBottom] BorderSpacing.Left = 6 @@ -252,9 +253,9 @@ object frPrintForm: TfrPrintForm AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = GroupBox1 AnchorSideTop.Side = asrBottom - Left = 52 + Left = 56 Height = 31 - Top = 75 + Top = 80 Width = 81 BorderSpacing.Around = 6 TabOrder = 5 diff --git a/components/lazreport/source/lr_prdlg.pas b/components/lazreport/source/lr_prdlg.pas index 656976553d..75225daf19 100644 --- a/components/lazreport/source/lr_prdlg.pas +++ b/components/lazreport/source/lr_prdlg.pas @@ -102,12 +102,13 @@ begin r := ARect; r.Right := r.Left + 18; r.Bottom := r.Top + 16; - OffsetRect(r, 2, 0); + + OffsetRect(r, 2, (ARect.Bottom - ARect.Top) div 2 - 8); + with CB1.Canvas do begin FillRect(ARect); - // todo: implement brushcopy - //BrushCopy(r, Image1.Picture.Bitmap, Rect(0, 0, 18, 16), clOlive); + BrushCopy(r, Image1.Picture.Bitmap, Rect(0, 0, 18, 16), clOlive); TextOut(ARect.Left + 24, ARect.Top + 1, CB1.Items[Index]); end; end; diff --git a/components/lazreport/source/lr_prntr.pas b/components/lazreport/source/lr_prntr.pas index d5c28b6137..fc7a0b61d1 100644 --- a/components/lazreport/source/lr_prntr.pas +++ b/components/lazreport/source/lr_prntr.pas @@ -792,6 +792,7 @@ begin // update paper size in std pt units PaperWidth := round(fPrinter.PaperSize.Width * 72 / fPrinter.XDPI); PaperHeight := round(fPrinter.PaperSize.Height * 72 / fPrinter.YDPI); + Orientation := fPrinter.Orientation; except PaperWidth:=1; PaperHeight:=1; diff --git a/components/lazreport/source/lr_register.pas b/components/lazreport/source/lr_register.pas index 7c79153033..9bb92778dd 100644 --- a/components/lazreport/source/lr_register.pas +++ b/components/lazreport/source/lr_register.pas @@ -22,7 +22,8 @@ uses LR_PGrid, LR_View, - + lr_CrossTab, + ComponentEditors, LazarusPackageIntf; @@ -50,7 +51,8 @@ begin TfrBarCodeObject,TfrRoundRectObject,TfrShapeObject, TfrCheckBoxObject,TfrCompositeReport,TfrUserDataset, TfrTextExport,TfrHTMExport,TfrCSVExport, - TfrPrintGrid,TfrDesigner,TfrPreview]); + TfrPrintGrid,TfrDesigner,TfrPreview, + TlrCrossObject]); RegisterComponentEditor(TfrReport, TfrRepEditor); end; diff --git a/components/lazreport/source/lr_register.res b/components/lazreport/source/lr_register.res index 385d549555..da6b6783a9 100644 Binary files a/components/lazreport/source/lr_register.res and b/components/lazreport/source/lr_register.res differ diff --git a/components/lazreport/source/lr_rrect.pas b/components/lazreport/source/lr_rrect.pas index 082ec2a3d5..b6f085f727 100644 --- a/components/lazreport/source/lr_rrect.pas +++ b/components/lazreport/source/lr_rrect.pas @@ -84,7 +84,7 @@ type function GetCorners: TCornerSet; public constructor Create(AOwnerPage:TfrPage); override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure LoadFromStream(Stream: TStream); override; procedure SaveToStream(Stream: TStream); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; @@ -565,11 +565,12 @@ begin end; end; -procedure TfrRoundRectView.Assign(From: TfrView); +procedure TfrRoundRectView.Assign(Source: TPersistent); begin - inherited Assign(From); - if from is TfrRoundRectView then - fCadre := TfrRoundRectView(From).fCadre + inherited Assign(Source); + + if Source is TfrRoundRectView then + fCadre := TfrRoundRectView(Source).fCadre else begin fCadre.wCurve:=10; diff --git a/components/lazreport/source/lr_shape.pas b/components/lazreport/source/lr_shape.pas index 59afc0292b..9cf7f27bc0 100644 --- a/components/lazreport/source/lr_shape.pas +++ b/components/lazreport/source/lr_shape.pas @@ -43,7 +43,7 @@ type procedure DrawShape(aCanvas : TCanvas); public constructor Create(AOwnerPage:TfrPage); override; - procedure Assign(From: TfrView); override; + procedure Assign(Source: TPersistent); override; procedure Draw(aCanvas: TCanvas); override; procedure LoadFromStream(Stream: TStream); override; procedure SaveToStream(Stream: TStream); override; @@ -56,6 +56,7 @@ type property FrameColor; property FrameStyle; property FrameWidth; + property Restrictions; property ShapeType : TfrShapeType Read fShapeType write fShapeType; end; @@ -127,10 +128,11 @@ begin fShapeType := frstRectangle; end; -procedure TfrShapeView.Assign(From: TfrView); +procedure TfrShapeView.Assign(Source: TPersistent); begin - inherited Assign(From); - ShapeType := TfrShapeView(From).ShapeType; + inherited Assign(Source); + if Source is TfrShapeView then + ShapeType := TfrShapeView(Source).ShapeType; end; procedure TfrShapeView.DrawShape(aCanvas : TCanvas); diff --git a/components/lazreport/source/lr_view.lfm b/components/lazreport/source/lr_view.lfm index ce7d7ec7a4..04aeffbf5f 100644 --- a/components/lazreport/source/lr_view.lfm +++ b/components/lazreport/source/lr_view.lfm @@ -39,18 +39,18 @@ object frPreviewForm: TfrPreviewForm Left = 0 Height = 30 Top = 0 - Width = 687 + Width = 683 Align = alTop BevelInner = bvSpace BevelOuter = bvNone ClientHeight = 30 - ClientWidth = 687 + ClientWidth = 683 FullRepaint = False TabOrder = 0 object ZoomBtn: TBitBtn Tag = 200 Left = 182 - Height = 28 + Height = 24 Top = 1 Width = 76 Align = alLeft @@ -101,7 +101,7 @@ object frPreviewForm: TfrPreviewForm object LoadBtn: TBitBtn Tag = 201 Left = 1 - Height = 28 + Height = 24 Top = 1 Width = 32 Align = alLeft @@ -150,7 +150,7 @@ object frPreviewForm: TfrPreviewForm object SaveBtn: TBitBtn Tag = 202 Left = 33 - Height = 28 + Height = 24 Top = 1 Width = 32 Align = alLeft @@ -199,7 +199,7 @@ object frPreviewForm: TfrPreviewForm object PrintBtn: TBitBtn Tag = 203 Left = 101 - Height = 28 + Height = 24 Top = 1 Width = 28 Align = alLeft @@ -246,8 +246,8 @@ object frPreviewForm: TfrPreviewForm end object ExitBtn: TBitBtn Tag = 205 - Left = 658 - Height = 28 + Left = 650 + Height = 24 Top = 1 Width = 28 Align = alRight @@ -294,7 +294,7 @@ object frPreviewForm: TfrPreviewForm end object frTBSeparator1: TPanel Left = 76 - Height = 28 + Height = 24 Top = 1 Width = 25 Align = alLeft @@ -304,7 +304,7 @@ object frPreviewForm: TfrPreviewForm end object frTBSeparator2: TPanel Left = 129 - Height = 28 + Height = 24 Top = 1 Width = 25 Align = alLeft @@ -314,7 +314,7 @@ object frPreviewForm: TfrPreviewForm end object frTBSeparator3: TPanel Left = 286 - Height = 28 + Height = 24 Top = 1 Width = 25 Align = alLeft @@ -324,7 +324,7 @@ object frPreviewForm: TfrPreviewForm end object PgUp: TSpeedButton Left = 331 - Height = 28 + Height = 24 Top = 1 Width = 20 Align = alLeft @@ -370,7 +370,7 @@ object frPreviewForm: TfrPreviewForm end object PgDown: TSpeedButton Left = 454 - Height = 28 + Height = 24 Top = 1 Width = 20 Align = alLeft @@ -416,7 +416,7 @@ object frPreviewForm: TfrPreviewForm end object LbPanel: TPanel Left = 351 - Height = 28 + Height = 24 Top = 1 Width = 103 Align = alLeft @@ -430,7 +430,7 @@ object frPreviewForm: TfrPreviewForm end object BtPgFirst: TSpeedButton Left = 311 - Height = 28 + Height = 24 Top = 1 Width = 20 Align = alLeft @@ -476,7 +476,7 @@ object frPreviewForm: TfrPreviewForm end object BtPgLast: TSpeedButton Left = 474 - Height = 28 + Height = 24 Top = 1 Width = 20 Align = alLeft @@ -522,7 +522,7 @@ object frPreviewForm: TfrPreviewForm end object BtZoomOut: TBitBtn Left = 154 - Height = 28 + Height = 24 Top = 1 Width = 28 Align = alLeft @@ -569,7 +569,7 @@ object frPreviewForm: TfrPreviewForm end object BtZoomIn: TBitBtn Left = 258 - Height = 28 + Height = 24 Top = 1 Width = 28 Align = alLeft @@ -616,7 +616,7 @@ object frPreviewForm: TfrPreviewForm end object frTBSeparator4: TPanel Left = 494 - Height = 28 + Height = 24 Top = 1 Width = 25 Align = alLeft @@ -626,7 +626,7 @@ object frPreviewForm: TfrPreviewForm end object FindBtn: TBitBtn Left = 519 - Height = 28 + Height = 24 Top = 1 Width = 28 Align = alLeft @@ -672,7 +672,7 @@ object frPreviewForm: TfrPreviewForm end object SpeedButton1: TSpeedButton Left = 65 - Height = 28 + Height = 24 Top = 1 Width = 11 Align = alLeft @@ -726,8 +726,8 @@ object frPreviewForm: TfrPreviewForm object HScrollBar: TScrollBar Left = 2 Height = 13 - Top = 6 - Width = 663 + Top = 2 + Width = 659 Align = alBottom BorderSpacing.Left = 2 BorderSpacing.Right = 16 @@ -752,8 +752,8 @@ object frPreviewForm: TfrPreviewForm FullRepaint = False TabOrder = 2 object VScrollBar: TScrollBar - Left = 6 - Height = 465 + Left = 2 + Height = 461 Top = 0 Width = 13 Align = alRight diff --git a/components/lazreport/source/lr_view.pas b/components/lazreport/source/lr_view.pas index 6ef30affff..f5f25efb0d 100644 --- a/components/lazreport/source/lr_view.pas +++ b/components/lazreport/source/lr_view.pas @@ -817,29 +817,29 @@ begin frPrintForm := TfrPrintForm.Create(nil); frPrintForm.E1.Value:=TfrReport(Doc).DefaultCopies; frPrintForm.cbCollate.Checked:=TfrReport(Doc).DefaultCollate; - with frPrintForm do - begin - if ShowModal = mrOk then +// with frPrintForm do +// begin + if frPrintForm.ShowModal = mrOk then begin - if (Printer.PrinterIndex <> ind) or Prn.UseVirtualPrinter then + if TfrReport(Doc).RebuildPrinter and ((Printer.PrinterIndex <> ind) or Prn.UseVirtualPrinter) then begin if not RebuildReport then exit; end; - if RB1.Checked then + if frPrintForm.RB1.Checked then Pages := '' else - if RB2.Checked then + if frPrintForm.RB2.Checked then Pages := IntToStr(CurPage) else - Pages := E2.Text; + Pages := frPrintForm.E2.Text; TfrReport(Doc).DefaultCollate:=frPrintForm.cbCollate.Checked; - PrintReport(E1.Value); + PrintReport(frPrintForm.E1.Value); end; - Free; - end; + frPrintForm.Free; +// end; {$ENDIF} result := true; end;