cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports - Using OLE Objects in a Subreport

Former Member
0 Kudos

I need a Crystal Reports subreport of mine to show a (.PDF File, MS Word File, or a MS Excel File) as a static OLE object within my Crystal Report.

I am using a LIMS database that will be sending this subreport a different file each and every time the report is executed / run.

I tried using the Graphic Location formula pointer to have the placeholder image replaced by what ever file is sent each time the report is executed.

I also tried using the Hyperlink formula box with the File option selected to have the placeholder image replaced by what ever file is sent each time the report is executed.

My LIMS database stores all the files in a directory on a server within my company and all my end users have access to this directory. It is a shared directory.

All users have reading privileges to the network directory as well.

Any help would be great!

Thank You.

Accepted Solutions (0)

Answers (2)

Answers (2)

abhilash_kumar
Active Contributor
0 Kudos

Hi Stephen,

Well, I see that this is getting more and more popular!

If your .pdf was actually an image (.jpg,.bmp etc), the Graphic Location formula could have been put to use.

Unfortunately, this does not work for .pdf or for that matter .doc, .rtf or .xls files the way it does for images.

So, the only workaround is to insert the .pdf files in separate sections and conditionally supress them.

Please have a look at this thread where I posted a workaround as to how this needs to be done using sections. That's the only way this can be done for now.

Otherwise, you can log this as an idea at https://ideas.sap.com and have our developers have a look at it.

I'm sure there'll be many who want this feature badly. Please do post the Enhancement.

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Hello Abhilash,

If I had my end users convert all their files to (.jpg images) prior to uploading them into our LIMS database, what would the crystal syntax be for a formula to replace my placeholder image that is configured in my existing crystal report - under the "Format Graphic Editor/Picture Tab" (Graphic Location / X-2 / Formula Editor Graphic Location)?

The way our LIMS database currently is configured to handle these specific graphical image file uploads is that, our LIMS database saves the files on its server.

The folder that the LIMS database copies these files to is a shared folder that all my end users have access to.

The crystal report subreport will have an OLE static object that is a "default image placeholder".

This image is to be replaced by what the LIMS database field (doc_file.df_filename) has each and every time the report is run.

So this means that every time the report is run from numerous unique Sample IDs, a different image will be displayed in the report for that particular testing.

So I am using the "Format Graphic Editor/Picture Tab" (Graphic Location / X-2 / Formula Editor Graphic Location) to write my formula. I need help with the sytax of this formula.

Thanks

Stephen

818-576-3117

abhilash_kumar
Active Contributor
0 Kudos

Hi Stephen,

So, the database hold the path to the .jpg files or the image itself?

If it's the path then you can do something like this:

For eg: Consider this dataset:

Id          Name          Image

1          Abhilash     C:\Images\1.jpg

2          Stephen     C:\Images\2.jpg

Then, you create a formula like this:

"C:\Images\"&{Id}&".jpg"

So, if you observe, the image names are similar to the IDs. This is what helps us to map them to the ID dynamically.

How are the images named in your folder and do you have a column with a similar name in the database?

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Hello Abhilash,

The LIMS database does hold the path to the .jpg files.

The LIMS database field itself simply contains a link to the file that is located on our local LIMS server.

The image files will all have different names since they are coming from various sources.

We do not have a column with a similar name in the LIMS database.

Our LIMS database copies all the uploaded image files to this location on its server:

server name\D:\BlazeLIMS Data\Attachments\BlazeLIMS\TestDoc

I did variations of this formula with no success:

"D:\BlazeLIMS Data\Attachments\BlazeLIMS\TestDoc\" + ({doc_file.df_filename}) + "Image.jpg"

abhilash_kumar
Active Contributor
0 Kudos

Hi Stephen,

If the database field contains the absolute path to the image, then just use that in the formula.

For eg:

'"'&{database_field}&'"'

- Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Hey Stephen,

Just to let everyone know, this was resolved by modifying the formula to use a 'UNC' path to the shared drive.

The database table held the Image name, for e.g: (Apple.jpg).

Once we modified the 'Graphic Location' formula to point to the UNC path alongwith the fieldname, the image came up fine.

I would appreciate if you could mark this thread as Answered...

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Hello Abhilash,

Here is the formula that finally worked:

"\\Server Name\TestDoc\" & {doc_file.df_filename}

I also had to adjust the sharing and user privileges to the shared network directory where the LIMS database stores the image files.

Thank you.

Stephen

Former Member
0 Kudos

Abhilash,

Do you know how to mark threads as "Answered"?

It is not straight forward on SAP's site.

Thanks

Stephen

former_member183750
Active Contributor
0 Kudos

Just hit the <Correct Answer> button on the response most applicable.

- Ludek

Former Member
0 Kudos

Hello Ludek,

Correct Answer and Helpful Answer are not visible nor are they present on my pages when I am logged into my SAP account and looking through my Activity.

Former Member
0 Kudos

As you can see, I have no viewable buttons for Correct Answer or Helpful Answer...

former_member183750
Active Contributor
0 Kudos

Sorry Stephen - not sure, but the SCN support team should be able to help:

http://scn.sap.com/community/support

- Ludek

JasonLax
Product and Topic Expert
Product and Topic Expert
0 Kudos

This thread was created in SCN Support, which is the support space for SAP Community Network and not SAP products.  Please always select an appropriate space where topic experts will see and reply to it: SCN Site Index

Meanwhile, I've moved this thread to

Former Member
0 Kudos

Thank you Jason.