cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to add a pdf dynamically in Crystal report at the end?

abhijit380
Explorer
1,537

Hi I am quite new in Crystal Report, I have been assigned with a task where I have to add a pdf file at the end of the crystal report. 

I tried searching on the internet and found some solution which were this and many more.

I like the way it was handled in this links(post). But I can only attach a static pdf file, If I try to do it dynamically it never changes. 

Here is the example.

I have a report as demo and 2 pdf files

abhijit380_0-1720518014700.png

In the report I have added PDF1 as OLE pdf file and then using graphic location I am trying to set the location of another pdf that is PDF2.

abhijit380_1-1720518145784.png

But If I try to run/refresh the report I am still getting the same file that was attached before(PDF1).

My goal is I have a db field PdfPath which holds the pdf path location like "C:\apps\pdf1.pdf" now I want to show the pdf according to this path.

I am using Crystal Report 2016.

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor

In that case, afaik, the only solution is to use a UFL (User Function Library). 

The report would have RFa, RFb, RFc, etc. for showing PDF Page 1, 2, 3, etc.
Each of these RF sections would be dynamically suppressed based on the number of pages in the PDF. 

If the report doesn't know the number of pages, a UFL get provide a function to get that number.

A dummy picture in each of the RF sections would use the Graphic Location  expression of the picture object to replace itself with the corresponding PDF page (or do nothing if the corresponding page number is higher than the actual number of pages). 

ido_millet
Active Contributor

Here's a video demo of how this is done using my CUT Light UFL.

abhijit380
Explorer
Hi @ido_millet I got the video that very helpful thank you very much. But while trying to install the Cut Light I am not able to its just showing(Follow the instruction received via email.). Can you please tell me how can I install it?
ido_millet
Active Contributor
This forum is not designed for private communications of that nature.

Answers (0)