diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.ico b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.ico new file mode 100644 index 000000000..0341321b5 Binary files /dev/null and b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.ico differ diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpi b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpi new file mode 100644 index 000000000..d54bfdc70 --- /dev/null +++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpi @@ -0,0 +1,90 @@ + + + + + + + + + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <Icon Value="0"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="1"> + <Mode0 Name="default"/> + </Modes> + </RunParams> + <RequiredPackages Count="5"> + <Item1> + <PackageName Value="lazreport"/> + </Item1> + <Item2> + <PackageName Value="rxdbgrid_print"/> + </Item2> + <Item3> + <PackageName Value="FCL"/> + </Item3> + <Item4> + <PackageName Value="rxnew"/> + </Item4> + <Item5> + <PackageName Value="LCL"/> + </Item5> + </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="4"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + <Item4> + <Name Value="ETTF"/> + </Item4> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpr b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpr new file mode 100644 index 000000000..1e431b5fb --- /dev/null +++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.lpr @@ -0,0 +1,22 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, rxnew, Unit1, + sysutils; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + DefaultFormatSettings.ThousandSeparator:=' '; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.res b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.res new file mode 100644 index 000000000..4133fe048 Binary files /dev/null and b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/project1.res differ diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.lfm b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.lfm new file mode 100644 index 000000000..6c2c81daf --- /dev/null +++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.lfm @@ -0,0 +1,734 @@ +object Form1: TForm1 + Left = 558 + Height = 491 + Top = 225 + Width = 1043 + Caption = 'RxDBGrid print demo' + ClientHeight = 491 + ClientWidth = 1043 + OnClose = FormClose + OnCreate = FormCreate + LCLVersion = '2.1.0.0' + object Panel1: TPanel + Left = 0 + Height = 45 + Top = 446 + Width = 1043 + Align = alBottom + AutoSize = True + ClientHeight = 45 + ClientWidth = 1043 + TabOrder = 0 + object Button1: TButton + AnchorSideLeft.Control = Panel1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = Panel1 + Left = 485 + Height = 31 + Top = 7 + Width = 73 + AutoSize = True + BorderSpacing.Around = 6 + Caption = 'Print grid' + OnClick = Button1Click + TabOrder = 0 + end + object CheckBox1: TCheckBox + AnchorSideLeft.Control = Button1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Panel1 + AnchorSideTop.Side = asrCenter + Left = 564 + Height = 23 + Top = 11 + Width = 106 + Caption = 'Enable tools' + Checked = True + OnChange = CheckBox1Change + State = cbChecked + TabOrder = 1 + end + end + object PageControl1: TPageControl + Left = 0 + Height = 446 + Top = 0 + Width = 1043 + ActivePage = TabSheet1 + Align = alClient + TabIndex = 0 + TabOrder = 1 + object TabSheet1: TTabSheet + Caption = 'Test data' + ClientHeight = 413 + ClientWidth = 1033 + object RxDBGrid1: TRxDBGrid + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = Edit1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = TabSheet1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = TabSheet1 + AnchorSideBottom.Side = asrBottom + Left = 0 + Height = 351 + Top = 62 + Width = 1033 + ColumnDefValues.BlobText = '(данные)' + TitleButtons = True + AutoSort = True + Columns = < + item + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'ID' + Width = 50 + FieldName = 'ID' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footers = <> + end + item + Color = clSkyBlue + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Дата поставки' + Width = 120 + FieldName = 'PDATE' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footers = <> + end + item + Color = clCream + Font.Color = clPurple + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Наименование продукта' + Width = 364 + FieldName = 'NAME' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footer.Alignment = taRightJustify + Footer.Value = 'Итого:' + Footer.ValueType = fvtStaticText + Footers = < + item + Alignment = taRightJustify + Value = 'Итого:' + ValueType = fvtStaticText + end + item + Alignment = taRightJustify + Value = 'Минимум:' + ValueType = fvtStaticText + end + item + Alignment = taRightJustify + Value = 'Максимум:' + ValueType = fvtStaticText + end> + WordWrap = True + end + item + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Сумма' + Width = 100 + FieldName = 'SUM' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footer.Alignment = taRightJustify + Footer.DisplayFormat = '#,##0.00' + Footer.FieldName = 'SUM' + Footer.ValueType = fvtSum + Footers = < + item + Alignment = taRightJustify + DisplayFormat = '#,##0.00' + FieldName = 'SUM' + ValueType = fvtSum + end + item + Alignment = taRightJustify + DisplayFormat = '#,##0.00' + FieldName = 'SUM' + ValueType = fvtMin + end + item + Alignment = taRightJustify + DisplayFormat = '#,##0.00' + FieldName = 'SUM' + ValueType = fvtMax + end> + end + item + Alignment = taCenter + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Статус' + Width = 60 + FieldName = 'FLAG' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footers = <> + ImageList = ImageList1 + KeyList.Strings = ( + '0=0' + '1=1' + '2=2' + '3=3' + ) + end + item + Alignment = taCenter + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Адрес|Страна' + Width = 200 + FieldName = 'Country' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footers = <> + end + item + Title.Alignment = taCenter + Title.Orientation = toHorizontal + Title.Caption = 'Адрес|Город' + Width = 200 + FieldName = 'Sity' + EditButtons = <> + Filter.DropDownRows = 0 + Filter.EmptyValue = '(Нет)' + Filter.NotEmptyValue = '(Не пусто)' + Filter.AllValue = '(All values)' + Filter.EmptyFont.Style = [fsItalic] + Filter.ItemIndex = -1 + Footers = <> + end> + KeyStrokes = < + item + Command = rxgcShowFindDlg + ShortCut = 16454 + Enabled = True + end + item + Command = rxgcShowColumnsDlg + ShortCut = 16471 + Enabled = True + end + item + Command = rxgcShowFilterDlg + ShortCut = 16468 + Enabled = True + end + item + Command = rxgcShowSortDlg + ShortCut = 16467 + Enabled = True + end + item + Command = rxgcShowQuickFilter + ShortCut = 16465 + Enabled = True + end + item + Command = rxgcHideQuickFilter + ShortCut = 16456 + Enabled = True + end + item + Command = rxgcSelectAll + ShortCut = 16449 + Enabled = True + end + item + Command = rxgcDeSelectAll + ShortCut = 16429 + Enabled = True + end + item + Command = rxgcInvertSelection + ShortCut = 16426 + Enabled = True + end + item + Command = rxgcOptimizeColumnsWidth + ShortCut = 16427 + Enabled = True + end + item + Command = rxgcCopyCellValue + ShortCut = 16451 + Enabled = True + end> + FooterOptions.Active = True + FooterOptions.Color = clYellow + FooterOptions.RowCount = 3 + FooterOptions.DrawFullLine = True + SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey] + SearchOptions.FromStart = False + OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowQuickFilter, rdgAllowToolMenu, rdgWordWrap] + FooterColor = clYellow + FooterRowCount = 3 + Anchors = [akTop, akLeft, akRight, akBottom] + Color = clWindow + DrawFullLine = True + FocusColor = clRed + SelectedColor = clHighlight + GridLineStyle = psSolid + DataSource = DataSource1 + Flat = True + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook] + TabOrder = 0 + TitleStyle = tsNative + end + object Panel2: TPanel + Left = 0 + Height = 413 + Top = 0 + Width = 156 + Align = alLeft + AutoSize = True + ClientHeight = 413 + ClientWidth = 156 + TabOrder = 1 + object CheckBox2: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = Panel2 + Left = 7 + Height = 23 + Top = 7 + Width = 92 + BorderSpacing.Around = 6 + Caption = 'Show title' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 0 + end + object CheckBox3: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox2 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 36 + Width = 106 + BorderSpacing.Around = 6 + Caption = 'Show footer' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 1 + end + object CheckBox4: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox3 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 65 + Width = 128 + BorderSpacing.Around = 6 + Caption = 'Show grid color' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 2 + end + object CheckBox5: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox4 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 94 + Width = 142 + BorderSpacing.Around = 6 + Caption = 'Show footer color' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 3 + end + object CheckBox6: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox5 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 123 + Width = 136 + BorderSpacing.Around = 6 + Caption = 'Show report title' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 4 + end + object CheckBox7: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox6 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 152 + Width = 134 + BorderSpacing.Around = 6 + Caption = 'Hide zero values' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 5 + end + object CheckBox8: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox7 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 181 + Width = 110 + BorderSpacing.Around = 6 + Caption = 'Col spanning' + Checked = True + OnChange = CheckBox2Change + State = cbChecked + TabOrder = 6 + end + object CheckBox9: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox8 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 210 + Width = 119 + BorderSpacing.Around = 6 + Caption = 'Show preview' + Checked = True + State = cbChecked + TabOrder = 7 + end + object CheckBox10: TCheckBox + AnchorSideLeft.Control = Panel2 + AnchorSideTop.Control = CheckBox9 + AnchorSideTop.Side = asrBottom + Left = 7 + Height = 23 + Top = 239 + Width = 134 + BorderSpacing.Around = 6 + Caption = 'Modify prepared' + Checked = True + State = cbChecked + TabOrder = 8 + end + end + object Label1: TLabel + AnchorSideLeft.Control = Panel2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = TabSheet1 + Left = 156 + Height = 19 + Top = 0 + Width = 73 + Caption = 'Report title' + ParentColor = False + end + object Edit1: TEdit + AnchorSideLeft.Control = Label1 + AnchorSideTop.Control = Label1 + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = TabSheet1 + AnchorSideRight.Side = asrBottom + Left = 162 + Height = 31 + Top = 25 + Width = 865 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Around = 6 + OnChange = CheckBox2Change + TabOrder = 2 + Text = 'RxDBGrid print demo' + end + end + object TabSheet2: TTabSheet + Caption = 'Debug window' + ClientHeight = 413 + ClientWidth = 1033 + object Memo1: TMemo + Left = 0 + Height = 319 + Top = 0 + Width = 1033 + Align = alClient + Lines.Strings = ( + 'Memo1' + ) + TabOrder = 0 + end + end + end + object RxMemoryData1: TRxMemoryData + FieldDefs = < + item + Name = 'ID' + DataType = ftAutoInc + Precision = -1 + end + item + Name = 'NAME' + DataType = ftString + Precision = -1 + Size = 220 + end + item + Name = 'PDATE' + DataType = ftDate + Precision = -1 + end + item + Name = 'SUM' + DataType = ftCurrency + Precision = 2 + end + item + Name = 'Country' + DataType = ftString + Precision = -1 + Size = 100 + end + item + Name = 'Sity' + DataType = ftString + Precision = -1 + Size = 100 + end + item + Name = 'FLAG' + DataType = ftInteger + end> + PacketRecords = 0 + Left = 136 + Top = 88 + object RxMemoryData1ID: TAutoIncField + FieldKind = fkData + FieldName = 'ID' + Index = 0 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + end + object RxMemoryData1NAME: TStringField + FieldKind = fkData + FieldName = 'NAME' + Index = 1 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + Size = 220 + end + object RxMemoryData1PDATE: TDateField + FieldKind = fkData + FieldName = 'PDATE' + Index = 2 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + DisplayFormat = 'dd.mm.yyyy' + end + object RxMemoryData1SUM: TCurrencyField + FieldKind = fkData + FieldName = 'SUM' + Index = 3 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + Precision = 2 + end + object RxMemoryData1Country: TStringField + FieldKind = fkData + FieldName = 'Country' + Index = 4 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + Size = 100 + end + object RxMemoryData1Sity: TStringField + FieldKind = fkData + FieldName = 'Sity' + Index = 5 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + Size = 100 + end + object RxMemoryData1FLAG: TLongintField + FieldKind = fkData + FieldName = 'FLAG' + Index = 6 + LookupCache = False + ProviderFlags = [pfInUpdate, pfInWhere] + ReadOnly = False + Required = False + end + end + object DataSource1: TDataSource + DataSet = RxMemoryData1 + Left = 104 + Top = 88 + end + object ImageList1: TImageList + Left = 112 + Top = 224 + Bitmap = { + 4C6903000000100000001000000000000000000000FF000000FF000000000000 + 0000000000FF000000FF0000000000000000000000FF000000FF000000000000 + 000000000000000000000000000000000000000000FFFF0000FF000000FF0000 + 00FF800000FFFF0000FF000000FF000000FF800000FFFF0000FF000000FF0000 + 00FF000000FF000000FF000000000000000000000000000000FFFF0000FF8000 + 00FF800000FFFF0000FFFF0000FF800000FF800000FFFF0000FFFF0000FF8000 + 00FF000000FF00000000000000000000000000000000000000FFFF0000FF8000 + 00FF800000FFFF0000FFFF0000FF800000FF800000FFFF0000FFFF0000FF0000 + 00FF000000000000000000000000000000000000000000000000000000FFFF00 + 00FF800000FF800000FFFF0000FFFF0000FF800000FF800000FF000000FF0000 + 0000000000000000000000000000000000000000000000000000000000FFFF00 + 00FF800000FF800000FFFF0000FFFF0000FF000000FF000000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FFFF0000FF800000FF000000FF000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FFFF0000FF000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 000000000000000000000000000000000000000000FF000000FF000000000000 + 0000000000FF000000FF0000000000000000000000FF000000FF000000000000 + 000000000000000000000000000000000000000000FF0000FFFF000000FF0000 + 00FF000080FF0000FFFF000000FF000000FF000080FF0000FFFF000000FF0000 + 00FF000000FF000000FF000000000000000000000000000000FF0000FFFF0000 + 80FF000080FF0000FFFF0000FFFF000080FF000080FF0000FFFF0000FFFF0000 + 80FF000000FF00000000000000000000000000000000000000FF0000FFFF0000 + 80FF000080FF0000FFFF0000FFFF000080FF000080FF0000FFFF0000FFFF0000 + 00FF000000000000000000000000000000000000000000000000000000FF0000 + FFFF000080FF000080FF0000FFFF0000FFFF000080FF000080FF000000FF0000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + FFFF000080FF000080FF0000FFFF0000FFFF000000FF000000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FF0000FFFF000080FF000000FF000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FF0000FFFF000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 000000000000000000000000000000000000000000FF000000FF000000000000 + 0000000000FF000000FF0000000000000000000000FF000000FF000000000000 + 000000000000000000000000000000000000000000FF00FFFFFF000000FF0000 + 00FF008080FF00FFFFFF000000FF000000FF008080FF00FFFFFF000000FF0000 + 00FF000000FF000000FF000000000000000000000000000000FF00FFFFFF0080 + 80FF008080FF00FFFFFF00FFFFFF008080FF008080FF00FFFFFF00FFFFFF0080 + 80FF000000FF00000000000000000000000000000000000000FF00FFFFFF0080 + 80FF008080FF00FFFFFF00FFFFFF008080FF008080FF00FFFFFF00FFFFFF0000 + 00FF000000000000000000000000000000000000000000000000000000FF00FF + FFFF008080FF008080FF00FFFFFF00FFFFFF008080FF008080FF000000FF0000 + 0000000000000000000000000000000000000000000000000000000000FF00FF + FFFF008080FF008080FF00FFFFFF00FFFFFF000000FF000000FF000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FF00FFFFFF008080FF000000FF000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00FF00FFFFFF000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000FF0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000FF0000000000000000000000000000 + 0000000000000000000000000000 + } + end + object RxDBGridPrint1: TRxDBGridPrint + RxDBGrid = RxDBGrid1 + Caption = 'Печать списка' + Options = [rxpoShowTitle, rxpoShowFooter, rxpoShowGridColor, rxpoShowFooterColor, rxpoShowReportTitle] + Left = 208 + Top = 88 + end + object frDesigner1: TfrDesigner + Left = 208 + Top = 144 + end +end diff --git a/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.pas b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.pas new file mode 100644 index 000000000..771534eb1 --- /dev/null +++ b/components/rx/trunk/demos/rxdbgrid/RxDbGridPrint/unit1.pas @@ -0,0 +1,180 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LR_Desgn, rxmemds, rxdbgrid, RxDBGridExportPdf, + RxDBGridPrintGrid, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, + ComCtrls, Spin, db; + +type + + { TForm1 } + + TForm1 = class(TForm) + Button1: TButton; + CheckBox1: TCheckBox; + CheckBox10: TCheckBox; + CheckBox2: TCheckBox; + CheckBox3: TCheckBox; + CheckBox4: TCheckBox; + CheckBox5: TCheckBox; + CheckBox6: TCheckBox; + CheckBox7: TCheckBox; + CheckBox8: TCheckBox; + CheckBox9: TCheckBox; + DataSource1: TDataSource; + Edit1: TEdit; + frDesigner1: TfrDesigner; + ImageList1: TImageList; + Label1: TLabel; + Memo1: TMemo; + PageControl1: TPageControl; + Panel1: TPanel; + Panel2: TPanel; + RxDBGrid1: TRxDBGrid; + RxDBGridPrint1: TRxDBGridPrint; + RxMemoryData1: TRxMemoryData; + RxMemoryData1Country: TStringField; + RxMemoryData1FLAG: TLongintField; + RxMemoryData1ID: TAutoIncField; + RxMemoryData1NAME: TStringField; + RxMemoryData1PDATE: TDateField; + RxMemoryData1Sity: TStringField; + RxMemoryData1SUM: TCurrencyField; + TabSheet1: TTabSheet; + TabSheet2: TTabSheet; + procedure Button1Click(Sender: TObject); + procedure CheckBox1Change(Sender: TObject); + procedure CheckBox2Change(Sender: TObject); + procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); + procedure FormCreate(Sender: TObject); + private + FontDirList: TStrings; + procedure ShowInfo(AText:string; AParams : array of const); + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation +uses fpTTF, LazFileUtils, LR_Class; + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.FormCreate(Sender: TObject); +begin + ProcedureInitDesigner; + + RxDBGridPrint1.ShowSetupForm:=true; + PageControl1.ActivePageIndex:=0; + RxMemoryData1.Open; + RxMemoryData1.AppendRecord([1, 'Строка с длинным текстом 1', now, 100, 'Россия', 'Москва', 0]); + RxMemoryData1.AppendRecord([2, 'Строка с длинным текстом 2', now - 1, 100, 'Россия', 'Ставрополь', 1]); + RxMemoryData1.AppendRecord([3, 'Строка с длинным текстом 3', now - 2, 110, 'Россия', 'Калининград', 2]); + RxMemoryData1.AppendRecord([4, 'Строка с длинным текстом 4', now - 3, 5000, 'Россия', 'Владивасток', 0]); + RxMemoryData1.AppendRecord([5, 'Строка с длинным текстом 5', now - 4, 123.31, 'USA', 'New-York', 0]); + RxMemoryData1.AppendRecord([6, 'Строка с длинным текстом 6', now, 100, 'Россия', 'Москва', 0]); + RxMemoryData1.AppendRecord([7, 'Строка с длинным текстом 7', now - 1, 100, 'Россия', 'Ставрополь', 2]); + RxMemoryData1.AppendRecord([8, 'Строка с длинным текстом 8', now - 2, 110, 'Россия', 'Калининград', 1]); + RxMemoryData1.AppendRecord([9, 'Строка с длинным текстом 9', now - 3, 5000, 'Россия', 'Владивасток', 0]); + RxMemoryData1.AppendRecord([10,'Строка с длинным текстом 10', now - 4, 123.31, 'USA', 'New-York', 3]); + RxMemoryData1.AppendRecord([11,'Строка с длинным текстом 11', now, 100, 'Россия', 'Москва', 2]); + RxMemoryData1.AppendRecord([12,'Строка с длинным текстом 12', now - 1, 100, 'Россия', 'Ставрополь', 1]); + RxMemoryData1.AppendRecord([13,'Строка с длинным текстом 13', now - 2, 110, 'Россия', 'Калининград', 0]); + RxMemoryData1.AppendRecord([14,'Строка с длинным текстом 14', now - 3, 5000, 'Россия', 'Владивасток', 3]); + RxMemoryData1.AppendRecord([15,'Строка с длинным текстом 15', now - 4, 123.31, 'USA', 'New-York', 2]); + RxMemoryData1.AppendRecord([16,'Строка с длинным текстом 16', now, 100, 'Россия', 'Москва', 1]); + RxMemoryData1.AppendRecord([17,'Строка с длинным текстом 17', now - 1, 100, 'Россия', 'Ставрополь', 0]); + RxMemoryData1.AppendRecord([18,'Строка с длинным текстом 18', now - 2, 110, 'Россия', 'Калининград', 3]); + RxMemoryData1.AppendRecord([19,'Строка с длинным текстом 19', now - 3, 5000, 'Россия', 'Владивасток', 2]); + RxMemoryData1.AppendRecord([20,'Строка с длинным текстом 20', now - 4, 123.31, 'USA', 'New-York', 1]); + RxMemoryData1.First; + CheckBox2Change(nil); +end; + + +procedure TForm1.ShowInfo(AText: string; AParams: array of const); +begin + Memo1.Lines.Add(Format(AText, AParams)); +end; + +procedure TForm1.Button1Click(Sender: TObject); +begin + CheckBox2Change(nil); + RxDBGridPrint1.ShowSetupForm:=false; + RxDBGridPrint1.Execute; + RxDBGridPrint1.ShowSetupForm:=true; +end; + +procedure TForm1.CheckBox1Change(Sender: TObject); +begin + RxDBGridPrint1.Enabled:=CheckBox1.Checked; +end; + +procedure TForm1.CheckBox2Change(Sender: TObject); +var + O: TRxDBGridPrintOptions; +begin + O:=RxDBGridPrint1.Options; + if CheckBox2.Checked then + O:=O + [rxpoShowTitle] + else + O:=O - [rxpoShowTitle]; + + if CheckBox3.Checked then + O:=O + [rxpoShowFooter] + else + O:=O - [rxpoShowFooter]; + + if CheckBox4.Checked then + O:=O + [rxpoShowGridColor] + else + O:=O - [rxpoShowGridColor]; + + if CheckBox5.Checked then + O:=O + [rxpoShowFooterColor] + else + O:=O - [rxpoShowFooterColor]; + + if CheckBox6.Checked then + O:=O + [rxpoShowReportTitle] + else + O:=O - [rxpoShowReportTitle]; + + if CheckBox7.Checked then + O:=O + [rxpoHideZeroValues] + else + O:=O - [rxpoHideZeroValues]; + + if CheckBox8.Checked then + O:=O + [rxpoColSpanning] + else + O:=O - [rxpoColSpanning]; + + + if CheckBox9.Checked then + O:=O + [rxpoShowPreview] + else + O:=O - [rxpoShowPreview]; + + RxDBGridPrint1.Options:=O; + + RxDBGridPrint1.ReportTitle:=Edit1.Text; + RxDBGridPrint1.ModifyPrepared:=CheckBox10.Checked; +end; + +procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction); +begin + FreeAndNil(FontDirList); +end; + +end. + +