EhLib.Com
https://forum.ehlib.com/en/

Displayname for ValueFieldDefs in PivotDataSourceEh
https://forum.ehlib.com/en/viewtopic.php?f=5&t=839
Page 2 of 5

Author:  EhLibSupport [ 06 Dec 2018, 13:59 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hello

1. Check if you really use last build.

2. Try to take standard Demo Porject PivotGridEh.SimpleDemo.
Drop a new Button on the Form and write code

procedure TForm1.Button1Click(Sender: TObject);
begin
PivotDataSourceEh1.PivotFields.FindFieldByName('OrderNo').DisplayName := 'Order Number';
PivotDataSourceEh1.PivotFields.FindFieldByName('ShipVIA').DisplayName := 'ShipVIA New';
end;

If you press 'Button1' after '(3) Load source data' and then press 'Build Pivot data' you should see new Display Names for fields.
If you press 'Button1' after 'Build Pivot data' the PivotGridEh should clear itself so you need to rebuild Pivot data.

Author:  jsm [ 07 Dec 2018, 14:19 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Thanks for your answer,
I want change text in black box:

Attachments:
Sample.png
Sample.png [ 6.17 KiB | Viewed 6744 times ]
Sample.png
Sample.png [ 6.17 KiB | Viewed 6744 times ]

Author:  EhLibSupport [ 13 Dec 2018, 01:44 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hello

The value for the 'grand total' is taken from the global variable EhLibLanguageConsts.GrandTotalEh
If you assign EhLibLanguageConsts.GrandTotalEh, then the value will be used for all PivotGrids of the project.

The values of COD, Cash, Check, Credit, MC, Visa are taken from the DataSet with the original data specified in the PivotDataSourceEh.DataSet.
To change these values, you need to change them in the original DataSet.

Author:  jsm [ 13 Dec 2018, 04:48 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hi,
Thanks for your Answer,
But About this:
Quote:
The values of COD, Cash, Check, Credit, MC, Visa are taken from the DataSet with the original data specified in the PivotDataSourceEh.DataSet.
To change these values, you need to change them in the original DataSet.

Yes, I know that must change from orginal Dataset, But I want to be able to change later
Can I access this column?

Author:  EhLibSupport [ 13 Dec 2018, 08:16 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hello

Could you write your task in more detail.
Why data should appear later than they are present in the original DataSet?
Do want to replace internal codes with corresponding display values?

Author:  jsm [ 13 Dec 2018, 16:27 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

In Orginal Dataset I use English Title, but my software is multi language & i want show title in correct language

Author:  jsm [ 29 Dec 2018, 05:41 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hi,
Has this access been created in new versions?

Author:  jsm [ 10 Mar 2019, 13:21 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Is there a way to change the columns Title?

Author:  jsm [ 11 Mar 2019, 03:55 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

I Use follow code:
Code:
     
with PivotDataSourceEh1.ValueFieldDefs.Add do
      begin
        PivotFieldName := 'Qty';
        SumFunction := svtSumEh;
        DisplayFormat:= '###,###,###,###';
        DisplayName:= 'کميته';
      end;
      with PivotDataSourceEh1.ValueFieldDefs.Add do
      begin
        PivotFieldName := 'Price';
        SumFunction := svtSumEh;
        DisplayFormat:= '###,###,###,###';
        DisplayName:= 'مبشر';
      end;

But DisplayName not work.
Also, Is it possible to adjust the Alignment?

Author:  EhLibSupport [ 15 Mar 2019, 16:13 ]
Post subject:  Re: Displayname for ValueFieldDefs in PivotDataSourceEh

Hello

About you code

Code:
ValueFieldDefs.Add
...
DisplayName:= 'کميته';


The DisplayName property in TPivotFieldValueInfoEh is a property of base class - TCollectionItem.
This property is intended only for display in the 'Collection editor' at design time.
If you want to change display name of TPivotFieldEh in PivotGridToolBoxEh you should use TPivotFieldEh.DisplayName like this

Code:
  PivotDataSourceEh1.PivotFields.FindFieldByName('AmountPaid').DisplayName := 'The Amount Paid';

Page 2 of 5 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/