How to show a compressed image in the report?

Hi
I have created a new report.what i do in application is i  compress the image and save it in database.now i need to retrieve the compressed image and display in the report. I have used the following code to decompress the binary data save in the image.I
dont know after that what should i do. Please help me to show the picture in SSRS Report. I need to show picture in many reports.one of my doubt is how to call this function in SSRS Report. The function accepts input as byte but in database the column in varbinary.
should i convert the input type of function to varbinary instead of byte array? Please help me.
Public Function Decompress(ByVal arr As Byte()) As Byte()
Dim notCompressed As Boolean
notCompressed = False
Dim MS As MemoryStream
MS = New MemoryStream()
MS.Write(arr, 0, arr.Length)
MS.Position = 0
Dim stream As GZipStream
stream = New GZipStream(MS, CompressionMode.Decompress)
Dim temp As MemoryStream
temp = New MemoryStream()
Dim buffer As Byte() = New Byte(4096) {}
While (True)
Try
Dim read As Integer
read = stream.Read(buffer, 0, buffer.Length)
If (read <= 0) Then
Exit While
Else
temp.Write(buffer, 0, buffer.Length)
End If
Catch ex As Exception
notCompressed = True
Exit While
End Try
End While
If (notCompressed = True) Then
stream.Close()
Return temp.ToArray()
Else
Return temp.ToArray()
End If
End Function
Thanks & Regards Manoj

Please try this 
Public Function Decompress(ByVal arr As Byte()) As Byte()
        Dim s As Byte()
        Dim notCompressed As Boolean
        notCompressed = False
        Dim MS As System.IO.MemoryStream
        MS = New System.IO.MemoryStream()
        MS.Write(arr, 0, arr.Length)
        MS.Position = 0
        Dim stream As System.IO.Compression.GZipStream
        stream = New System.IO.Compression.GZipStream(MS, System.IO.Compression.CompressionMode.Decompress)
        Dim temp As System.IO.MemoryStream
        temp = New System.IO.MemoryStream()
        Dim buffer As Byte() = New Byte(4096) {}
        While (True)
            Try
                Dim read As Integer
                read = stream.Read(buffer, 0, buffer.Length)
                If (read <= 0) Then
                    Exit While
                Else
                    temp.Write(buffer, 0, buffer.Length)
                End If
            Catch ex As Exception
                notCompressed = True
                Exit While
            End Try
        End While
        If (notCompressed = True) Then
            stream.Close()
            Return temp.ToArray()
        Else
            Return temp.ToArray()
        End If
    End Function
Thanks & Regards Manoj

