Fast Report fr3 File loading Error in Delphi - delphi

I have question about loading *.fr3 in DelphiXE5,
I designed a report and pointed some text to Memo inside of Fast Report everything was ok until I want to load fast Report file from out site App it works for my PC perfectly but when I install client side it gets Error like this Photo include in this message
And the code I used is:
begin
frxReport1.LoadFromFile(ExtractFilePath(Application.ExeName)+'R1.fr3');
frxReport1.PrepareReport();
frxReport1.ShowReport();
end;
Error message:
'18/89765' is not a valid floatin point value
'238/11039' is not a valid floatin point value
'275/90569' is not a valid floatin point value
'41984/5614698264' is not a valid floatin point value
'41984/5618072454' is not a valid floatin point value
'94/48825' is not a valid floatin point value

I found the problem, the problem was Microsoft windows 8.1
I'm using Microsoft Windows 8.1, Delphi Xe 5 and Fast-report 4.15.6
First I made a report in fast report without any change and then run my app in windows 7 save as Fast-report to file and then use in all version of Microsoft Windows, thanks a lot

The problem has been originated form Regional Settings.
Win 8.1 automatically changes decimal separator as '.' to '/' in Persian language, even in fast reports.
The Microsoft has to figure this problem out.

step 1: open frxutils.pas from fastreport lib
step 2: function frxStrToFloat(s: String): Extended;
step 3: relapse this code: [',', '.']) with [',', '.','/']

Related

How to get S.M.A.R.T. info from disks?

I tried code found in Google but nothing works and in most cases it doesn't even compile (missing units, undeclared data types etc).
I finally found something that looks complete but shows "The handle is invalid" error:
http://rsdn.org/article/delphi/SMART.xml
You can download the file from here:
http://rsdn.org/article/delphi/smart/smart.zip
The problem is with function function OpenSMART(DrvNum:Byte): THandle;
hSMARTIOCTL:=CreateFile(PChar('\\.\PhysicalDrive'+inttostr(DrvNum)),GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE,nil,OPEN_EXISTING,0,0);
result:= hSMARTIOCTL;
How can I fix it or where can I find working example?
I use Delphi 7 Pro and Delphi 10.3.
OK, it needs to be run as admin. Then it just works.

Invalid Pointer and Access Violation with Native Excel 3 for Delphi

I'm using Delphi 10.2 and the Native Excel 3 library to create spreadsheets.
I have the following code:
var
fWorkbook: IXLSWorkbook;
fSheet1: IXLSWorksheet;
begin
fWorkbook:=TXLSWorkbook.Create;
fSheet1:=fWorkBook.Sheets.Add;
fSheet1.Range['A1','A1'].ColumnWidth:=20;
fSheet1.Range['B1','B1'].ColumnWidth:=20;
fSheet1.Range['C1','C1'].ColumnWidth:=32;
fSheet1.Range['D1','D1'].ColumnWidth:=32;
fSheet1.Range['E1','E1'].ColumnWidth:=14;
fSheet1.Range['F1','F1'].ColumnWidth:=14;
fSheet1.Range['G1','G1'].ColumnWidth:=14;
fSheet1.Range['H1','H1'].ColumnWidth:=14;
fSheet1.Range['I1','I1'].ColumnWidth:=14;
fSheet1.Cells[1,1].Value:='Entry Type';
fSheet1.Cells[1,2].Value:='Intacct Acct #';
fSheet1.Cells[1,3].Value:='Intacct Acct # Description';
fSheet1.Cells[1,4].Value:='Store Name';
fSheet1.Cells[1,5].Value:='Department #';
fSheet1.Cells[1,6].Value:='Location ID';
fSheet1.Cells[1,7].Value:='Project ID';
fSheet1.Cells[1,8].Value:='Grant ID';
fSheet1.Cells[1,9].Value:='Net Amount';
intRow:=fWorkBook.SaveAs(Outfile);
'there is additional code after this.
end;
This code works every time on my development system. I've also used nExcel in other projects without a problem.
However, at the client's system, the fWorkbook.SaveAs generates an "Invalid Pointer" error or Access Violation. Since I cannot duplicate it, debugging is tough.
I have tried moving the SaveAs to various places (after the initial create, after the setting of column widths and where it is now).
Anyone seen this and/or have an explanation?
Thanks!
Malcolm
This problem was resolved by saving the workbook as an xlsx.

