Printing error and preview window freez

edited August 2009 in FreeReport
hi,

I just got FreeReport 2.33 on Delphi 7 (win xp sp2)

I made a simple report. Used ManualBuild to make a table. Everything works perfectly on PDFCreator (aka printer). But then I try to print on the real one (samsung ML-2851ND hooked on the server with a samba share) I get that error EListError: "List Index Out Of Bounds (0)".

it happens on line 6343 in FR_Class:
procedure TfrReport.PrintBeforeModal(Sender: TObject);
begin
DoPrintReport(FPageNumbers, FCopies);
frProgressForm.ModalResult := mrOk; // <--- that line i think
end;

After that error preview window won't repaint anymore. non of the buttons works except Close button.

if ShowProgress is set to true, then there is a messagebox with text "printing page:" and Cancel button.
well, it isn't printing... waited for like 30 minutes [img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> so, every time then I press the Cancel button I get one more Out Of Bounds error on line 656 in FR_View: FormResize(nil); for i := 0 to TfrEMFPages(EMFPages).Count - 1 do // <[/img]
that line
begin
TfrEMFPages(EMFPages).Visible := False;
TfrEMFPages(EMFPages).Draw(i, Canvas, Rect(0, 0, 0, 0));
end;
PBox.Repaint;


So, what I am doing wrong? or what is so different between PDF printer and the real one?
real printer is working, i tested it from other applications.

Any help would be highly appreciated.

UPDATE:
errors happens when i select different printer. if I in designer select the samsung printer, then the error occurs then I try to print on pdf printer.


My program Source code:
//==============================================================================
procedure TmainForm.printClick(Sender: TObject);
begin
cRep.ShowReport;
end;

procedure TmainForm.cRepGetValue(const ParName: String;
var ParValue: Variant);
begin
if ParName = 'repTitle' then
ParValue := _('Clients Report')
else if ParName = 'pageFooterText' then
ParValue := _('Footer Text')

else if ParName = 'h1' then
ParValue := mainForm.SG.Cells[0,0]
else if ParName = 'h2' then
ParValue := mainForm.SG.Cells[1,0]

else if ParName = 'v1' then
ParValue := mainForm.SG.Cells[0,pRow]
else if ParName = 'v2' then
ParValue := mainForm.SG.Cells[1,pRow];
end;

procedure TmainForm.cRepManualBuild(Page: TfrPage);
var
i:integer;
begin
Page.Clear;
Page.ShowBandByType(btReportTitle);
Page.ShowBandByName('MHead');

for i:=1 to mainForm.SG.RowCount-1 do begin
pRow := i;
Page.ShowBandByName('MData');
end;
end;
//==============================================================================

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.