Adding OLE file object's location and content  at run-time in crystal report

Posted on 2012-09-17
Last Modified: 2013-02-22

1)In my report I need to display the content of a file(could be any format) within crystal report. The location of a file is coming from database field. How can that be achieved?

2)Also while I was testing by putting an OLE object and linking it to a file, but when I previewed it  report is going blank. Need help on this also.
Question by:NoorFaz
    LVL 100

    Assisted Solution

    What version of Crystal?

    In CR XI, 2008, and 2011 you can link an OLE object to a file through a formula

    INsert the OLE Object
    Right click it
    Click the PICTURE TAB
       Click the formula button to the right of Graphic Location
        Select the field from the list

    LVL 34

    Expert Comment

    When you say "could be any format", do you mean graphic formats (JPG, BMP, etc.) or any format at all (BMP, DOC, XLS, XLSX, etc.)?

     Either way, I think older versions of CR only supported a limited number of file types.  I don't know about the newer versions.  So "any format" may not be possible, at least with the standard CR.

    LVL 100

    Expert Comment

    The formula for a grphic is limited to graphic files (no doc, xls, etc) and may even be limited to specific graphic formats.


    Author Comment

    Thanks guys for the help. I'm at crystal XI, I have to display the contents of basically text files, could be doc,txt,docx etc. How can I get the text from those files and display it on crystal report.
    LVL 100

    Assisted Solution

    You can use an OLE objetc but it can't be changed at runtime and it will only display page 1

    I believe Visual Cut from Millet Software can help

    LVL 1

    Accepted Solution

    I will be curious to know how Visual Cut can do this. We had a similar project a while ago. We were advised to buy this software but it didn't work for us.

    We found 2 other ways to handle this :
    1 . Initially we were able to resolve the issue by converting the word files to tiffs - each page in a separate tiff file. Then we added a picture in  the report details section and pointed the source to the right tiff file. We had to create a "links" table to maintain the links between the original word files and tiff files so the report was able to get all pictures and place them in a detail section OLE object. This was working fine at the beginning , but became a big burden with the number of files growing too much. The other problem was that because of the pictures the pdf files exported from crystal reports were too big and we had issues with the backups.

    2. We found a free tool which was able to join multiple crystal reports and PDF files and to create one combined pdf file. We had to divide the report to multiple reports because it is not possible to insert the pdf in the middle of the report and the way it works now is :
      run report 1
      add one (ore more) pdf files
      run report 2
      add one (ore more) pdf files
      run report N
      add one (ore more) pdf files

    In the past report 1, 2 ... N  were one big report , but since we were not able to insert the pdf files we had to separate the main rapport in pieces. The solution still has some restrictions - par example we can add just a complète page , but it is way better than the other one because the result is a pdf ( with normal size) and there is almost no maintenance - we are just adding/replacing files when this is necessary without converting everything to tiffs

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now