Getting Delphi to read a database with a new version of Microsoft Access

We use a Delphi 10 programme that reads in an Access database. I do not deeply understand how it does it, except that I believe it uses units called DAO.pas and DAO_TLB.pas.
I recently upgraded from Office 2007 to Office 2016, and since then the Delphi programme is unable to read from the database; it gives the error:
Project MyProj.exe raised exception class EOleSysError with message 'Class not registered'.
I have tried to search to find how to fix this but am struggling because I don't really understand what's going on under the hood. I tried to install the Access 2016 type library, but that didn't seem to make any difference.
Extremely grateful for any help.
Thanks,
Tom
EDIT: DAO.pas is here. DAO_TLB.pas is where the error is triggered; the function which errors is:
class function CoDBEngine.Create: _DBEngine;
begin
Result := CreateComObject(CLASS_DBEngine) as _DBEngine;
end;
Where CLASS_DBEngine is a constant declared as:
CLASS_DBEngine: TGUID = '{CD7791B9-43FD-42C5-AE42-8DD2811F0419}';
I have also just noticed that, when the error occurs, if I click continue rather than break, a new error appears, saying:
Class not registered, ClassID: {CD7791B9-43FD-42C5-AE42-8DD2811F0419}
i.e. the ClassID is the CLASS_DBEngine constant.

Delphi - conversion among charactersets - explanation and how to do it? [duplicate]

This question already has an answer here:
SetThreadLocale for the entire Delphi application
(1 answer)
Closed 6 years ago.
My Delphi program does not retrieve the right characters. SetThreadLocale for the entire Delphi application is the context of my problem. I am using Firebird 1.5 charset NONE database which contains WIN1257 data. I am using Delphi 10 Seattle IBX componentes to retrieve data from this database. Usually I use my program on Windows with one of the Baltic locale for non-Unicode programs. But sometimes I need to run my program on Windows with Russian locale (WIN1251 characterset).
And I am stuck with the following problem: database varchar field contains character ā, which is retrieved in Delphi code (fieldname.asString) as \u0101 when the program is run with Baltic locale, but it is retrievied (fieldname.asString) as \u0432 when the program is run with Russian locale, but I need it to be displayed as \u0101 in Russian case as well.
I have tried to set all the connection parameters to TIBDatabase but failed to achieve my goal. So - now I have idea to do translation: I can detect that program is running under Russian locale and in that case I can apply special conversion function like MyConvert(fieldname.asString) to convert \u0432 into \u0101 and something like this for all the characters.
The question is - is there such conversion function available and how to use it? What is the algorithm that determines the bijection \u0432 <-> \u0101?
Migration to the unicode database is not my option.
Current question tries to solve the same core problem as SetThreadLocale for the entire Delphi application but with different approach. I have not managed to set thread locale for my application and therefore I decided to make character conversion and this question is - how to do it?
Added: https://en.wikipedia.org/wiki/Windows-1251 and https://en.wikipedia.org/wiki/Windows-1257 palettes show that a has E2 position and this position in both palettes have different, but known Unicode characters, so the mapping is known and there is no single formula how to express it, it should be done character by character basis.
The following function is the answer I sought:
function MyConversionFunction(AChar: Char): Char;
begin
case Ord(AChar) of
//A_
$045E: Result:=Char($00A2);
$0408: Result:=Char($00A3);
$00A4: Result:=Char($00A4);
$00A6: Result:=Char($00A6);
$00A7: Result:=Char($00A7);
$0401: Result:=Char($00D8);
$00A9: Result:=Char($00A9);
$0404: Result:=Char($0156);
$00AB: Result:=Char($00AB);
$00AC: Result:=Char($00AC);
$00AD: Result:=Char($00AD);
$00AE: Result:=Char($00AE);
$0407: Result:=Char($00C6);
//B_
$0406: Result:=Char($00B2);
$0456: Result:=Char($00B3);
$0491: Result:=Char($00B4);
$0451: Result:=Char($00F8);
$2116: Result:=Char($00B9);
$0454: Result:=Char($0157);
$0458: Result:=Char($00BC);
$0405: Result:=Char($00BD);
$0455: Result:=Char($00BE);
$0457: Result:=Char($00E6);
//C_
$0410: Result:=Char($0104);
$0411: Result:=Char($012E);
$0412: Result:=Char($0100);
$0413: Result:=Char($0106);
$0414: Result:=Char($00C4);
$0415: Result:=Char($00C5);
$0416: Result:=Char($0118);
$0417: Result:=Char($0112);
$0418: Result:=Char($010C);
$0419: Result:=Char($00C9);
$041A: Result:=Char($0179);
$041B: Result:=Char($0116);
$041C: Result:=Char($0122);
$041D: Result:=Char($0136);
$041E: Result:=Char($012A);
$041F: Result:=Char($013B);
//D_
$0420: Result:=Char($0160);
$0421: Result:=Char($0143);
$0422: Result:=Char($0145);
$0423: Result:=Char($00D3);
$0424: Result:=Char($014C);
$0425: Result:=Char($00D5);
$0426: Result:=Char($00D6);
$0427: Result:=Char($00D7);
$0428: Result:=Char($0172);
$0429: Result:=Char($0141);
$042A: Result:=Char($015A);
$042B: Result:=Char($016A);
$042C: Result:=Char($00DC);
$042D: Result:=Char($017B);
$042E: Result:=Char($017D);
$042F: Result:=Char($00DF);
//E_
$0430: Result:=Char($0105);
$0431: Result:=Char($012F);
$0432: Result:=Char($0101);
$0433: Result:=Char($0107);
$0434: Result:=Char($00E4);
$0435: Result:=Char($00E5);
$0436: Result:=Char($0119);
$0437: Result:=Char($0113);
$0438: Result:=Char($010D);
$0439: Result:=Char($00E9);
$043A: Result:=Char($017A);
$043B: Result:=Char($0117);
$043C: Result:=Char($0123);
$043D: Result:=Char($0137);
$043E: Result:=Char($012B);
$043F: Result:=Char($013C);
//F_
$0440: Result:=Char($0161);
$0441: Result:=Char($0144);
$0442: Result:=Char($0146);
$0443: Result:=Char($00F3);
$0444: Result:=Char($014D);
$0445: Result:=Char($00F5);
$0446: Result:=Char($00F6);
$0447: Result:=Char($00F7);
$0448: Result:=Char($0173);
$0449: Result:=Char($0142);
$044A: Result:=Char($015B);
$044B: Result:=Char($016B);
$044C: Result:=Char($00FC);
$044D: Result:=Char($017C);
$044E: Result:=Char($017E);
$044F: Result:=Char($02D9);
else Result:=AChar;
end;
end;

