Exporting an updated image exports the orginal image in FR5 - C++ Builder

edited November 2015 in FastReport VCL 5
I want to change the bitmap or canvas in a FR form before I export it. I am trying to update an image (normaly it will be png or jpg) and want to exprot the final result as a PDF. This code below works well but it always exports the PDF with original picture of the Report while I can see the loaded picture in the Picture1 on the preview.
void __fastcall TForm1::UPDATEClick(TObject *Sender)
{
	TfrxPictureView *picv;
	TfrxComponent   *PV;

	Image1->Picture->LoadFromFile("ship.bmp");

	PV  = frxReport1->FindObject("Picture1");

	if(PV)
	{
		picv = new TfrxPictureView(PV);
		picv->Center = true;
		picv->Width = Image1->Picture->Width;
		picv->Height = Image1->Picture->Height;
		picv->Picture->Assign(Image1->Picture);

	}

	if( frxReport1->PrepareReport(true) )
	{
		frxPDFExport1->FileName="testx.pdf";
		frxPDFExport1->ShowDialog = false;
	        frxReport1->Export(frxPDFExport1);
	}
}

Also Preview export do same as below. What should I have to do to export PDF with an updated image ?

frxPreview1->Lock();
frxPreview1->Export(frxPDFExport1);
frxPreview1->Unlock();

Comments

  • edited November 2015
    This is solved by the code below, Thanks anyway;
    TfrxPictureView *picv = dynamic_cast <TfrxPictureView *> (frxReport1->FindObject("Picture1"));
    	picv->Picture->Assign(Image1->Picture);
    
    	TfrxMemoView *mem = dynamic_cast <TfrxMemoView *> (frxReport1->FindObject("Memo1"));
    	mem->Text ="TESTINGGG";
    
    	if( frxReport1->PrepareReport(true) )
    	{
    		TfrxCustomExportFilter *oExportFilter = dynamic_cast <TfrxCustomExportFilter*> (frxPDFExport1) ;
    		oExportFilter-> ShowDialog = false;
    		oExportFilter->FileName = "testZ.pdf";
    		frxReport1->Export(oExportFilter);
    	}
    

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.