Show report

Hi, I have some preblem here:

ADOQImpCodeBar(TADOQuery) have the Query:
SELECT
   itItem.Description, itItem.NoItem
FROM itItem
WHERE itItem.NoItem = :NoItem

frDBDSImpCodeBar(TfrDBDataSet)->DataSet is ADOImpCodeBar

frRImpCodeBar(TfrReport)->DataSet is frDBDSImpCodeBar

when i doubleclick on frRImpCodeBar and I click on preview report, it is perfect.

but when it is the code who try to Show it, it doesn't work. ;)

I will show you what I do:
ADOQImpCodeBar->Parameters->ParamByName("NoItem")->Value = edtNoItem->Text;
ADOQImpCodeBar->Open();

frRImpCodeBar->Title = "Code-barre";
if(!frRImpCodeBar->PrepareReport())
{
   ShowMessage("Error when prepare the report !");
}
frRImpCodeBar->ShowReport();

;)

I see the build of report but nothing is show.
(I haven't time to see if the build put 0 or 1 output)

Can you help me please? ;)

Comments

  • edited 8:14PM
    I have to find, this should be done:
    frRImpCodeBar->LoadFromFile(FilePath + ExtractFileName("ItemImpCodeBar.frf"));
    frRImpCodeBar->ShowReport();
    

    You should not forget to put the objects of which our report need. Like me, I have a BarCode in my report, then I must put TfrBarCodeObject (even not need to bind it to nothing) on my form. ;)

    Odd but it goes. ;)

Leave a Comment