Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

List index out of bounds (0) Exception using TExtraDevices

edited November 2001 in General
Hi:

I am trying to create a PDF ReportStream using ReportBuild 6.02 and
TExtraDevices.

I got the above error without the TExtraOptions component on my WebModule.

If I add the component to my WebModule, then I got EClassNotFound Exception.

The following is my code:

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.Content := PDF_Report;
Response.ContentType := 'application/pdf';
Response.SendResponse;
Handled := True;
end;

function TWebModule1.PDF_Report: string;
begin
with ppReport1 do
begin
DeviceType := 'PDFFile';
if Publisher.Devices[0].InheritsFrom(TExtraDevice) then
(Publisher.Devices[0] as TExtraDevice).PrintToStream := True;
end;
OraSession1.Open;
OraQuery1.Open;

ppReport1.Print;
with (ppReport1.Publisher.Devices[0] as TExtraDevice).ReportStream do
begin
SetLength(Result, Size);
Read(Pointer(Result)^, Size);
end;
end;

Can someone tell me what I have done wrong?

TIA,
Ping Kam

Comments

  • edited November 2001
    Waler told me to put the TXComp after txtradev unit in the uses clauses and it
    solved the EClassNotFound problem. Maybe it work to you too.

  • edited November 2001
    Guillermo Casta?o A wrote in message
This discussion has been closed.