Serge Girard

Member since: Thursday, 23 April 2015
Last login: 14 hours 56 minutes ago
Profile viewed: 415 views

Your Rank: 93
Points: 1

Serge Girard replied to the topic 'TFDQuery not updating fields' in the forum. 11 hours 21 minutes ago

I added a colum nto my SQLite table

Ok but how did you do that ?

it does not show up in the results of the query.
Once more, how do you show the result ? in a grid ? and if so have you declare the dataset fields of the fdQuery or not ? in the first case only the declared fields are shown (VCL program and DBGrid else if it's a FMX one hum it's a bit more complex i am afraid of)



Read More...

Serge Girard replied to the topic 'Cannot connect firebird with dbexpress or firedac' in the forum. 4 weeks ago

Hello,

IMHO it's an Firebird install problem, did you start-it as service ?
If not you'll need to start firebird before testing connections (ISQL works because it use an embedded version of firebird).

Read More...

Responding to myself !

I understood that TGrid don't behave like TStringGrid, don't memorize the cells value.
I found in the , poor, documentation that it was needed to do it manually in a TArray during the OnSetValue event, except that, if you use livebindings you can't !

So here is my tip :
I add a TStringGrid, invisible, filled before my grid in the BindingsList . The stringgrid need just one column (in my case) to keep the value I want to check for color.

Then it's very easy to check the cell value in the StringGrid during then OnDrawColumnCell event of the grid and so manage the color.

Cherry on the cake changes (insert,add,modify) are synchronous
in attachment a sample : name column back color=pink when it is Shells

Read More...

Serge Girard replied to the topic 'FireDac Questions' in the forum. 2 months ago

pkey query is needed to get fieldnames if you don't want this i think you have to use an explicit query
i.e. {code}Select col1,col2,col3 from mytable{/code}
Count query is needed so you can have access to FDQuery.recordcount, as I remember this one can be occulted with Fetchoptions (RecordCoundMode and LiveWindowParanoic)

Read More...

Hello

Is it because i use a "Professionnal" license?!

Yes, look at the feature matrix www.embarcadero.com/features/feature-matrix you will see a 2CX in Pro version column meaning not included except with Firedac Client/Server Pack

What is the solution?

Buying the Firedac Client/Server Pack I assume

Read More...

Hello,
How can i change a FontColor in my Tgrid ?

I know about OnCellDraw event i.e like this

procedure TForm15.Grid1DrawColumnCell(Sender: TObject; const Canvas: TCanvas;
  const Column: TColumn; const Bounds: TRectF; const Row: Integer;
  const Value: TValue; const State: TGridDrawStates);
var ARect : TRectF;
begin
   // change background color of Column[0]
   if Column.Index=0 then
    begin
     AColor:=TalphaColors.MoneyGreen;
     ARect:=TRectF.Create(Bounds);
     InflateRect(ARect,3,3);
     Canvas.Fill.Color:=AColor;
     Canvas.FillRect(ARect,0,0,[],1);
     Canvas.Fill.Color:=TalphaColors.Black;
     Canvas.FillText(Bounds,Value.ToString,false,1,[],TTextAlign.Leading);
    end;
end;
But if y can test the Value of the cell column I can't test a value in the dataset !

let say y have a table and grid with 3 columns (partname,price,lastsale) and i want the rows of my grid red if lastsale data is more than one year old .

My first attempt was to change the if statement in
If YearSpan(Mydata.FieldByname('lastSale').asDate,Date)>1 then 
     begin
        ...
     end;  
But it seems that the Mydata.FieldByname('lastSale').asDate don't change (first row of my Clientdataset)

Read More...

Serge Girard replied to the topic 'TListView Footer Text Live Bindings' in the forum. 5 months ago

Hello,
As you, I don't see how to do such thing with livebindings, only for headers !
So i use some tricks( not academic but ....) to fill these footers

...
 private 
    i : Integer;
...
// using a dynamic appearence , 2 text in item 

procedure TForm13.LinkListControlToField1FilledList(Sender: TObject);
var Pied,Temp : TListViewItem;
    texte : String;
    Li : integer;
