Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Rave Reports 10.0 - Unexpected header code [66] found in report file


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0 Threads: [ Previous | Next ]
Andrew Pailthorpe

Posts: 36
Registered: 4/5/07
Rave Reports 10.0 - Unexpected header code [66] found in report file  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 14, 2014 4:52 AM
Hi All

I'm using Delphi XE2 and Rave Reports 10

On my Form I have RvRenderPreview1 linked to a ScrollBox

I call the following code:-
procedure TfrmReport_Contracts_Invoice.Print_Preview;
begin
with dmReport do
begin
RvSystem.DefaultDest := rdFile;
RvSystem.SystemSetups := RvSystem.SystemSetups - [ssAllowSetup];

RvSystem.RenderObject := RvRenderPreview1;
RvSystem.DoNativeOutput := False;

with RvProject do
begin
SelectReport('Contract_Invoice_Report', False);

SetParam('Mala_Company_Name', Maintenance_Accounts.TheName);
...
SetParam('Mala_Company_Address', Maintenance_Accounts.Get_Address_Multi_Lines);
RvSystem.SystemPrinter.Orientation := (poPortrait);

RvSystem.Execute; // This is the Key to envoking the Print method on the ReportDatamodule}
end;

RvSystem.SystemSetups := RvSystem.SystemSetups + [ssAllowSetup];
end;
end;

As this is potentially a multipage report the RvSystem.OnPrint event gets enoked which then executes the following code:-

procedure TdmReport.Contract_Invoice_Report(Sender: TObject);
begin
if Assigned(All_Client_Contract_Invoice_Report) then
begin
for m := 0 to All_Client_Contract_Invoice_Report.TotalObjects do
begin
with TClient_Contract_Invoice_Report(All_Client_Contract_Invoice_Report.ObjectList[m]) do
begin
if Checked then
begin
RvProject.SetParam('Contract_Invoice_Company_Name', Client_Name);
....
RvProject.SetParam('Contract_Invoice_Company_Address', Get_Address_Multi_Lines);

if Invoice_Frequency_Period-1 = 0 then
Periods := ' period.'
else
Periods := ' periods.';

RvProject.SetParam('Contract_Invoice_Service_Type', Con_Client_Contract_Invoice_Frequency_Periods[Invoice_Frequency_Period] +
' Service Works Invoice as per Maintenance agreement for ' + Invoice_MonthYears + Periods);
end
else
RvProject.SetParam('Contract_Invoice_Service_Type', 'To Credit against our Invoice no ' + IntToStr(Invoice_Number) + ' dated ' + DateToStr(Invoice_Date));
{$ENDREGION 'Contract Invoice Service Type'}

{$REGION 'Contract Invoice Values'}
RvProject.SetParam('Contract_Invoice_For_The_Agreed_Sum_Of', DisplayBlankIfZeroMonetry(Invoice_Amount));
RvProject.SetParam('Contract_Invoice_VAT_Percentage', DisplayBlankIfZeroPercentage(VAT_Used) + '%');
VAT_Amount := ((Invoice_Amount * VAT_Used) / 100);
RvProject.SetParam('Contract_Invoice_VAT_Amount', DisplayBlankIfZeroMonetry(VAT_Amount));
RvProject.SetParam('Contract_Invoice_Total_Invoice_Amount', DisplayBlankIfZeroMonetry(Invoice_Amount + VAT_Amount));

{$ENDREGION 'Contract Invoice Values'}

RvProject.ExecuteReport('Contract_Invoice_Report');
// Not the last record? then create a new page
if (m <> All_Client_Contract_Invoice_Report.TotalObjects) then
(Sender as TBaseReport).NewPage;
end;
end;
end;
end;
end;

Can the RvRenderPreview1 display the built in options Print, Next Prev etc like the Print Preview does?

When I call the RvRenderPreview1.NextPage I get "Unexpected header code [66] found in report file"

Any ideas why?

Displaying the Same report via the same code in a Rave Print Preview works fine (using the built in navigation and options).

tia
Andrew

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02