cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic MS Word into OLE Object

Former Member
0 Kudos

We are using a SQL Server database in which are are storing a Microsoft Word document as a type "image" (BLOB) field. What we need to do is now display the contents of the Microsoft Word document on a Crystal Report at runtime. We are using Visual Studio 2005.

Is it possible to read the Microsoft Word document out of the SQL Server "image" type field at runtime, and display it on the Crystal Report as an "OLE Object"? Since the contents of the Microsoft Word document can change at any time, this needs to be done at runtime so the most current information in the Microsoft Word document is displayed.

I have found a lot of posts and examples taking about "dynamic images at runtime", but I have not seen any indication that I can use the same methods to read the Microsoft Word document dynamically out of the database using these same methods.

Thank you for your help!

Accepted Solutions (1)

Accepted Solutions (1)

former_member208657
Active Contributor
0 Kudos

The first place for you to start is the Crystal Reports designer. Can you design the report there and get it to look the way you want? If you can't get it in the designer you won't be able to do it via code.

Changing images dynamically is built into the product via the Graphic Location property. Although the picture object is OLE like Word we don't support changing the graphic location for any other OLE object - such as Word or Excel.

Former Member
0 Kudos

I am trying to do a similar application where I specify a Word doc as an OLE object in a subreport. The content of the Word doc is updated by our engineers and gets placed into the report upon running the VS 2005 application, generating a pdf from the rpt.

This works fine in the development environment but when pushed to a server to run automatically, the OLE object is still pointing to the Word doc on my development machine (which does not include comments from the engineering staff).

I want the Word doc to reside in the same directory as the rpt file no matter where I place it. Is this possible? If not with OLE, then any other means? Another version of Crystal?

former_member183750
Active Contributor
0 Kudos

From my experience, this is the way inserted linked OLE objects will work:

The report searches for the OLE object in the expected path. If the object is not found, the report will search all available paths (and I believe this may include any shared network paths). This may lead to significant performance issues.

In your case, you would have to ensure that the OLE object is not available to the report from the development machine. Then place the OLE object into the same directory as the report on the client's computer. Since the report will not find the OLE object where it is expecting it to be, the report will search the path and if it finds the object, update the report with that object. Please note that even if you rename the OLE object on your development machine, the report will find it, so you have to remove that OLE object, or make that development machine unavailable to the report. (Tested with CR XI r2)

Ludek

Former Member
0 Kudos

I am also facing a similar problem. Iam using Crystal reports ver 11.0.0.1282 to create the report with word (.doc) OLE object (linked type) and view it via application written in VS2010.I tried this solution but when i delete the word document from the development box location and view the report in another computer, it shows the last edited word OLE object that was present in development box before deletion.

Please help.

Thanks in advance

Answers (0)