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
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
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.
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.
Take the device out of the box and assemble the base.
Fasten it securely to the thread mount of your Razer Seiren Mini.
Connect the microphone to the USB port of your PC using the Micro-USB to USB cable.
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.
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.
2. In the Device Manager window, expand IDE ATA/ATAPI controllers and right click on Standard SATA AHCI Controller, select Properties.
3. In the property sheet, switch to Driver tab and click Driver Details.
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.
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.
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.
7. In the Registry Editor window, navigate to following registry key:
Substitute <AHCI Controller Value> we got in step 5.
8. In the right pane of MessageSignaledInterruptProperties key, look for the registry DWORD (REG_DWORD) named MSISupported which should be corresponding to Value1 as its Data. Double click on the DWORD to modify its value:
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.
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.
Thought of saving this one here. For those who still use delphi in 2023, here are the features you can access. Just in case you have questions or issues encountered, just drop me a line
Coffee Cup
...control Excel with OLE?
Autor: Thomas Stutz
[ Print tip ]
Tip Rating (503):
uses
ComObj;
var
ExcelApp: OleVariant;
implementation
procedure TForm1.Button1Click(Sender: TObject);
const
// SheetType
xlChart = -4109;
xlWorksheet = -4167;
// WBATemplate
xlWBATWorksheet = -4167;
xlWBATChart = -4109;
// Page Setup
xlPortrait = 1;
xlLandscape = 2;
xlPaperA4 = 9;
// Format Cells
xlBottom = -4107;
xlLeft = -4131;
xlRight = -4152;
xlTop = -4160;
// Text Alignment
xlHAlignCenter = -4108;
xlVAlignCenter = -4108;
// Cell Borders
xlThick = 4;
xlThin = 2;
var
ColumnRange: OleVariant;
// Function to get the number of Rows in a Certain column
function GetLastLine(AColumn: Integer): Integer;
const
xlUp = 3;
begin
Result := ExcelApp.Range[Char(96 + AColumn) + IntToStr(65536)].end[xlUp].Rows.Row;
end;
begin
{ Start Excel }
// By using GetActiveOleObject, you use an instance of Word that's already running,
// if there is one.
try
ExcelApp := GetActiveOleObject('Excel.Application');
except
try
// If no instance of Word is running, try to Create a new Excel Object
ExcelApp := CreateOleObject('Excel.Application');
except
ShowMessage('Cannot start Excel/Excel not installed ?');
Exit;
end;
end;
// Add a new Workbook, Neue Arbeitsmappe ?ffnen
ExcelApp.Workbooks.Add(xlWBatWorkSheet);
// Open a Workbook, Arbeitsmappe ?ffnen
ExcelApp.Workbooks.Open('c:\YourFileName.xls');
// Rename the active Sheet
ExcelApp.ActiveSheet.Name := 'This is Sheet 1';
// Rename
ExcelApp.Workbooks[1].WorkSheets[1].Name := 'This is Sheet 1';
// Insert some Text in some Cells[Row,Col]
ExcelApp.Cells[1, 1].Value := 'SwissDelphiCenter.ch';
ExcelApp.Cells[2, 1].Value := 'http://www.swissdelphicenter.ch';
ExcelApp.Cells[3, 1].Value := FormatDateTime('dd-mmm-yyyy', Now);
// Setting a row of data with one call
ExcelApp.Range['A2', 'D2'].Value := VarArrayOf([1, 10, 100, 1000]);
// Setting a formula
ExcelApp.Range['A11', 'A11'].Formula := '=Sum(A1:A10)';
// Change Cell Alignement
ExcelApp.Cells[2, 1].HorizontalAlignment := xlright;
// Change the Column Width.
ColumnRange := ExcelApp.Workbooks[1].WorkSheets[1].Columns;
ColumnRange.Columns[1].ColumnWidth := 20;
ColumnRange.Columns[2].ColumnWidth := 40;
// Change Rowheight / Zeilenh?he ?ndern:
ExcelApp.Rows[1].RowHeight := 15.75;
// Merge cells, Zellen verbinden:
ExcelApp.Range['B3:D3'].Mergecells := True;
// Apply borders to cells, Zellen umrahmen:
ExcelApp.Range['A14:M14'].Borders.Weight := xlThick; // Think line/ Dicke Linie
ExcelApp.Range['A14:M14'].Borders.Weight := xlThin; // Thin line D邦nne Linie
// Set Bold Font in cells, Fettdruck in den Zellen
ExcelApp.Range['B16:M26'].Font.Bold := True;
// Set Font Size, Schriftgr??e setzen
ExcelApp.Range['B16:M26'].Font.Size := 12;
//right-aligned Text, rechtsb邦ndige Textausrichtung
ExcelApp.Cells[9, 6].HorizontalAlignment := xlright;
// horizontal-aligned text, horizontale Zentrierung
ExcelApp.Range['B14:M26'].HorizontalAlignment := xlHAlignCenter;
// left-aligned Text, vertikale Zentrierung
ExcelApp.Range['B14:M26'].VerticallyAlignment := xlVAlignCenter;
{ Page Setup }
ExcelApp.ActiveSheet.PageSetup.Orientation := xlLandscape;
// Left, Right Margin (Seitenr?nder)
ExcelApp.ActiveSheet.PageSetup.LeftMargin := 35;
ExcelApp.ActiveSheet.PageSetup.RightMargin := -15;
// Set Footer Margin
ExcelApp.ActiveSheet.PageSetup.FooterMargin := ExcelApp.InchesToPoints(0);
// Fit to X page(s) wide by Y tall
ExcelApp.ActiveSheet.PageSetup.FitToPagesWide := 1; // Y
ExcelApp.ActiveSheet.PageSetup.FitToPagesTall := 3; // Y
// Zoom
ExcelApp.ActiveSheet.PageSetup.Zoom := 95;
// Set Paper Size:
ExcelApp.PageSetup.PaperSize := xlPaperA4;
// Show/Hide Gridlines:
ExcelApp.ActiveWindow.DisplayGridlines := False;
// Set Black & White
ExcelApp.ActiveSheet.PageSetup.BlackAndWhite := False;
// footers
ExcelApp.ActiveSheet.PageSetup.RightFooter := 'Right Footer / Rechte Fu?zeile';
ExcelApp.ActiveSheet.PageSetup.LeftFooter := 'Left Footer / Linke Fu?zeile';
// Show Excel Version:
ShowMessage(Format('Excel Version %s: ', [ExcelApp.Version]));
// Show Excel:
ExcelApp.Visible := True;
// Save the Workbook
ExcelApp.SaveAs('c:\filename.xls');
// Save the active Workbook:
ExcelApp.ActiveWorkBook.SaveAs('c:\filename.xls');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
// Quit Excel
if not VarIsEmpty(ExcelApp) then
begin
ExcelApp.DisplayAlerts := False; // Discard unsaved files....
ExcelApp.Quit;
end;
end;