123 ERROR_INVALID_NAME after activate Wave audio liverecorder

I am using the wave audio component in my project and I run into a problem that I am unable to resolve.
I am using Delphi XE 5 and my operating system is Windows 8. When I am trying to the run the project and active the liveaudio recorder on Windows 7, I got this: error Exception EOSError in module Chatproject.exe at 00029633. System Error. Code: 123. The filename, directory name, or volume label syntax is incorrect. But its working normal on Windows 8,. I tried to debug and figure out the problem I got this error message when I am activating the recorder
Update of the question :
i debugged each of sendtocl , sendbuffer ,buffer^, buffersize and here is result in the image ,, but i have no idea how to fix sendbuffer and buffer^ and sendtocl
http://i.stack.imgur.com/5sZ05.jpg
You have four references to sendtocl:
#56: sendtocl: TIdUDPClient;
#235: if sendtocl.active then
#236: sendtocl.SendBuffer(RawToBytes(Buffer^, Buffersize))
#260: sendtocl.Broadcast(usertype.Text, 12000);
It should be getting created when the form is created, assuming it's a component dropped on the form. But for whatever reason, it isn't instantiated at some point.
This is consistent with the exception message you're getting.
The ERROR_INVALID_NAME is probably pointing to an invalid URI, path, or filename -- it's entirely possible that it's valid in Win 8 but not Win 7. So when you try to invoke .Active, it fails. But why sendtocl woudl be set to NIL doesn't make sense. Mabye the exception is on the SendBuffer method?
As Ken suggests, you just need to go in with the debugger and figure out what's going on. I'm not sure there's much more us "out here" can do for you other than comment on how the code appears.

Resources