|
The expression parser / evaluator of TAdvSpreadGrid, our spreadsheet component , can also be separately used. This expression evaluator is in the unit AdvFormula. To use it, create an instance of the class TAdvFormula and it can be used in the following way:
var
Fm : TAdvFormula;
R: double;
begin
Fm := TAdvFormula.Create(self);
try
Fm.Expression := '1+2';
if Fm.Calc(r) then
showmessage(floattostr(r));
finally
Fm.Free;
end;
var
Fm : TAdvFormula;
R: double;
begin
Fm := TAdvFormula.Create(self);
try
fm.v[0] := 12;
fm.v[1] := 25;
Fm.Expression := 'V0+V1';
if Fm.Calc(r) then
showmessage(floattostr(r));
finally
Fm.Free;
end;
end;
|
|
TFormSize will normally automatically load the persisted settings before the form‘s OnCreate event is triggered, so there is no chance to programmatically change the FormSize properties in code before the settings are loaded. So, to achieve what you want to do, set FormSize.SavePosition = false & FormSize.SaveSize = false end then, in the form’s OnCreate event, first set FormSize.SaveName and after that, set FormSize.SavePosition = true & FormSize.SaveSize = true and then call FormSize.LoadFormSettings. |
|
TMS FlexCel v6.17 introduced full support for reading and saving strict xlsx files. Strict xlsx files are a different file format from normal xlsx files, and you can select them when doing a "File Save As..." in Excel:
Now the question is: Should I use normal or strict xlsx files? And the short answer is: Use normal xlsx files unless you have a non negotiable requirement from your customers to use strict xlsx.
The long answer can be found here. |
|
Sometimes you want to know the exact FlexCel version you are using from inside your app, and you might also want to make sure you aren't using a trial. You can use the following code to find out:
//The FlexCelIsTrial constant in FlexCel.Core is true if this version is a trial
if FlexCelIsTrial then WriteLn('ERROR: This is a trial version of FlexCel!');
//The FlexCelVersion constant in FlexCel.Core contains the current version.
WriteLn(FlexCelVersion);
|
|
The TTMSFMXRichEditorRTFIO allows to load RTF from a file. It is also possible to directly load RTF from a stream though in the following way:
var
ss: TStringStream;
s: string;
begin
ss := TStringStream.Create;
try
ss.LoadFromStream(yourstream);
s := ss.DataString;
TMSFMXRichEditor.InsertAsRTF(s);
finally
ss.Free;
end;
end;
|
|
By using the OnBeforeNavigate event it's possible to detect an action that will navigate away from the map on Android or iOS. If required the action can also be cancelled. Example:
procedure TForm1.TMSFMXWebGMaps1BeforeNavigate(Sender: TObject;
var Params: TTMSFMXWebGMapsCustomWebBrowserBeforeNavigateParams);
begin
if Params.URL = 'https://www.google.com' then
Params.Cancel := true;
end;
|
|
Note that the OAuth requests to Google API services from embedded browsers are no longer allowed. More info can be found here: https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html?m=1 From now on authentication for Google API services will happen via an external browser window. A new property ExternalBrowser was added to activate this feature. On Windows and Mac platforms this will work automatically. On Android and iOS some extra configuration is required. Android
iOS
|
|
A new video has been published about our TMS FNC TableView beta that is included in TMS FNC UI Pack beta v2.1.0.0. TMS FNC UI Pack beta v2.1.0.0 is available from the 'My products' page for all registered TMS ALL-ACCESS and TMS FNC UI Pack users.
|
|
When using SQL Server at RemoteDB server side, you might want to make client to set ApplicationName parameter of server connection. You can achieve that by sending the parameter through a HTTP header “db-app-name", and using a middleware at server side to grab that value and set in connection. This approach can be used to set other server-side database connections from client side. On server side:
threadvar
ThreadApplicationName: string;
procedure StartServer;
var
Server: THttpSysServer;
Module: TRemoteDBModule;
begin
Server := THttpSysServer.Create;
try
Module := TRemoteDBModule.Create('http://localhost:2001/tms/remotedb',
TDBConnectionFactory.Create(
function: IDBConnection
var
Module: TConnectionModule;
begin
Module := TConnectionModule.Create(nil);
// Use ThreadApplicationName to configure your connection
if ThreadApplicationName <> '' then
Module.FDConnection.Params.Values[‘ApplicationName’] := ThreadApplicationName;
Result := TFireDacConnectionAdapter.Create(Module.FDConnection1, Module);
end
)
);
Module.AddMiddleware(TAnonymousMiddleware.Create(
procedure(C: THttpServerContext; Next: THttpServerProc)
begin
ThreadApplicationName := C.Request.Headers.Get('db-app-name');
Next(C);
ThreadApplicationName := '';
end
));
Server.AddModule(Module);
Server.Start;
WriteLn('RemoteDB server running...');
ReadLn;
finally
Server.Free;
end;
end;
RemoteDBDatabase1.OnRequestSending := RequestSending;
procedure TfmThreeTierAureliusRemoteDB.RequestSending(Sender: TObject;
Req: THttpRequest);
begin
Req.Headers.SetValue('db-app-name', 'My Application');
end;
|
|
New version 2.2 of TMS Analytics and Physics Pack includes total support of operations with N-element arrays and MxN matrices. The operations realized in the Linear Algebra extension package. Array and matrix operations allow advanced calculations with small, compact formulae. Read the full blog post here. |
As always, we thank all users for the numerous inputs, feedback, comments and suggestions. This is an invaluable help to steer our developments here at TMS software. We continue to look forward to all your further communications to direct our team to provide you better tools and components for your needs.
Kind regards,
TMS software team
Email:
info@tmssoftware.com
Web: http://www.tmssoftware.com
Support, FAQ & Manuals: http://www.tmssoftware.com/site/support.asp