Dephi and Quickreport – How to get Page Number

Hi guys,

Recently I encountered a challenge in quickreport that has 2 specific criteria. The invoice report I was making needs to behave both as a page footer and a summary band.

Well the page footer needs to stay because there was a gap at the bottom to write the page number and signature boxes. The summary band comes in because the total amount of the invoices needs to be positioned at the bottom

How to solve it. I took the total number of pages and when the report reaches the last page, the system will display the total amount

  1. Quickreport needs to have a PageHeaderBand
  2. Inside the PageHeaderBank BeforePrint event handler you can ask for the QuickREport1.QRPrinter.PageNumber

Those were the 2 tips that I got from stockoverflow. Really big help for me.

Hope this article helps

Coffee Cup

Delphi Buttons – Create an hour glass impression while waiting

Got a chance to receive source code from a software vendor and the button on this program made me smile.

Haven’t though of it that way. But i think it works.

procedure TSFTPClientFrame.btConnectSSHClick(Sender: TObject);
var
  OldCursor: TCursor;
begin
  OldCursor := Screen.Cursor;
  try
    Screen.Cursor := crHourGlass;
    ScSSHClient.Connect;
  finally
    Screen.Cursor := OldCursor;
  end;
end;

The hour glass cursor is within the try row. Once it is done, it revert backs the cursor to the original one used. Pretty awesome.

Just wanted to share

Coffee Cup

Oracle Virtual PC – menu missing [solved]

It’s been days since the menu on top of virtual pc dissapeared after I chose the fullscreen mode. Good thing there is google.

Found the switch. And it is RIGHT-CONTROL yeah, not the left control key. It’s RIGHT+CONTROL + C

Viola! Enjoy!

Coffee Cup

Storing Chinese Characters in Mysql / Chinese Characters Not Working in MySQL

Recently transferring to another website, the chinese characters are not working already.

Googling the answer led me to this code, you can convert existing columns one by one, or else you can convert them all at once this way:

mysql> ALTER TABLE nameTable CONVERT TO CHARACTER SET utf8mb4, COLLATE utf8mb4_bin;

mysql> SHOW CREATE TABLE nameTable\G

CREATE TABLE `nameTable` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `englishName` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `chinesename` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 

After running the code made it ok

Thank you for the web

Coffee Cup

Delphi Tip : How to get the value from TQrExpr Quick Report Component [solved]

Hi guys,

Just wanted to post this quick tip for those who are still using Delphi and wanted to get the value whether double or int when computing using TQrEXPR.

I remember already seeing this before and now I might need to post it here for posterity sake.

Hope it helps someone else out there. The concept is QREXPR1.Value.DblResult or IntResult.

case QRExpr1.Value.Kind of
resInt : Total := QRExpr1.Value.IntResult;
resDouble : Total := QRExpr1.Value.DblResult;
else
Total := 0.00;

Yeah it’s that easy.

Take care and stay safe

Coffee Cup

Network is connected but no internet is sent [SOLVED]

connected but no internet

Recently we had this issue with our Globe fiber wifi setup. After August 1, 2024 (need to check this one as well), wifi sticks are having a hard time getting internet. We can see that the wifi is connected but no internet is received.

  • at first the culprit might be the wifi stick. standing that we have been using it for months and years, is there a cut-off for them as well?
  • second is the wifi router itself. is it defective or have reached the limit of 60 devices (based on the manual that i read) ?

So far what we did to solve this issue is to use the command prompt and then issue a ‘ipconfig / release’ and ‘ipconfig / renew’ command and viola! It’s now working.

Hope it could help someone out

Coffee Cup

Win+Shift+S Shortcut and Snipping Tool Not Working (4 Ways)

snipping tool

This shortcut has been a game changer for me using Windows 10 since the old days of using Alt+Printscreen and then opening Ms Paint.

Recently, and not really sure what happens but it occasionally breaks down and needs to be reset. Thankfully here are the steps to do it. What i used is Step 3.

Fix Windows + Shift + S Not Working Windows 10 – 4 Ways

