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 10:48PM
    hi before calling printprepared call prepare
    ie
    if example then
    frReport1.ShowReport
    else
    begin
    frreport1.preparereport;
    frReport1.PrintPreparedReportDlg;
    end;

    regards ;)
  • edited 10:48PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.