3. | If you are looking for saving .elp reports with user's consent - see this example. |
Full bug report (with screenshots, attached files, previous reports; it is usually stored packed inside a single .elp file) is generated only for sending. If you want to capture this file into local folder or network share, insert it into database, etc. even if sending was not performed (for example, user has selected "Do not send" button in a dialog) - then you can use this code:
uses
EDialog, // for RegisterDialogClassFirst
EDialogWinAPIMSClassic, // for TMSClassicDialog
ETypes; // for constants
type
// Subclass standard dialog class to alter EurekaLog behaviour.
// Of course, you should replace TMSClassicDialog with another
// appropriate class if you don't use MS classic dialog style
TMSClassicDialog = class(EDialogWinAPIMSClassic.TMSClassicDialog)
protected
function ShowModalInternal: TResponse; override;
end;
{ TMSClassicDialog }
function TMSClassicDialog.ShowModalInternal: TResponse;
var
X: Integer;
begin
Result := inherited;
// This happens when user clicks on "Details" link -
// one dialog has to be replaced with another
if Result.SendResult = srRestart then
Exit;
// Create files to be send even if no send is used
if (Failed(Ord(Result.SendResult))) or
(not CanSend) then
begin
PrepareFilesForSend;
// Copy all files attachments to some folder.
// Of course, folder must exist and be writable.
// Usually there is only one file (.elp), but it can be few files -
// depends on your project options
for X := 0 to FilesToSend.Count - 1 do
CopyFile(PChar(FilesToSend[X]),
PChar('N:\BugReports\' +
ExtractFileName(FilesToSend[X])), False);
end;
end;
initialization
// Register our class to be used by EurekaLog
RegisterDialogClassFirst(TMSClassicDialog);
end.
See also:
Send feedback...
|
Build date: 2024-09-30
Last edited: 2023-08-09
|
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation.
We do not use your e-mail address for any other purpose.
We will remove your e-mail address from our system after the issue you are reporting has been resolved.
While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback.
After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.
Permanent link to this article: https://www.eurekalog.com/help/eurekalog/how_to_always_create_elp.php
|
|