Dephi and Quickreport and you want to close the quickreport after printing [SOLVED]

Hi guys, just wanted to share a quicky solution for an age old problem of closing the quickreport after clicking the print button.

This feature allows the system to record all report generated report by the user without allowing them to reprint the same report again if the preview report is seen on the screen.

There are 2 parts to this solutions. 1 is function that will be called. 2 is the function to be called during the afterprint procedure in the quickreport

part 1 – function

procedure CloseAllReportPreviews;
var
  i: Integer;
begin
  try
    for i := Screen.FormCount - 1 downto 0 do
    if Screen.Forms[i].ClassName = 'TQRStandardPreview' then
    begin
      Screen.Forms[i].close;
    end;
  except
    ShowMessage('Please close all existing reports');
  end;
end;

part 2 – afterprint in quickreport

procedure TQuickReport.QuickRepAfterPrint(Sender: TObject);
begin
    CloseAllReportPreviews;
  end;
end;

Enjoy

Coffee Cup

Delphi Quickreport Disabling Load and Save buttons [SOLVED]

A recent client of mine insisted that he wanted the app to remove the load and save button for the quickreports.

After searching for around 2 hours, i found the solution from mr.wu

So thank you mr.wu

Here is the code

another way can solve this problem.
(1)append
    uses  ...QRPrntr, QRPrev,...
(2)complete the OnPreview method for the QuickRep as following:
procedure TqrpLabelGrader.QuickRep1Preview(Sender: TObject);
var
  qrStandardPreview: TQRStandardPreview;
begin
  qrStandardPreview:=TQRStandardPreview.CreatePreview(Self, TQRPrinter(Sender));
  qrStandardPreview.SaveReport.Enabled := False;
  qrStandardPreview.LoadReport.Enabled := False;
  qrStandardPreview.Show;
end;
HPH,
wu yong

Enjoy

Coffee Cup

http://www.delphigroups.info/2/b2/390705.html

ClipboxTab , SmoothSearch , Dexpredict , FreeCounterStat [FIXED]

Recently one of the websites i was handling started to show strange. When you load the main page, and click with any link or part of the website, it redirects to another page outside of the website.

At first i was puzzled what was causing it. I thought the website has been infultrated or hacked. But it seems everything is still intact.

I separated the main page and tried to dismantle it from there. And you know, what i was the cause, it was a php counter that i got into the website. It seems to be in sleep mode until around 3 years later.

Here are some of the links when you get redirected

https://dexpredict.com/jump/next.php?r=3001031
https://www.smoothsearch.online/install?pubid=2777&productid=30551&clickid=US168345805110000TPHTV422920713914V18
https://clipboxtab.com/install?pubid=2777&productid=30570

Now i know you are dying to know the source. And here it is

https://www.freecounterstat.com

The website gives out a link that you embed in your website

<div id="sfcybjc22f3ctd27lelnzssl4fl8422sw7h"></div>
<script type="text/javascript" src="https://counter10.optistats.ovh/private/counter.js?c=ybjc22f3ctd27lelnzssl4fl8422sw7h&down=async" async></script>
<noscript>
<a href="https://www.freecounterstat.com" title="free hit counter">
<img src="https://counter10.optistats.ovh/private/freecounterstat.php?c=ybjc22f3ctd27lelnzssl4fl8422sw7h" border="0" title="free hit counter" alt="free hit counter">
</a>
</noscript>

The culprit is the first line of the code

<div id="sfcybjc22f3ctd27lelnzssl4fl8422sw7h"></div>

So that’s it. Hope somebody don’t need to learn it the hard way. It’s better you create your own page counter. Either using php & mysql or a txt file to store the current value.

Coffee Cup

Delphi Error – E2151 Could not load RLINK32.DLL

Delphi Error – E2152 Wrong or corrupted version of RLINK32.DLL

  • fatal error saying:
    Internal Error LA30
    Access violation at address 0A3CA3E5 in module ‘RLINK32.DLL’
    Read of address 0C5C01F0

What steps you can do

  • Deleting .dcus and rebuilding all of your packages
  • removed all DCU, and .res files, and rebuilt,
  • third party component packages interfering

I hope you are helped by these suggestions. Drop me a line if you want to ask questions.

Enjoy

Coffee Cup

How to set up my Razer Seiren Mini

Recently i have acquired a Razen Seiren Mini to test voice recording without any background noice and clear crisp quality. Hera are the steps on how to install on your pc.

To set up your Razer Seiren Mini, follow the steps below.

  1. Take the device out of the box and assemble the base.
  2. Fasten it securely to the thread mount of your Razer Seiren Mini.
  3. Connect the microphone to the USB port of your PC using the Micro-USB to USB cable.
  4. Right-click on the sound icon on the system tray of your PC and select “Open Sound settings” and set Razer Seiren Mini as the default Input device.

https://support.microsoft.com/en-us/windows/fix-microphone-problems-5f230348-106d-bfa4-1db5-336f35576011

  1. Open Start > Settings > System > Sound
  2. In the input, select a microphone to see its properties.
  3. In the input volume, please make sure the blue bar adjusts as you speak into the microphone.
  4. If it doesn’t, go to Test your microphone and Start test.

Enjoy

Coffee Cup

Windows 10 100% Disk Usage Problem [FIXED] 

FIX-Windows-10-100-Percent-Disk-Usage-Problem

Sometimes you encounter a PC that when you look at the task manager, you go ‘holy cow!’, it’s running on 100% disk usage for a long, long time.

Believe me, that’s quite normal but solvable.

Here are the steps that I did to help bring it down.

