the TSMReport component now have the LoadReportFromStream and SaveReportToStream methods
Using these methods you may load/save the reports in any stream, including BLOB-streams for field in any dataset or implement the packed/encoded streams (zip/ZLib, for example)
Blog
-
TSMReport component: load/save from streams
-
Viewer for MS Outlook Messages: testimonials
Thanks for the software which has rescued a problem I have had while away from the office with Microsoft Outlook failing to install.
Professor David Cope
-
ExcelFile Viewer: testimonials
Trevor Harvey:
“xlsview received, installed and a long lost spreadsheet which I had given up hope of ever seeing again has been translated to openoffice.calc and is looking great.Well done for some really useful S/W and excellent service.”
-
pack table (Paradox, dBase)
If you use the TTable component in Delphi then to find the code to pack the table (to remove the records which are marked as deleted) is not a problem. For example:
http://www.swissdelphicenter.ch/torry/showcode.php?id=35But how to pack the table using pure BDE API? What if you do not want to use the TTable/TDatabase components?
Today I wrote the next code for this task:
uses BDE; procedure TfrmMain.piPackTableClick(Sender: TObject); procedure DbiError(ErrorCode: DBIResult); begin raise Exception.CreateFmt('BDE Error Code: %x', [ErrorCode]); end; procedure Check(Status: DBIResult); begin if Status <> 0 then DbiError(Status); end; function StrToOem(const AnsiStr: string): string; begin SetLength(Result, Length(AnsiStr)); if Length(Result) > 0 then CharToOem(PChar(AnsiStr), PChar(Result)); end; var hDatabase: hDbiDb; hTableCursor: hDbiCur; TableDesc: CRTblDesc; begin { check if BDE installed } Check(dbiInit(nil)); { Open a database session with exclusive read/write access } Check(DbiOpenDatabase('', nil, // database type (Standard) dbiReadWrite, // open mode (versus read-only) dbiOpenExcl, // exclusive (versus shared) nil, // database login password 0, nil, nil, hDatabase)); try Check(DbiSetDirectory(hDatabase, Pointer(StrToOem(ExtractFilePath(cbFileName.Text))))); { Open the table, returning its cursor handle } Check(DbiOpenTable(hDatabase, PChar(ExtractFileName(cbFileName.Text)), {$IFDEF DB_PARADOX} szParadox, {$ENDIF} {$IFDEF DB_DBASE} szDBASE, {$ENDIF} nil, nil, 0, // no result index required dbiReadOnly, dbiOpenShared, xltField, // use logical field types (normal) False, nil, hTableCursor)); {$IFDEF DB_PARADOX} FillChar(TableDesc, SizeOf(CRTblDesc), #0); with TableDesc do begin StrCopy(szTblName, PChar(ExtractFileName(cbFileName.Text))); StrCopy(szTblType, szParadox); bPack := True; end; Check(DbiCloseCursor(hTableCursor)); Check(DbiDoRestructure(hDatabase, 1, @TableDesc, nil, nil, nil, False)); {$ENDIF} {$IFDEF DB_DBASE} Check(DbiPackTable(hDatabase, hTableCursor, nil, szDBASE, True)) Check(DbiCloseCursor(hTableCursor)); {$ENDIF} finally Check(DbiCloseDatabase(hDatabase)); end; end; -
Chrome
Google запускает свой browser: http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html
Из отличий – свой движок Java-script и отдельный процес под каждый url в своем табе для просмотра (убивать при ошибке будем таб со своим процессом, а не весь browser).Зачем им это нужно – вопрос второй. Лично мне сейчас интересно другое – есть другой продукт под названием Chrome (Pascal for Visual Studio .NET) Не знаю или зарегистрировали они свой TradeMark, но скорее всего зарегили. Как Google будет разбираться с этими RO (Remote Objects)?
Я не думаю, что их устроит позиционирование на уровне Google Chrome. Все-таки простые названия (Chrome) более запоминающиеся.
И почему они не пошли по протоптаной дорожке и не назвали gBrowser? -
Delphi 2009
The compiled exe/dll can’t be executed in Windows 95/98/ME because there is no unicode support.
The bad news because CodeGear could create the wrappers (from unicode->ansi functions) for this situation. Now they suggest to create these wrappers yourself and update the Windows.pas unitHope they will include the new unit with wrappers in next update for D2009
-
DVD -RW/+RW, NEC-Optiarc Writemaster LF Black slim (AD-7593A-01)
Buyed the new DVD writer for my laptop. The old DVD ROM (Toshiba SD-C2612) didn’t read some new CD/DVD disks so I dicided to replace with new one.
I found the description about new Sony/NEC Optiarc with IDE – AD-7593A-01 and ordered online in sokol.ua (from home computer in Thursday evening). On next day in 11AM the sale person called me by phone to confirm the order. They do not want to receive the WebMoney as payment method now and suggested to buy for cash. In Saterday we got the unit in their shop.
291hrn ($63) All works well and I can read all my disks now. -
Omnibook XT6200 and replace hdd (WD2500BEVE)
I buyed and installed succesfull this WD2500BEVE in my XT6200.
The correct algorithm is:
1. download the Data LifeGuard Tools at http://support.wdc.com/product/download.asp?groupid=701&lang=en2. create boot floppy and create the partitions (no more than 137Gb every) in LifeGuard Tools
3. install Windows XP (with SP2! – very important). If you’ll install the Windows XP from recovery CDs (for laptop) then only 137Gb will be available because SP2 is not included there.
BIOS in XT6200 will display 137Gb anyway but Windows XP SP2 will work correctly with all 250Gb
PS: I tried to install the Vista but for some reason the setup is hang. Not sure why – maybe DVD corrupted. Anyway now I work with Windows XP SP2 without any problem.
-
TRichEdit: change the substring but don’t change color/font attributes
For example, if you have some TRichEdit instance and you want to change some substring there but do not change the formatting (color/font etc) for this text, you may use this code:
var
i: Integer;
begin
if SameText(strNewValue, strOldValue) then exit;
repeat
i := Pos(strOldValue, yourRichEdit.Lines.Text);
if (i > 0) then
begin
yourRichEdit.SelStart := i-1;
yourRichEdit.SelLength := Length(strOldValue);
yourRichEdit.SelText := strNewValue;
end;
until (i = 0)
end;
PS: if use the next code, then formatting will be lost:
yourRichEdit.Lines.Text := StringReplace(yourRichEdit.Lines.Text, strOldValue, strNewValue, [rfIgnoreCase, rfReplaceAll])
-
3G/GPRS
если ехать отдыхать, то сейчас выгодно купить карточку у BeeLine. Они перепродают 3G от Utel, но при этом нет помесячной оплаты, а платишь только за траффик (30коп за 1Мб):
http://beeline.ua/Services/gprs/3g.wbpК сожалению, и сам utel, и МТС, и КиевСтар, и PeopleNet дерут абонплату. Т.е. в итоге цена мегабайта там даже ниже, но их услуги больше подходят тем, кто пользуется этим постоянно. Лично мне такое нужно только в отпуске.
PS: в Израиле я тоже сидел на 3G – скорость впечатляла. 100Mb стоили 20 шекелей, т.е. суммы вполне сравнимы с BeeLine