Way 1. Turn on the Clipboard History Switch
* Press Windows + I to open Windows Settings. And click System.
* Next click Clipboard in the left panel. Scroll down in the right window to find Clipboard history option.
* Make sure the Clipboard history switch is enabled and is in On status.

Way 2. Make Sure Snip & Sketch Is Enabled
* Still, you can press Windows + I to access Settings window. Click System.
* Next click Notifications & actions in the left pane.
* Scroll down in the right window, and find Snip & Sketch. Make sure it is turned on.

Way 3. Reset Snip & Sketch
Snip & Sketch is the successor of the Snipping Tool in Windows 10. You can also try to reset Snip & Sketch to see if it can fix Win Shift S not working error in Windows 10.

* Click Start -> Settings to enter into Windows Settings screen.
* Click Apps -> Apps & features. Click Snip & Sketch in the right window and click Advanced Options link.
* Click Reset button in the pop-up Snip & Sketch window to reset this Windows 10 screen capture tool.

Way 4. Reinstall Snip & Sketch
You can also try to uninstall and reinstall Snip & Sketch app from Microsoft Store to see if the Windows Shift S not working issue can be fixed.

* Press Windows + I, and click Apps -> Apps & features.
* Scroll down in the right window to find Snip & Sketch app, and click the Uninstall button to remove it from your Windows 10 computer. If the Uninstall button is grey, you can learn how to uninstall programs with CMD or PowerShell.
* Then you can open Microsoft Store to search the Snip & Sketch app to reinstall it on your Windows 10 computer.

I will saved the link here as well

https://www.minitool.com/news/fix-windows-shift-s-not-working.html

Not Acceptable! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security [SOLVED]

Working on programming for so many years, it amazes me that i have really much to learn. This recent issue cropped up out of nowhere.

I decided to disable mod security , which is a bad idea honestly. But true enough, i found the culprit. It seems when you pass a get parameter with special characters, our websites seem to be on high alert against hack attack

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

What i was passing is the name of a client through get command. Yeah i know . It came out as link.php?name=M&M

I changed then parameter to a session id i had given before and it solved the issue. sigh. another lesson learned.

Coffee Cup

Disable Device Driver Signing in Windows 10 [SOLVED]

The original title should be “the hash for the file is not present in the specified catalog file”. I had recently encountered apps not being installed because the has file was not there. And then i wondered. Why would software developers deploy programs without this hash thing.

After a few google searches it turns out it was microsoft thing and you can disable it.

Enjoy

Coffee Cup

To solve this problem, I had to disable Device Driver Signing. Here’s how it’s done in Windows 10.

Option 1 – Command to Enable or Disable

  1. Click the “Start” button.
  2. Type “command“.
  3. Right-click on “Command Prompt” and select “Run As Administrator“.
  4. Do one of the following:
    • To disable device driver signing, type “BCDEDIT /set nointegritychecks ON” then press “Enter
    • To enable device driver signing, type “BCDEDIT /set nointegritychecks OFF” then press “Enter

You’re done! The Device Driver setting is now modified.

Option 2 – Disable From Menus

I figured this was security that was built into Windows to prevent me from installing bad drivers. This is a feature called Device Driver Signing. After going through the steps to disable driver signing in Windows 8, I was able to get my community drivers installed. Here’s how I did it.

  1. Select the “Start” button.
  2. Type “startup”.
  3. Select “Change advanced startup settings“.
  4. Select “Restart now” under the “Advanced startup” area.
  5. Select “Troubleshoot“.
  6. Select “Advanced Options“.
  7. Select “Startup Options“.
  8. Select “Restart“.
  9. A menu will appear where you can press “7” on your keyboard to choose “Disable driver signing enforcement“.

Now Device Driver Signing should be disabled, allowing you to install any driver you like in Windows 10 until you reboot.

http://www.hackaapl.com/trouble-installing-windows-10-drivers-the-hash-for-the-file-is-not-present-fix-toggle-driver-signing/