begin
    // moving footer up 
     for Li := 1 to Pred(ListView1.ItemCount) do
     begin
       if ListView1.Items[Li].Purpose=TListItemPurpose.Footer then
         begin
           Pied:=ListView1.Items[Li];
           Texte:=Pied.Text;
           ListView1.Items.Delete(Li);
           Temp:=ListView1.Items.Insert(Li-1);
           temp.Text := Texte;
           temp.Purpose := TListItemPurpose.Footer;
         end;
     end;
 // last "record" 
  with ListView1.Items.Add do
    begin
      Text := Format('Last footer %d',[i]);
      Purpose := TListItemPurpose.Footer;
    end;
end;

procedure TForm13.LinkListControlToField1FilledListItem(Sender: TObject;
  const AEditor: IBindListEditorItem);
var AnItem, FItem : TListViewItem;
begin
AnItem:=AEditor.CurrentObject as TListViewItem;
if (AnItem.Purpose=TListItemPurpose.Header) then
 begin
  if (AnItem.Index>1)  then
   begin
      with ListView1.Items.Add do
       begin
          Text := Format('bloc footer %d',[i]);
          Purpose := TListItemPurpose.Footer;
         // to be moved later
     end;
    end;
  i:=0;
 end
 else  i:=i+StrToInt(AnItem.Data['Text2'].AsString);
end;

Hope there is another way to do that sort of thing but this trick works

Read More...

Serge Girard has liked an Event 5 months ago
Serge Girard replied to the topic 'Delphi 7 Help on windows 10' in the forum. 7 months ago

Hi,
Perhaps running console as administrator ?

Read More...

Serge Girard replied to the topic 'Delphi 7 Help on windows 10' in the forum. 7 months ago

Upload this file
If your read French some explanations here, with another downloadlink inside
else
Udate Install.bat add these two lines (in red) :

Code batch :Sélectionner tout
123456789
@echo off
::
:: Settings
set MuiFileName=winhlp32.exe.muiset ExeFileName=winhlp32.exeset WindowsVersion=7goto :BypassVersionError

run this file as administrator.
Take care, every windows update can uninstall the helpviewer
Serge

Read More...

Serge Girard replied to the topic 'FMX Mobile App - Header/Footer, etc., Tokyo missin' in the forum. 8 months ago

Sorry I have only entreprise version (and a starter one to check)
It seems that version pro is like starter one for this feature ! Why ?

Read More...

Serge Girard replied to the topic 'FMX Mobile App - Header/Footer, etc., Tokyo missin' in the forum. 8 months ago

Hi,
Have a look at File/New/Other/Delphi projects/multi Device projects
Note : you can also personalize this New submenu thing

Read More...

Serge Girard replied to the topic 'REST/JSON (TRESTClient) copy to SQLite (TFDTable)' in the forum. 9 months ago

Hi Roger,
I agree, but did you see the video ? (taking apart the TMS Grid stuff)
I think it's great that without any of the batchmove things and a single FdMemTable (along with the REST components) you get the result so easily ! Ok, there are some limitations about how is the JSON structure but, i am a lazy programmer if i can use the trick i use it ;-)

Read More...

Serge Girard replied to the topic 'REST/JSON (TRESTClient) copy to SQLite (TFDTable)' in the forum. 9 months ago

Hello,
Use a FDMemTable instead. Have a look at this vidéo.
If you read french you can also view this trend , I (aka SergioMaster) gave some tricks and links to the requester

Read More...

Serge Girard replied to the topic 'Obtaining Firebird ODS information using FireDAC' in the forum. 9 months ago

Have a look at them, it's a mine of informations

Read More...

Serge Girard replied to the topic 'Obtaining Firebird ODS information using FireDAC' in the forum. 9 months ago

Hi,
You can use a QUery to have this information
SELECT MON$ODS_MAJOR, MON$ODS_MONOR FROM MON$DATABASE
MON$DATABASE Table contains many useful other infos on the connected database

Read More...

DavidI is friends with Serge Girard