1. Press   + R and type devmgmt.msc in the Run, hit Enter key to open Device Manager snap-in.

Device Manager Windows 10

2. In the Device Manager window, expand IDE ATA/ATAPI controllers and right click on Standard SATA AHCI Controller, select Properties.

FIX Windows 10 100 Percent Disk Usage Problem

3. In the property sheet, switch to Driver tab and click Driver Details.

FIX Windows 10 100 Percent Disk Usage Problem

4. If the Driver File Details window shows storahci.sys driver listed there, it means you’re running inbox driver and hence it is possible to disable MSI mode. Click OK.

FIX Windows 10 100 Percent Disk Usage Problem

5. Back on the property sheet, switch to Details tab. Against Property, select Device instance path from drop-down and note down the Value mentioned there.

FIX Windows 10 100 Percent Disk Usage Problem

6. Press  + R and put regedit in Run dialog box to open Registry Editor (if you’re not familiar with Registry Editor, then click here). Click OK.

Windows 10 Registry Editor

7. In the Registry Editor window, navigate to following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\<AHCI Controller Value>\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties

Substitute <AHCI Controller Value> we got in step 5.

FIX Windows 10 100 Percent Disk Usage Problem

8. In the right pane of MessageSignaledInterruptProperties key, look for the registry DWORD (REG_DWORD) named MSISupported which should be corresponding to Value 1 as its Data. Double click on the DWORD to modify its value:

FIX Windows 10 100 Percent Disk Usage Problem

9. Finally, set the Value data as 0 and click OK. Close Registry Editor and reboot. After restarting your machine, the 100% disk usage problem should disappear.

Thanks to this link

https://www.kapilarya.com/fix-windows-10-100-percent-disk-usage-problem

Enjoy

Coffee Cup

Tips to Free Up RAM or memory on Your Windows 10

Working in the IT industry, i have encountered a lot of people still using old units fitted with Windows 10 software. As expected, it runs a wee tiny bit slower than usual. That’s why these tips are all over the web. Here is my take on freeing up RAM or memory

> Restart Windows 10 after running it for some time
> Disable startup apps in task manager
> Scan for malware using your favourite A/V software
> Adjust virtual memory (caution for non tecky persons)
> Alternative is to install more ram (its getting a bit cheaper nowadays)
> Reduce visual effects (yes it affects also)
> Stop background apps running by toggling YES or NO to programs
> Disable SysMain in the Services App
> Close the unused tabs open in your browser (somehow they are not solving this one > anytime soon)
> Defragment your hard drive (a bit time consuming but effective)
> Disk cleanup (this cleans the junk files in your temp folder)
> Uninstall applications not used anymore

Hope it helps

Coffee Cup

#1005 – Can’t create table ‘xxxxxx’ (errno: 150) [SOLVED]

If you are using xampp and you encounter this message during creation of a table, i have found that a lot of them pertain to the unit used to reference the field. If the master table used INT (11), when you reference it as a foreign key, you also need to use the same unit INT(11) as well.

In my case it was different. You see, i got this message because the table I used as a foreign key is the table ‘item’ whereas originally it was table ‘item_list’.

So just in case you encounter this one and still have problems, it might be the table name.

Learn and move forward

Coffee Cup

PHP Reload Page After 10 Seconds

Here is my take on the question, how to refresh the page after 10 seconds

Enjoy

Coffee Cup

<script type="text/javascript">

  var timeout = setTimeout("location.reload(true);",10000);
  function resetTimeout() {
    clearTimeout(timeout);
    timeout = setTimeout("location.reload(true);",10000);
  }
  
</script>  

PHP Code for FB Plugin

Here is the code I used in integrating the fb plugin using iframe into the website.

Please replace the fields that require your actual account.

I also included an html tag .

Enjoy,

Coffee Cup

https://developers.facebook.com/docs/plugins/like-button


JavaScript SDK


Step 1: Include the JavaScript SDK on your page once, ideally right after the opening body tag.
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v14.0" nonce="F1YcA0n6"></script>
Step 2: Place this code wherever you want the plugin to appear on your page.
<div class="fb-like" data-href="https://www.facebook.com/PoshMotorcycleShop" data-width="200" data-layout="standard" data-action="like" data-size="small" data-share="true"></div>


IFrame

<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FPoshMotorcycleShop&width=200&layout=standard&action=like&size=small&share=true&height=35&appId" width="200" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>




For Android the URL schema is:

fb://page/page_id
For iOS the URL schema is:

fb://page?id=page_id






https://developers.facebook.com/docs/plugins/like-button

<html>
<head>
  <title>Your Website Title</title>
    <!-- You can use open graph tags to customize link previews.
    Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
  <meta property="og:url"           content="https://www.your-domain.com/your-page.html" />
  <meta property="og:type"          content="website" />
  <meta property="og:title"         content="Your Website Title" />
  <meta property="og:description"   content="Your description" />
  <meta property="og:image"         content="https://www.your-domain.com/path/image.jpg" />
</head>
<body>

  <!-- Load Facebook SDK for JavaScript -->
  <div id="fb-root"></div>
  <script async defer crossorigin="anonymous" 
        src="https://connect.facebook.net/en_US/sdk.js#xfbml=1
             &version={graph-api-version}
             &appId={your-facebook-app-id}
             &autoLogAppEvents=1" 
        nonce="FOKrbAYI">
  </script>

  <!-- Your like button code -->
  <div class="fb-like" 
       data-href="https://www.your-domain.com/your-page.html" 
       data-width=""
       data-layout="standard" 
       data-action="like" 
       data-size="small"  
       data-share="true">
  </div>

</body>
</html>