cancel
Showing results for 
Search instead for 
Did you mean: 

Support of dynamic OLE objects like Word

patrick_simons2
Participant
0 Kudos

Hallo,

We need to add a Word file as OLE object into a Crystal Report which should be bound using the "graphic location"-formula based on another formula. So when setting this underlying formula with the path and filename using RAS, the word document (at least the 1st page) should be refreshed and printed.

Unfortunately this is not supported by CR, see KB:

3064879 - Cannot change Location Path of an Excel OLE Object in Crystal Reports

Does anyone know a workaround?

@Don: is there something planed in R&D to implement this feature in medium-term?

Thanks,

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

It should work the same way as Pictures.

The way it works in CR is you point to a database field in the source.

In the field is a PATH to the image you want to use, should work for OLE Objects also.

Hit the F1 key to open CR help file and search on:

Linked objects

Or a UFL as Ido suggested.

Too many work arounds so not likely will be Enhanced, if you want to post it to Influence (Enhancement Requests):

https://www.sap.com/about/customer-involvement/influence-adopt.html?sort=latest_desc

Answers (7)

Answers (7)

Hi Patrick,

As I noted a formula field will not update the image to point to a new file, the formula needs to point to a database field, in the field is a path to the image file.

Don

DellSC
Active Contributor
0 Kudos

I would recommend using a parameter for the path instead of updating it in code. That way you would set the parameter prior to running the report and should pick up the correct file from there. Or, as Don suggests below, use a database field in a formula in the image location.

-Dell

0 Kudos

Hi Dell,

Not sure if that would work though because the OLE Object is only loaded on the load event of the report itself. Although I have not tested this in along time so it may work.

Using the database field that points to the file location works because the Formula Field engine can evaluate the field and replace the object at run time.

Don

DellSC
Active Contributor
0 Kudos

Yeah, it's been a while since I've tested it too...

ido_millet
Active Contributor
0 Kudos

Patrick, I already implemented a UFL function to return a target page from a PDF file as an image.
For detail, see the user manual section.

You can use the same approach for a Word file.

patrick_simons2
Participant
0 Kudos

Hi Don,

Our ERP is already using inProc-RAS to switch the formula content at runtime. So a UFL won't help here, as far there exist other advantages...like forcing a refresh of a OLE object like Word?

Patrick

0 Kudos

User Function Library is a way for developers to create specific functions that CR doesn't have.

Use Google and search for this KBA:

1525014 - Sample C# .NET UFL and Localization Formula function

You can do almost anything with them including DB security etc.

You can't put the path in a formula, it has to reference a field in your DB with the path in it.

Image/OLE Objects are only refreshed when the report is opened, it won't refresh the image on Refresh.

Hit the F1 key and search for UFL, you'll find more info there as well.

patrick_simons2
Participant
0 Kudos

What will be the logic/idea behind the UFL?

I tried several possibilities to put the PATH in a CR-formula, but if the path changes, the OLE-object isn't updated/refreshed...

ido_millet
Active Contributor
0 Kudos

This can be solved using a UFL.