Dynamically loading binary image of report source file

Post Author: ChristopherZ1
CA Forum: .NET
I have stored all my .rpt files as varbinary images in a SQL 2005 DB.  I can retrieve the image write it to disk then load the report. i.e.
Private m_RptDoc As New ReportDocument()
m_RptDoc.Load(RptPathName). 
My question is...is there a way to load the image directly into the ReportDocument without first writting it to disk and using the pathname?

I would think that this crummy custom Image class hack would work, but surprise surprise -- the width/height in loaderInfo is flat out WRONG when the event fires. It seems to have a hard coded width/height no matter what the file size. Silly!
<mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
     <mx:Script>
          <![CDATA[
               public function init():void {
                    this.addEventListener(Event.COMPLETE, loaded);
               private function loaded(e:Event):void {
                    this.width = this.loaderInfo.width;
                    this.height = this.loaderInfo.height;
          ]]>
     </mx:Script>
</mx:Image>
Turns out, this version DOES work (but it's still a hack fix in my opinion):
<mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
     <mx:Script>
          <![CDATA[
               public function init():void {
                    this.addEventListener(Event.COMPLETE, loaded);
               private function loaded(e:Event):void {
                    this.width = this.contentWidth;
                    this.height = this.contentHeight;
          ]]>
     </mx:Script>
</mx:Image>
You guys at Adobe are so silly.    It would seem to me that Image's width and height should be set (rather than left at 0) once the content's width and height is known.  So now that I've fixed this bug (as far as I'm concerned) for ya Adobe, I take cash, cashier's check, or money orders--thanks!
But really, if this doesn't work this way in Flex 4, I think it should.

Similar Messages

  • How do I save Lightroom image edits in source file?

    My experience with the trial version of lightroom is very positive in terms of the convenient and powerful capabilities for editing images and the associated metadata.  But I can't find a way to save the "develop" edits to images into the source file for the photo I am working with.  So far, I am able to save the metadata into the file but not the image editing.  From what I read, I fear this is not possible without silly round about exporting to new files then copying / moving multiple copies around, etc. Without this ability, I am pretty sure I will not purchase lightroom and will miss out on all the powerful features.  Without an OPTION that turns on the equivalent of a SAVE button, managing my photos collection would be a nightmare. 
    So my question is: How do I save the edited (i.e., developed) version of a photo back into the same file where the original photo was stored?
    Please, please spare me all the reponses telling me how stupid I am for wanting to do this and that the cognisenti and professionals would NEVER do this.    But please just tell me there is a secret place to turn on this option in lightroom.
    Thanks in advance.

    I had the same requirement to save in JPEGs files all non-metadata edits performed in Lightroom, in order to share modified pictures without duplicating files. By the way, I think it’s going to be more and more required by casual Lightroom users, as people get used to instant photo sharing in many situations where quantity matters more than quality
    Here’s a nearly automatic (at least, scalable) solution that works, although it slightly lowers the quality by re-compressing the original pictures.
    Once for all:
    Download and install the wonderful Lightroom plugin “jf Run Any Command”, provided as donationware by Jeffrey Friedl here: http://regex.info/blog/lightroom-goodies/run-any-command. This “export filter” plugin allows you to run a command of your choice with each exported file, as part of the export while it’s going on. (You may also browse Jeffrey’s blog to find many other useful and beautiful things.)
    In Lightroom, pre-define an export settings as follows:
    Export to the hard drive, to the original picture folder, without adding the exported file to the catalog
    Name the exported file “EXPORTED-{Filename}” (or anything different from the original file name)
    JPEG format, 76% quality (see An Analysis of Lightroom JPEG Export Quality Settings at http://regex.info/blog/lightroom-goodies/jpeg-quality)
    Keep all metadata
    Here’s the interesting part, the Run Any Command settings:
    Command to execute for each exported picture: copy "{FILE}" "{Path}\{LIBRARYFILENAME}" (this replaces the original file with a copy of the exported file)
    Command to execute upon export completion: del {FILES} (this deletes all exported files).
    NB: One could wonder why not directly export with the original file name and silently replace the original files (I believe Lightroom would allow this). It’s just a matter of error handling: in case the export goes wrong, no original file is changed at all.
    The easy part: each time you want to save edits:
    In Lightroom, select the pictures to save, and export them with the pre-defined settings. You're almost done. The JPEG files are ok, but inside Lightroom you see the modification effects doubled, as their specifications remain in the catalog database and they apply on modified JPEG instead of the original files.
    While the entire set of "saved" pictures is still selected, in the Develop module switch Autosync on and click Reinit to erase all modification specifications from the catalog for all pictures, then press CTRL-S to write down to disk any metadata updated by Lightroom -and accept if required to confirm that Lightroom values should replace externally set values.
    Stephane
    PS: Papa Ben, I'm curious about the decision you  finally made

  • Loading an image in from a file

    Hi,
    I am trying to load an image in from a file, I have found an example using the following code:
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.io.BufferedInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    public final class MainClass {
      private MainClass() {
      public static Image getImage(Class relativeClass, String filename) {
        Image returnValue = null;
        InputStream is = relativeClass.getResourceAsStream(filename);
        if (is != null) {
          BufferedInputStream bis = new BufferedInputStream(is);
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          try {
            int ch;
            while ((ch = bis.read()) != -1) {
              baos.write(ch);
            returnValue = Toolkit.getDefaultToolkit().createImage(
                baos.toByteArray());
          } catch (IOException exception) {
            System.err.println("Error loading: " + filename);
        return returnValue;
    }Is this a good way of doing it? I want to load a series of images in from files, so I can later do a comparison against them. I am just wondering how to go about the whole process?
    Many thanks, Ron

    Can you store multiple images in memory and be able
    to reference them all individually, or is it better
    to store them in a construct, such as an array and
    then loop through that when attempting to match?I'm sorry but I don't understand the question. And does it
    have anything to do with images per se? Can it be generalized
    without losing its meaning:
    Can you store multiple objects in memory and be able
    to reference them all individually, or is it better
    to store them in a construct, such as an array and
    then loop through that when attempting to match?It seems to me that multiple objects should be stored in
    an appropriate collection, if that is what is required.
    Perhaps you need to say more about what you are trying to
    do, what your goal is, to make your question meaningful.

  • How to load binary content of a .class file?

    Hello everyone,
    I want to load the binary content of a .class file in a dynamic approach. In more detail, I want it to work in the following approach. When given the name of a class, I can retrieve the binary content of the .class file. I have written the following sample but it does not work. Can anyone help to find what is wrong with my sample? How to achieve my goal?
    String className = this.getClass().getName();
    InputStream inputStream = this.getClass().getResourceAsStream (className);When executing the above code, the inputStream is always returned as "null".
    Thanks in advance,
    George

    Thanks ruthf104,
    I haven't tested this, but I think you will need to
    transform the class name
    "test.Foo"
    into the resource path
    "/test/Foo.class"
    ie change '.' to '/', append '/' at the beginning
    and ".class" at the end.
    See the following paragraph from the
    Class.getResourceAsStream specification:
    "This method delegates the call to its class loader,
    , after making these changes to the resource name: if
    the resource name starts with "/", it is unchanged;
    otherwise, the package name is prepended to the
    resource name after converting "." to "/". If this
    object was loaded by the bootstrap loader, the call
    is delegated to
    ClassLoader.getSystemResourceAsStream."
    By these rules, the method will not be able to
    automatically transform the class name into a
    resource path for you (it doesn't append the
    ".class"), so you'll have to do it yourself.I have verified that your approach is working!
    regards,
    George

  • Dynamic load of images in to established Timeline effect

    Is it possible to dynamicly load images in to an already
    established timeline effect?
    Steps I've done.
    Stuffed a JPG in to the library by draging and dropping it in
    to the SWFs library.
    Dropped the JPG on to the main stage
    Right clicked the image then going down to Timeline effects
    and choosing an effect.
    Completing any changes in effects dialogue box and then
    clicking OK.
    Play the movie, and pat myself on the back that it worked.
    So then, how can I get Actionscript to load an image
    dynamically in to that same Timeline effect and have it do the
    effect to that instead of the one found in the library?
    I'm using Flash MX Professional 2004.

    hii
    Can u mention the error message getting while the status become RED??
    As what I understand, this may be the issue of invalid characteristics inPSA Data Records or also there may be records that does not support the lower case or upper case data.
    So just check the data in PSA Level
    Thanks
    Neha

  • Image processor: "No source files could be opened by Photoshop."

    I am also getting a "There were no source files that could be opened by Photoshop" warning when trying to save jpegs of open images (opened from a PDF) using the image processor.
    Here is what I'm doing:
    1. Open multiple pages of a PDF into Photoshop
    2. Run the Image Processor with settings:
    - Use open images
    - Save to "select folder location" (choose a valid location)
    - Save as jpegs
    3. Run
    And it gives me the warning. How can the files not be opened by Photoshop. They already are?!?

    JJ, thanks for the response, and my guess is you are correct. It would be nice if Adobe would change this. My whole intention of using the Image Processor in this case was to "batch save" all the open files. As far as I know, there isn't another way to do that without creating an action or other such nonsense. ; )
    At any rate, thanks for your input and explanation. At this point, I suppose the issue is as good as solved.

  • Is Dynamic Loading of Text from an external file possible in Captivate?

    Hello all,
    I am wondering if Dynamic loading of text is possible in captivate or not.
    As we can load an external file in flash.
    & which is the universal font to be used for the text entry box which will visible on any media?
    Thanks & Regards,
    Chirag

    Hello,
    I'm not a specialist about JavaScript. Have a look at Jim Leichliter's blog:
    http://captivatedev.com/
    Lilybiri

  • SQL*Loader - Skipping columns in the source file.

    Hi
    I have a comma delimted source file with 4 columns. I however only want to load columns 2 and 3 into my table using SQL*Loader. This seems like something that should be fairly simple but I can't seem to find any doc or examples of this.
    Any guidance would be appreciated.
    Thanks
    Dave

    Hello Dave,
    Here is a sample of what you'll need to have in your control fileLOAD DATA
    APPEND
    INTO TABLE <target_table>
    FIELDS TERMINATED BY ','
    ( column_1  FILLER
    , column_2
    , column_3
    , column_4  FILLER
    )Hope this helps,
    Luke

  • Newbe Question: Setting a cursor image from a source file

    I have a panel that is dynamiclly loaded with images from files. I wanted to set the cursor to the image, originally I was going to load a sprite with the image and have it follow the cursor but I figured that it might be better using the CursorManager. I've used the cursormanager with a image that is embed as a class but I'm having a problem doing it from the spark image object. Any suggestions?
    Thanks,
    Bubba

    Ok guys - managed to solve my problem - used the following code:
    try {
    FileReader file = new FileReader("C:/wherever ya put your file");
    BufferedReader in = new BufferedReader(file);
    String line;
    while((line = in.readLine()) != null) {
    groupMonth = line;
    in.close();
    }catch (Exception e) {}
    I then used the setText() function to assign the value to the JLabel.
    All is well :P
    Chuck
    P.S Thanks for the pointer it certainly helped.

  • How to dynamically load an Image into a TableView when its row/cell becomes visible?

    Hi,
    I am building an application that shows tables with large amounts of data containing columns that should display a thumbnail. However, this thumbnail is supposed to be loaded in the background lazily, when a row becomes visible because it is computationally too expensive to to this when the model data is loaded and typically not necessary to retrieve the thumbnail for all data that is in the table.
    I have done the exact same thing in the past in a Swing application by doing this:
    Whenever the model has changed or the vertical scrollbar has moved:
    - Render a placeholder image in the custom cell renderer for this JTable if no image is available in the model object representing the corresponding row
    - Compute the visible rows by using getVisibleRect and rowAtPoint methods in JTable
    - Start a background thread that retrieves the image for the given rows and sets the resulting BufferedImage in a custom Model Object that was used in the TableModel (if not already there because of an earlier run)
    - Fire a corresponding model change event in the EDT whenever an image has been retrieved in the background thread so the row is rendered again
    Btw. the field in the model class holding the BufferedImage was a weak reference in this case so the memory can be reclaimed as needed by the application.
    What is the best way to achieve this behaviour using a JFX TableView? I have so far failed to find anything in the API to retrieve the visible items/rows. Is there a completely different approach available/required that uses the Cell API? I fail to see it so far.
    Thanks in advance for any hints here.

    Here’s what I have tried so far:
    I have defined a property in my model object that contains a weak reference to the image that is expensive to load. I have modeled that reference as an inner class to the object so I have a reference to its enclosing object. That is necessary because my cell factory otherwise has no access to the enclosing model object, which it needs to trigger loading the image in the background.
    The remaining problems I have is, that I don’t have sufficient control over the loading process, i.e. I need to delay the loading process until scrolling has stopped and abort it as soon as the user starts scrolling again and the visible content changes. Imagine that loading an image for a table row (e.g. a thumbnail for a video) takes 200ms to load and a user quickly scrolls through a few hundred records and then stops. With my current set-up, the user has to wait for all loading processes that were triggered in the cell factories to finish until the thumbnails of the records they are looking at will appear (imagine an application like finder to be implemented like that, it would simply suck UX-wise). In my swing application a background thread that loads images for the visible records is triggered with a delay and stopped as soon as the visible content changes. This works well enough for a good user experience. I don’t see how I can do this based on the cell API. It is nice to have all this abstracted away but in this case I do not see how I can achieve the same user experience as in my swing application.
    I also tried registering a change listener to the TreeCell’s visible property to make that control the image loading but I don’t seem to get any change events at all when I do that.
    I must be missing something.

  • Is it possible to dynamically load an image/resources embed in a SWF?

    Hi all,
       i have created a flex library project, just containing images (.GIF)...etc.
       And i create another flex application project that merge the .GIF files into the final SWF application.
      based on the current time, i want to display different pictures (e.g. sun.GIF, moon.GIF, star.GIF...etc..there are many images) in the application right-top corner.
      as, i know, <mx:image/> just work with static image reference for embedded resource.
    (<mx:image source="@Embed('sun.GIF'))"/>).
      i search by google, it seems that, for embedded image or resource, you can't load it dynamically.
      the following code don't work.
      e.g. var mmm:Image = new Image();
                   mmm.source = fileName;
                   mmm.load();
      anybody find the solution???
      thank you.
    ppk luk

    Hi,
      i have tried this method before, but, again, it don't work for embedded resource. IO error will be thrown, with error message.
    IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2036: Load Never Completed. URL: file:///E:/Flex/TmpAssetApp/bin-debug/@Embed(source='images/sun.GIF')"]
    (the GIF is in a folder called images)
    SWFLoader/Loader can only load file dynamically from URL, but not embedded resource?? (by syntax @Embed(source='xxx'))??
    my sample code:
    =======================================
    <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                [Bindable]
                private var fileName:String = "@Embed(source='images/last.GIF')";
                 * Show the image
                private function showImage(event:flash.events.MouseEvent):void{
                    fileName = fileTxt.text;
                    dynaLoader.source = "@Embed(source='" + fileName + "')";
                    //dynaLoader.addEventListener(flash.events.Event.COMPLETE, ss);
                    //dynaLoader.addEventListener(flash.events.IOErrorEvent.IO_ERROR, ff); 
                    dynaLoader.load();
                private function ss(event:flash.events.Event):void{
                        mx.controls.Alert.show("result1\n" + event);
                private function ff(event:flash.events.IOErrorEvent):void{
                        mx.controls.Alert.show("result2\n" + event);
            ]]>
        </mx:Script>
        <mx:SWFLoader height="305" left="10" right="10" bottom="10" id="dynaLoader" autoLoad="true" source="{fileName}" ioError="ff(event)" complete="ss(event)"/>
    =======================================
       Do you know any other solution?
      thank you.
    ppk luk

  • HELP!! NEWBIE - Dynamically load jpg images - NEWBIE Question.

    Newbie here.
    Im currently making a flash website. and trying to make it as light as possible.
    so decided to load images dynamically.
    Im using UILoaders.
    I drag the UILoader from components into the main timeline and set the source as 1.jpg, because the image is in the same folder as the .fla file.
    and scale - false
    Tested the movie but nothing shows up. i guess i need some coding? but i dont know where to add the codes. on the same frame? or in frame 1?
    i also need the image to fade-in.
    the end result im looking for is, as i click a button. 3 images show up at the same time, fading in.
    Help, greatly appreciated.
    and thanks in advance

    thanks your the reply,
    the source is set to 1.jpg i put a image file named 1.jpg into the same as the fla. and swf and everything.
    the UILoader is visible in frame 55 or so. and as i click a button the pic is suppose to show , but it doesnt??
    the jpg is also non-progressive..
    any idea why its not working?

  • Loading an Image from a local File (AIR/Flex)

    var f:File = (assume it's a valid image file reference)
    var i:Image = new Image();
    i.source = f.nativePath;
    Kinda makes sense right? Except it doesn't display properly when the image is added unless I also specify a width and height on the new Image. This may not be a problem in many applications that hard code the size anyway, but I want to use the actual size of the image, without rescaling.
    i.width = whatever;
    i.height = whatever;//But I don't want to hard code these values, I want "actual" image size!
    Anyone know of a way to get around this problem? Am I missing a step here? Web resources on this specific topic are very lacking.

    I would think that this crummy custom Image class hack would work, but surprise surprise -- the width/height in loaderInfo is flat out WRONG when the event fires. It seems to have a hard coded width/height no matter what the file size. Silly!
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.loaderInfo.width;
                        this.height = this.loaderInfo.height;
              ]]>
         </mx:Script>
    </mx:Image>
    Turns out, this version DOES work (but it's still a hack fix in my opinion):
    <mx:Image xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
         <mx:Script>
              <![CDATA[
                   public function init():void {
                        this.addEventListener(Event.COMPLETE, loaded);
                   private function loaded(e:Event):void {
                        this.width = this.contentWidth;
                        this.height = this.contentHeight;
              ]]>
         </mx:Script>
    </mx:Image>
    You guys at Adobe are so silly.    It would seem to me that Image's width and height should be set (rather than left at 0) once the content's width and height is known.  So now that I've fixed this bug (as far as I'm concerned) for ya Adobe, I take cash, cashier's check, or money orders--thanks!
    But really, if this doesn't work this way in Flex 4, I think it should.

  • Adding Image in Report RDF file

    Hi Friends
    Using Form and report 6
    I want to takeout the report in oracle, Report is generating good, with the same time i want to add company's logo on the report so everytime while taking out the report logo should also print.
    Please suggest the best solution it is urgent...
    sanjay

    Report is generating goodThen you should not have problem to generate RDF file. Images are kept in RDF or PDF output.

  • Dynamic Loading of image-Works in Designer bt fails when viewed in infoview

    Dear All,
    I am trying the display Dynamic Image by setting the property of OLE Object "Format Graphic -> Picture -> Graphic Location Property. I am retrieving the image using  an web application (which is developed in .Net platform). When I set the URL and preiview the report in Crystal Designer it works fine, but when I publish the report to info view it fails. The report displayes the original Image which was used while inserting the object in the report.
    The sample URL to retrieve image is mentioned below;
    http://<Server Name>/getmyimage.aspx??PID=&FID=ac1788f2-40a8-4b93-ae9b-48c2ef7b6287.JPG&W=335&H=145&ZI=0&ratio=1&TIMESTAMP=20101025T110523Z&random=0.9074388616085233
    I searched the forum topic and found several posts.
    One of the resolution I understed was to replace u2018?u2019 with u2018??u2019 so that the parsing of image will be done accurately. I also tried this but it could not resolve issue.
    I am using Crystal 2008 for report development and BOE server version is BO XI 3.1 with SP 1 and FP 1.6. The server is running on Solaris Server.
    Looking forward for any solution/suggestion/clues on this.
    Thank you,
    With Regards,
    Sachin Dalal
    Edited by: SachinDDalal on Nov 13, 2010 1:09 PM
    Edited by: SachinDDalal on Nov 13, 2010 3:01 PM

    Hello Sachin,
    Did you find any solution for this...please let me know, yaar
    Really appreciate it
    Regards,
    Kamal

Maybe you are looking for

  • My keyboard freezes after using the option key... what gives?

    I have a 17" MacBookPro with OSX 10.6.8 The problem:   My keyboard key freeze after using the " option key"  in Photoshop or  when downloading a file using the option key. I can usually use it 2 or 3 times before it makes a chirping cricket like soun

  • How do you determine what version of  the Darwin Kernel, iOS 4.3.3 uses in iPod Touch?

    I tried looking this up in "Settings" > "General" > "About" but it doesn't give me this information. Someone told me that he has Darwin Kernel 11.0.0 for his iPod Touch running iOS 4.3.3, but his iPod Touch is jailbroken. My iPod Touch isn't jailbrok

  • Imbedded link to downloadable .PDF file not working in Safari

    Two questions: I imbedded a text link that is supposed to download a .PDF file from my iDisk. However, when I click the text link from my Safari browser I get this error message: ""A network error occurred while accessing this document on the Interne

  • How to filter rows according to calculated key figures in cube?

    in my cube , i use V3 update for scheduleding lines of sales items.For example , in last delta update , valid row is last column ,other two rows make zero each other for key figures but i dont want to display first two rows in Bex.i want to get rid o

  • OT: .htaccess files on a Mac

    Can anyone tell me what steps you followed to get .htaccess files with mod-rewrite rules to work on a Mac? I'm using the MAMP package, but I decided to stick with Apple's default Apache installation, since my virtual hosts work with it but not with M