Dave Mitchell's DigitalMicrograph™ Scripting Website
When carrying out a systematic study on a series of specimens, it is desirable to record images at the same magnifications, to facilitate subsequent comparison. This script will interrogate the contents of a folder of DigitalMicrograph images (either .dm3 or .dm4) and report the magnifications used. Duplicate magnfications are not reported. Magnifications are sorted into TEM and STEM (if using DigiScan to acquire STEM images). Camera lengths from diffraction patterns are reported with the TEM data. All data are sorted from lowest to highest. Note any files which are not .dm3 or .dm4 are ignored. Nested folders containing DM images are ignored. You must select one DM file from within the folder you wish to analyse.
Updated in v2.0 to report the number of images at each magnification and the total number of images analysed and the number skipped (non .dm3 or .dm4 files).
Crystal Reports: Dynamic Images
Use a conditional formula to dynamically change the location of a report’s image.
- Add an image to the report (Insert | Picture). This image will act as a placeholder. Ensure that the placeholder is the same size as the one that will be dynamically loaded, otherwise the image will be scaled.
- Change the image’s Graphic Location:
- right click image
- select Format Graphic…
- select Picture tab
- click the conditional-formula button (looks like x+2)
- set the formula’s text to the name of the formula or parameter field that will contain the image’s URL
- save the formula and click the OK button
- Save the report
8 thoughts on “ Crystal Reports: Dynamic Images ”
I found your website from the answer submitted by you for question “Convertion of crystal reports to SSRS Report” in Stackoverflow.com.
I am looking for a option to develop a tool in VB.NET which would convert Crystal report object model to SSRS RDL model.
Hope you would help me in doing this. If you are interested in developing this, please let me know.
I am working on Visual Studio 2008 and My Crystal Report(10.5) Designer toolbox controls does not contain any control that serve as Image placeholder, instead if I use a picture control, it adds the image statically as an OLE control and does not allow me to change the URL dynamically.
The sample report for dynamic graphic doesnt work for me. (Crystal XI R2). A file from the web site http://www.cogniza.com is not displayed. If I pull the dynamic path from my c drive then that works fine. I read something about Crystal not sypporting dynamic web images accessed thru a proxy. Is that correct ?
Worked like a charm!
Thanks for posting this.
Its good and helping post. But In one scenarion I am setting one selection parameter in my app code and passing that parameter to main report.I am using one sub report to show some images of the same parameter(which I sent from App code).I have linked my subreport and main report properly and then applied your approach in my subreport.It displays all images dynamically for that parameter except first one.In place of first image it is showing the placeholder image(which I have inserted as step 1st).Any help will higly appreciated.Thanks Pradeep
I have same issue as Azfar Khan. I’m working with VS2005 and crystal report version 10.2.3600.0. I add a picture Insert > Picture. When I right-click on that picture, there’s no formula button in picture tab.
Is this because of crystal report version? How can I load picture dynamically without using dataset and datatable? Pls kindly advice.
My crystal report ignores the value specified in the formula and simply shows the original image no matter how hard I try. What could be the problem? Even your example which I downloaded behaves the same way.
I got this site from my buddy who told me concerning this web site and at the moment this time I am visiting this website and reading
I am using VS-2008 for asp.net web application. However, I have developed my reports in VS 2005. ( I am reusing some reports that were developed in other project).
The reports work fine except the image field is not displayed. The image field is a 'VARBINARY(MAX)' field in database. Note that when I export my Crystal Report to .pdf the images shows up in the .pdf file.
(* I am able to see an image url in 'Firebug' but getting message 'Load Image failed')
I am using a 'TypedDataset' as DataSource for the Crystal Report.
I fetch the data from database and do a 'DataSet.WriteXML(filename,WriteMode.WriteSchema)'
ned. The report is properly made, and in fact in Visual Studio I can see the report loading in the preview page. The problem comes when I try to open the page I have the report in my browser. Nothing displays. Not an error, nothing. Tried I
Here is the code:-
this question asked Jul 9 '12 at 6:50 sujimon 371 3 8 22 Html for the Image field from Firebug is :- <div class="ad7947c08a-5302-4857-9061-8656ab9f1e09-19quot; style="top: 3px; left: 351px; width: 75px; height: 76px;"9gt; <img height="76px9quot; border="09quot; width="75px9quot; alt="Image9quot; src="/taweb/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_c0ad7cce-209d-47c0-b11e-ca4a2cf9d21e.png9quot;9gt; </div9gt; – sujimon Jul 9 '12 at 7:50 |
For those of us running migrated projects from .Net 4.0 or lower to 4.5+ I have made an observation. It seems if your page that contains the viewer is in a subdirectory then the image urls are being generated relative to that page and not to the root of the web application. E.g if your page is /gl/accounts.aspx then the image may be /gl/crystalimagehandler.aspx etc A quick way to fix this is to change your handler mapping to a wildcard ending in crystalimagehandler.aspx or put the following code in Global.asax
this answer answered Sep 22 '14 at 23:01 Kofi Amparbeng 145 1 9 Good information but I got past this issue, but I will +1 your answer. Next time I will give your solution a try. – sujimon Sep 27 '14 at 10:11 |
ystalreportviewer. I need to display reports one after another. For example, if my first report has four pages then my second report should start from fifth page. I have tried to use sub-report, but it's displaying second report within the