Similar Messages

  • How to show a background image in the Forms 6i MDI window?

    Hello,
    We are using Oracle Forms 6i Release 2 Patch 18 on Windows XP in client/server environment (not web server).
    Is there any way to show a background image in the MDI root window without using DLL injection to subclass the MDI root window procedure.
    Kurt

    Please try this 
    Public Function Decompress(ByVal arr As Byte()) As Byte()
            Dim s As Byte()
            Dim notCompressed As Boolean
            notCompressed = False
            Dim MS As System.IO.MemoryStream
            MS = New System.IO.MemoryStream()
            MS.Write(arr, 0, arr.Length)
            MS.Position = 0
            Dim stream As System.IO.Compression.GZipStream
            stream = New System.IO.Compression.GZipStream(MS, System.IO.Compression.CompressionMode.Decompress)
            Dim temp As System.IO.MemoryStream
            temp = New System.IO.MemoryStream()
            Dim buffer As Byte() = New Byte(4096) {}
            While (True)
                Try
                    Dim read As Integer
                    read = stream.Read(buffer, 0, buffer.Length)
                    If (read <= 0) Then
                        Exit While
                    Else
                        temp.Write(buffer, 0, buffer.Length)
                    End If
                Catch ex As Exception
                    notCompressed = True
                    Exit While
                End Try
            End While
            If (notCompressed = True) Then
                stream.Close()
                Return temp.ToArray()
            Else
                Return temp.ToArray()
            End If
        End Function
    Thanks & Regards Manoj

  • Customizing Slideshows - how do I add an image in the text box that only shows up for a specific ima

    Customizing Slideshows - how do I add an image in the text box that only shows up for a specific image and not in every text box?

    Can you maybe provide a screen shot to further explain your question?
    Julia

  • How can I attach an image without the image is in the email body? (using the new mail the Lion)

    How can I attach an image without the image is in the email body? (using the new mail the Lion)
    I want in attachment, not in the body mail.

    I think your only solution is to zip the image files first and then attach them.
    Read this from a site I found:
    Sending Graphical Attachments -- When you attach a graphical image to your message, the recipient of your message sees the image inline (that is, in the body of the message) if her email client supports inline display. ("Take Control of Email with Apple Mail" contains a table listing the capabilities of popular Mac and PC email clients.) If a client does not support inline display (or the recipient has turned off the inline display option), the file appears as an attachment that must be opened in a separate program.
    On the one hand, an inline image is easier for the recipient to see - all she has to do is look at it. On the other hand, inline images can be frustrating to scroll through. If you do not wish to send a graphical image inline, you must compress the file before attaching it - Mail, sadly, lacks a built-in compression option, though fortunately for Panther users, the Finder offers Zip compression without requiring a separate application.
    Note that when you compose a new message, Mail always shows attachments in the body of your message. You can manually drag them somewhere else, but many email clients display all attachments in a separate list, regardless of where you place them in the message body.
    If you paste an image into a message or drag & drop an image from another window (say, a Web browser), Mail converts the raw image data to an attachment in TIFF format. On the other hand, if you drag & drop the icon of an image file (or use the Attach button to locate the file using the file browser), Mail leaves the attached image in its original format. This difference is significant, because although most email clients can display JPEG images just fine, support for TIFF - especially in non-Mac email clients - is less common. If possible, I suggest attaching image files as opposed to pasting or dragging in raw image data.

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • How to display multi-channel image in the 'proxy'?

    There're many examples to show how to display composite channels in the 'proxy'. But I don't find any example to show how to display multi-channel image in the 'proxy'. I found that I can use PSPixelOverlay to display alpha channel data like this:
    int nSpotChannel = gChannelCount - 4;
    PSPixelOverlay* overlay = new PSPixelOverlay[nSpotChannel];
    for(int i = 0; i < nSpotChannel; i++){
           if( i != (nSpotChannel - 1) )
                 overlay[i].next = overlay + i + 1;
           else
           overlay[i].next = NULL;
           overlay[i].data = gChannelData + (4 + i) * nPlaneBytes;
           overlay[i].rowBytes = gProxyRect.Width() * gDocDesc->depth / 8;
           overlay[i].colBytes = 1;
           overlay[i].r  = 230;
           overlay[i].g = 161;
           overlay[i].b = 174;
           overlay[i].opacity = 255;
           overlay[i].overlayAlgorithm = kStandardAlphaOverlay;
    pixels.pixelOverlays = overlay;
    Then, Seeing red part, it will trigger a new problem, that is how to get the color value of the alpha channel by plung-in itself? It seems that no channel color value info is in FilterRecord.
    If you have other solution, please tell me. Many thanks!

    This is what I've been doing - was just curious if there was a way to see a more cohesive image.
    If the individual EQ plugins are in fact the answer, is there any way to smooth how the Analyzer displays? The image I posted above, all of the tonal curves are very smooth. The analyzer tool shows a lot of peaks and valleys within the overall curve and it's hard to pinpoint each instrument's "sweet spot." Vocals for example are very hard to spot.
    - Morgan

  • How to show an Default Image in case of Image  src attribute is pointing to  null

    Hi ,
    I am displaying Images on to DataGrid by reading an XML File .
    This works fine if the Image src is prsent.
    Now my question is that sometimes the Image  src might be null , then in which case i need to
    display some default Image .
    <mx:HBox id="hBox">
    <mx:Image source="{rep.currentItem.@src}"/>
    </mx:HBox>
    <images>
    <image src="images/One.png" />
    <image src="images/Two.png"/>
    <image src=""/>
    </images>
    Please tell me as how to show an Default Image in case of Image  src attribute is null .
    Please share your ideas on this .
    Thanks in advance .

    bind the image source to a function
    <mx:Image source="{getImage()}"/>
    then write a function to detect if an image is present
    private function getImage():String
         if  ( rep.currentItem.@src == null)
              return "default.png";
         else
              return rep.currentItem.@src;

  • How do I substract an image at the time t with an image at t-1 to detect move in a grab acquisition

    After the VI acquire in a grab acquisition, how do I substract an image at the time t with an image at t-1 to detect the movement in the scene?

    Hello,
    One way of doing that is to do a ring acquisition with two buffers. At anytime one of your buffers will be the most current frame and the other will be one before the most current. Having both buffers available at anytime in your code you can call IMAQ Subtract.
    Hope this helps!
    Yusuf C.
    Applications Engineering
    National Instruments

  • In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    There are a number of third party solutions for this.  I just use Bridge, so can't recommend one in particular.

  • How do you add an image in the signature

    Hi,
    How do you add an image to the signature area.
    The Insert/edit image is not available when in My Settings | Personnel Info | Signature
    Regards
    Ray Farmer

    You need to link the image.  See the example for the Canada flag below.
    <img src="http://forums.ni.com/ni/attachments/ni/130/6908/1/Canada-small.PNG" border=0>
    Replace with the image you like.  This goes into the signature box within the profile tab of the personal settings.
    RayR

  • How can I get an image from the screen? Like screen printer in PC to pasting after in word or other program.

    How can I get an image from the screen? Like screen printer in PC to pasting after in word or other program.

    If you do Cmd+Shift+3 you'll get a full screen image saved to your desktop as a jpg file.
    Also, you can use Cmd+Shift+4 and you'll get a cursor which you click+drag to draw a box. When you release the drag the boxed in area will be saved to the Desktop as a jpg file.

  • How do you set a image in the background of a JTextfield?

    How do you set a image in the background of a JTextfield? Any ideas?

    You can't thats why it is called textfield!!!
    Take a look at JScrollPane API for this

  • How do you set an image into the background of a JPanel or JFrame?

    How do you set an image into the background of a JPanel or JFrame?

    Something like this, Ive thrown in an ImageIcon on a
    button too for good measure.
    import java.awt.*;
    import javax.swing.*;
    public class JFrameImage extends JFrame {
    public JFrameImage() {
    Container c    = getContentPane();
    JPanel panel = new JPanel(){
                 public void paintComponent(Graphics g)     {
    ImageIcon img = new
    = new ImageIcon("background.jpg");
                      g.drawImage(img.getImage(), 0, 0, null);
                      super.paintComponent(g);
            panel.setOpaque(false);
    ImageIcon icon = new ImageIcon("onButton.jpg");
    JButton button = new JButton(icon);
    panel.add(button);
    c.add(panel);
    public static void main(String[] args) {
    JFrameImage frame = new JFrameImage();
    frame.setSize(200,200);
    frame.setVisible(true);
    Going totally fancy pants
    ImageIcon bigImage = new ImageIcon(bgImage.getImage().getScaledInstance(getWidth(), getHeight(),Image.SCALE_REPLICATE));
    g.drawImage(bigImage.getImage(), 0, 0, this); Will scale the image to the size of the panel
    whereas
    for (int y = 0; y  < getHeight(); y = y + image.getHeight(null))
    for (int x = 0; x< getWidth(); x = x + image.getWidth(null))
    g.drawImage(image, x, y, this); Will give a tiled effect
    Try tiling with an animated gif and bring your processor to a standstill.

  • How do I duplicate an image on the main screen so that I can edit it and compare the result with the original?

    In Elements 12 How do I duplicate an image on the main screen (as well as the photo bin) so that i can compare any editing with the original?

    In full Editor, go to Edit>Preferences>General and check "Allow Floating Documents in Full Edit Mode"
    Open the image so that you see it in the project bin
    Right click the image thumbnail in the project bin, and duplicate. It will come in as xxxcopy
    On the Arrange icon at the top, select 2-up. You should see the original and the duplicate in the work area

  • In the new Pages, how does one send an image to the background (and make it selectable)?

    How does one send an image to the background in the new Pages and how does one make it selectable?

    Also why don't TEXT to Speech short cuts established in system preferences work in the new Pages?
    I am confused (and not completely happy)

Maybe you are looking for

  • SQL Server 2012 Database Email is not working with AWS SES Services

    Hi Greetings to all, I have issue with the SQL Server Database mail Services. I have Configured Amazon Simple Email Services (AWS SES) as db profile in SQL Server and for last 2 years its working perfectly. But, from last two days on wards it is not

  • Video Blaster WebCam II on XP ?

    Is there a way to install this cam on XP, I cant find any drivers, updates or anything for it. I tryed it on my XP and get a window that says something like the drivers for device are not compatible with Xp and migh cause malfunctions. Thank you for

  • Use Host command in Oracle Database Trigger

    I need to run Host command from a database trigger in order to execute a sh file in a Solaris, Unix, environment. How can I do it? The database environment is in Solaris and the database is 10g. Please let me know as soon as possible.

  • Table for Production order planned and Actual cost

    Hi Experts, Can anybody please tell me the name of table where Production order planned and Actual cost gets saved ? Thanks in advance. Regards, Bijay

  • There will be any impact on stock or purchase order or ....

    Hi to all,    1. Base unit of sub item is in bottle    2. Issuing unit is in ltr.    3. while doing mfbf for main item, for 0.010 ltr system is taking 1 btl.    4. requirement from client is 0.010 botle.    5. I customize it, requirement is met. IMP