If DBImage is blank
I have the following code:
procedure TScansbig.Button9Click(Sender: TObject);
var
// Code : Integer;
user1, dateandname ,Text, fromemail2, toemail, host : String;
filename1, filename2, filename3, filename4, filename5, filename6 : string;
begin
imageno := 'Scan1';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename1 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename1;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan2';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename2 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename2;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan3';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename3 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename3;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan4';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename4 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename4;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan5';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename5 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename5;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan6';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename6 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename6;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
form_Main.kuRAFMerge1.SourceFiles.Clear;
form_Main.kuRAFMerge1.SourceFiles.Add(filename1);
form_Main.kuRAFMerge1.SourceFiles.Add(filename2);
form_Main.kuRAFMerge1.SourceFiles.Add(filename3);
form_Main.kuRAFMerge1.SourceFiles.Add(filename4);
form_Main.kuRAFMerge1.SourceFiles.Add(filename5);
form_Main.kuRAFMerge1.SourceFiles.Add(filename6);
form_Main.kuRAFMerge1.DestinationFile := 'c:\temp\' +
form_Main.DBEdit2.Text + '.raf';
form_Main.kuRAFMerge1.Execute;
form_Main.ppArchiveReader1.ArchiveFileName := 'c:\temp\' +
form_Main.DBEdit2.Text + '.raf';
form_Main.ppArchiveReader1.ShowPrintDialog := true;
form_Main.ppArchiveReader1.DeviceType := 'Screen';
form_Main.ppArchiveReader1.TextFileName := 'c:\temp\' +
form_Main.DBEdit2.Text + '.pdf';
form_Main.ppArchiveReader1.Print;
form_Main.ppArchiveReader1.ArchiveFileName := '';
end;
This combines all the 6 reports into 1. I need to check if the ppDBImage is
blank and not merger that page.
ie if ppDBImage is blank in say report 5 do not merge this page into the
document.
Cheers
Steve Warburton
procedure TScansbig.Button9Click(Sender: TObject);
var
// Code : Integer;
user1, dateandname ,Text, fromemail2, toemail, host : String;
filename1, filename2, filename3, filename4, filename5, filename6 : string;
begin
imageno := 'Scan1';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename1 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename1;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan2';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename2 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename2;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan3';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename3 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename3;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan4';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename4 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename4;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan5';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename5 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename5;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
imageno := 'Scan6';
form_Main.ppDBImage3.DataField := imageno;
form_Main.ppReport_onescan.DeviceType := 'Archivefile';
filename6 := 'c:\temp\' + form_Main.DBEdit2.Text + '_' + imageno
+'.raf' ;
// showmessage(filename1);
form_Main.ppReport_onescan.ArchiveFileName := filename6;
form_Main.ppReport_onescan.ShowPrintDialog := false;
form_Main.ppReport_onescan.Print;
form_Main.kuRAFMerge1.SourceFiles.Clear;
form_Main.kuRAFMerge1.SourceFiles.Add(filename1);
form_Main.kuRAFMerge1.SourceFiles.Add(filename2);
form_Main.kuRAFMerge1.SourceFiles.Add(filename3);
form_Main.kuRAFMerge1.SourceFiles.Add(filename4);
form_Main.kuRAFMerge1.SourceFiles.Add(filename5);
form_Main.kuRAFMerge1.SourceFiles.Add(filename6);
form_Main.kuRAFMerge1.DestinationFile := 'c:\temp\' +
form_Main.DBEdit2.Text + '.raf';
form_Main.kuRAFMerge1.Execute;
form_Main.ppArchiveReader1.ArchiveFileName := 'c:\temp\' +
form_Main.DBEdit2.Text + '.raf';
form_Main.ppArchiveReader1.ShowPrintDialog := true;
form_Main.ppArchiveReader1.DeviceType := 'Screen';
form_Main.ppArchiveReader1.TextFileName := 'c:\temp\' +
form_Main.DBEdit2.Text + '.pdf';
form_Main.ppArchiveReader1.Print;
form_Main.ppArchiveReader1.ArchiveFileName := '';
end;
This combines all the 6 reports into 1. I need to check if the ppDBImage is
blank and not merger that page.
ie if ppDBImage is blank in say report 5 do not merge this page into the
document.
Cheers
Steve Warburton
This discussion has been closed.
Comments
Inside the Band.BeforePrint try checking if the field value is NULL. If
not, add the file name to a list and loop through the list later only
merging the files with a valid image. This will require a bit of a
re-design in your code below.
Another option would be to directly access the dataset and check the value
of the Scan1, Scan2,... etc. fields as you print.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
if form_Main.ppDBImage3.Pitcure <> NULL then
form_main.ppReport_onescan.print
but I get an error
What is the correct syntax please?
if myDBImage.Picture.Graphic.Empty then
// no picture
else
// picture loaded
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com