Need help urgent

Hi,

I'm using this code :

frReport1.LoadFromFile('order.frf');
with frReport1.Dictionary do
begin
Variables := StrToInt(Edit1.Text);;
Variables := StrToInt(Edit2.Text);
Variables := StrToInt(Edit3.Text);
Variables := StrToInt(Edit4.Text);
end;
with frReport1 do
begin
DefaultCopies := 1;
if Edit5.Text = '0' then
DefaultCopies := StrToInt(DM1.Relaties.FieldByName('Ordersets').AsString)
else
DefaultCopies := StrToInt(Edit5.Text);
end;
frReport1.PrepareReport;
if example then
frReport1.ShowReport
else
frReport1.PrintPreparedReportDlg;

Printing from within the 'ShowReport', everything goes well.
But printing direct (frReport1.PrintPreparedReportDlg) it gives the same error :

List index out of bounds(0)

It getting frustrating now.
How can i solve this ???

THANX !!

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:02AM
    hi before calling printprepared call prepare
    ie
    if example then
    frReport1.ShowReport
    else
    begin
    frreport1.preparereport;
    frReport1.PrintPreparedReportDlg;
    end;

    regards ;)
  • edited 8:02AM
    hi before calling printprepared call prepare

    Hi,
    Like you can see, that is already be done :

    frReport1.PrepareReport;
    if example then
    frReport1.ShowReport
    else
    frReport1.PrintPreparedReportDlg;

    But that is not the sollution.

Leave a Comment