Can no longer show memo text in grid

72 vues
Accéder directement au premier message non lu

gshelt...@gmail.com

non lue,
26 juil. 2022, 07:37:3026/07/2022
à Rosi Delphi Components
Not sure when this started but even old app that I did some fixes in will no longer show memo txt in grid. I think there used to be a property FieldsAsMemo that is no longer there.
Setting OptionsEx2/Editors/obtContent has no effect.

Tomas Rosinsky

non lue,
26 juil. 2022, 09:53:1626/07/2022
à Rosi Delphi Components
Hi,
there are 2 logical steps to show memo field content in the rDBGrid.

1/ rDBGrid must recognize that some field is memo field - depends on field type and BlobType for the TBlobField, you should set it to ftMemo, ftFmtMemo, ftWideMemo or set RosiCompConfig.rDBToolCfg.BlobField_ftBlobAsMemo = TRUE , see IsMemoField function

function IsMemoField(Fld: TField): boolean;
var
  bt: set of TBlobType;
begin
  if RosiCompConfig.rDBToolCfg.BlobField_ftBlobAsMemo then
    bt:=[ftBlob]
  else
    bt:=[];
{$IFDEF D2006P}
  Result:=(Fld is TMemoField) or (Fld is TWideMemoField);
  if Fld is TBlobField then
    if (TBlobField(Fld).BlobType in (bt + [ftMemo, ftFmtMemo, ftWideMemo])) then
      Result:=true;
{$ELSE}
  Result:=Fld is TMemoField;
  if Fld is TBlobField then
    if (TBlobField(Fld).BlobType in (bt + [ftMemo, ftFmtMemo])) then
      Result:=true;
{$ENDIF}
end;


You can also use OnGeneralEvent with type geIsMemo to define it per any field by custom code.

2/ Set  OptionsEx2.Editors.Memo = obtContent

I hope it helps
Tomas


Dne úterý 26. července 2022 v 13:37:30 UTC+2 uživatel gshelt...@gmail.com napsal:

gshelt...@gmail.com

non lue,
26 juil. 2022, 11:58:4226/07/2022
à Rosi Delphi Components
Tomas,

The field in question is in fact a memo field and I have set OptionsEx2.Editors.Memo = obtContent still no joy.
To make sure I run this:
procedure TfrmMain.Button1Click(Sender: TObject);
var
  lGrid : TrDBGrid;
  IsMemo : String;
begin
  lGrid := FViewModel.GetCurrentFrameDefaultrDBGrid;
  if (lGrid.Columns[16].Field is TMemoField) then
  IsMemo := 'Yes'
  else
  IsMemo := 'No';

  ShowMessage(Format('FieldName: %s IsMemo: %s',
    [lGrid.Columns[16].Field.Name, IsMemo]));
end;

Result message is the intended field and IsMemo = True

Tomas Rosinsky

non lue,
26 juil. 2022, 13:24:0726/07/2022
à Rosi Delphi Components
What version of RAD and what version my component are you using for the old app? Check unit RosiComp_splash used for thos RAD version and provide value of const RosiCompPackVer.
Thanks
Tomas



Dne úterý 26. července 2022 v 17:58:42 UTC+2 uživatel gshelt...@gmail.com napsal:

gshelt...@gmail.com

non lue,
26 juil. 2022, 16:14:3226/07/2022
à Rosi Delphi Components
Delphi 11 update 1
Rossi 17.2b

Not sure what version of Rossi components it worked with last. I have 17.1b on my laptop and it has same issue. I usually update to the latest version but will try downgrading until I find the one that worked.

Tomas Rosinsky

non lue,
26 juil. 2022, 16:19:1426/07/2022
à Rosi Delphi Components
It does not make sense to me. Please send your form and datamodule PAS+DFM to my email to check it in detail.
Nobody else reported similar issue so it looks as some strange setting on your side. 

The Memo setting can also be stored in the INI file if you use PropSaveGrid with StoreDesignSetting = true. Try to delete INI file for test.

Tomas
Dne úterý 26. července 2022 v 22:14:32 UTC+2 uživatel gshelt...@gmail.com napsal:

gshelt...@gmail.com

non lue,
26 juil. 2022, 19:16:3926/07/2022
à Rosi Delphi Components
Tomas,

I believe I found the issue. You were correct about property saver.
Rossi 16_2 does not save the EditorMemoContent, at all, 17_1 saves it as EditorMemoContent=0 no matter the design setting. Manually changing it to 1 then save the ini and all is well.
I will stick to 16_2 for now.

Gary

Rossi17_1.ini
Rossi16_2.ini

Tomas Rosinsky

non lue,
27 juil. 2022, 03:45:4127/07/2022
à Rosi Delphi Components
You are right, there was small issue with storing of  EditorMemoContent in the 17.1 version.
Current 17.2b version is fixed and store it correctly.

Thanks
Tomas

Dne středa 27. července 2022 v 1:16:39 UTC+2 uživatel gshelt...@gmail.com napsal:

gshelt...@gmail.com

non lue,
27 juil. 2022, 11:00:0227/07/2022
à Rosi Delphi Components
Tomas,
I was using 17_2 when I noticed the problem. The change was between 16_2 and 17_1. It is still there in 17_2.
The attached ini was compiled with Editor set to obtContent
Gary

Rossi17_2.ini

gshelt...@gmail.com

non lue,
27 juil. 2022, 11:16:4627/07/2022
à Rosi Delphi Components
I commented out the Read and write lines 964, 1061-1064 and now it works fine.

May I ask why is anything stored in the ini that the user cannot change? This is an example. If the only change can be made at design time why even store it.
I am sure there is a reason, just curious.

Gary

Tomas Rosinsky

non lue,
27 juil. 2022, 14:47:3327/07/2022
à Rosi Delphi Components
New version of rDBGridProps dialog used in run time by end user allows to set "Show memo field preview" so the setting is also stored in the INI file in the same way as all other setting used for rDBDialogs.
It is the reason. If you do not use it then first used design time setting is also stored and used next time. I see it could be the issue in some cases, I will try to find some solution for it.

Tomas


Dne středa 27. července 2022 v 17:16:46 UTC+2 uživatel gshelt...@gmail.com napsal:
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message