Home » SQL Server

How to display images horizontally

Hi guys,

I am trying to display two images next to one another (horizontally), but I am having no luck. They are being display underneath one another. There can be a maximum of 20 images that need to be displayed and I would like to display two per row. Does anyone know how to do this?

Thanks in advance.



1 Answer Found


Answer 1

create a 2x10 table and put the images in there

then use expressions to hide or display rows based on whether there are any pictures in them



Hi guys,

I am trying to display two images next to one another (horizontally), but I am having no luck. They are being display underneath one another. There can be a maximum of 20 images that need to be displayed and I would like to display two per row. Does anyone know how to do this?

Thanks in advance.




Using Report Builder 3.0 I have a query that can return records along with a number of related images (variable amount).  In a typical layout, the images are about a 1/5 th screen size, and stack up on the right hand side of the screen, as you would expect (using a table).

However doing this creates a large amount of wasted space in the middle/left of the page, meaning the reports are long in length, and wasteful in paper.  The obvious remedy would be to lay the images out horizontally, under each row of text data.  This is where I am struggling - any one any ideas?


many thanks


Hi All you helpful people :)

I'm fairly new to SSRS and am struggling to find a way to solve my problem.

I am printing what is basically a staff list, where a staff member's photo and name is displayed, 18 per page, 6 pics across, 3 down. My problem is that I need the pictures to be displayed horizontally across the page, but instead they are being displayed vertically... for example, if there were 3 staff members with last name beginning 'A', they would be displayed in the first column. I would prefer them to be displayed as the first three pictures horizontally.

...Am I making sense?!

Please do let me know if you have any suggestions!


SharePoint Server 2007:



I am having the lists which has the field of type checkbox for displaying the states, I inserted the field as multiple form view webpart in an aspx page.

Now i am getting the  checkbox Vertically.

Please guide me on how to bring it Horizontally.

Also guide how to make it disabled. So that user can't edit it.


Umar Ali 


Hi there, my knowledge of the SQL Database is not very well.

I have a database with sales, period and year. Our financial Period is April - March.

The period is stored as number. The table below shows the equiavent output.



I want to be able to display each month sales against every accounts.

How can I make the output to display this? using a

<th>April 2010</th>
<th>May 2010</th>
<th>June 2010</th>
<th>July 2010</th>
<th>August 2010</th>
<th>September 2009</th>
<th>October 2009</th>
<th>November 2009</th>
<th>December 2009</th>
<th>January 2009</th>
<th>February 2009</th>
<th>March 2009</th>





I have a report that has only 4 columns. I would like the report to be formatted in such a way that once the rows are all displayed till the height of a page instead of spanning to a new page the successive rows should be displayed as another tablix in the same page side by side. This should continue till the width of the page is complete and then it should move to the next page.

That is the display should be first top to down then right (as a seperate tablix) till the width of the page is utilized. Can any provide me the steps to do this or point to some link that will help to achieve the same. I'm using a tabular report for this report

Thanks and regards


I know how to display an image in gridview from image path in database. Now, I want to display an image in an asp.net image control from image path in database. Can anyone point me to a tutorial? I haven't been able to find one that explains how to do it when I don't know what the image path will be. The images are in the root folder. Thanks in advance!


Hello everyone. I've got a quick question. I wrote an application that parses some XML and creates some controls (programmatically, in the code-behind), with some of the controls being Images and MediaElements (although the MediaElements are displaying images). The application works fine on Windows 7, but when I move it over to any machine running XP, it throws no exceptions or anything, but does not show the images. Does anyone know what's going on here?

Thanks in advance.

-Zane Kaminski



If it's worth anything to say, the images are all bitmaps.

Hi everybody,

i am a newcomer in this forum. i m want to display tif images into my project. then i used a third party software (trial version CPImageViewer) it's working nicely. but problem is it's 3 months trial verison and it display message while running program....'Demo version'. so it hassle for end user. then im trying to use Microsoft Office Document Image Vierwer Library 11.0.

but problem is while i first time i set file name property its display the file but then it doesn't display any file.

please note that, i m developing this project using VB6 under W2K3 platform.

my used code is given below:


i searched a day long for useful sample but nothing find useful.

please help me.

thanks in advance.


Been having trouble getting external images to display in reports rendered on SSRS 2005. Images are displayed as a red X.

However, my scenario is different from some of the examples I have read about.

- The images are stored on a file server that is DIFFERENT from the box on which the Report Service is running. For various business reasons I cannot copy the images locally to the Report Service box. I am using "file://fileserver/path/to/image.jpg" to retrieve the images.

- Since the file server does not have IIS installed, I cannot access the images using the URL method (http:// access). I need to use the file:// method.

Currently I am prototyping this setup on my test box, which is running XP Pro and IIS 5.1. The Report Service is installed on this same box.

I am currently testing this through the Report Manager web site (http://servername/Reports). The images are displayed using the Image control, which I added to the report using the visual report designer in Visual Studio 2005. It is set up with source=External and with "file://fileserver/path/to/image.jpg" path values. File names are retrieved from our database and file paths are built dynamically using a data processing extension I have written.

My best guess as to why this is happening is that the ASPNET service account on my test box does not have access to the particular share on the file server that contains the images. (I'm guessing that this service account actually renders the content.) The account I am using to run the Report Server *does* have access to the share. However, I can't give permissions to the ASPNET service account because Active Directory is unaware of it.

I have already tried having our network admin give read permissions on the file share to the "Everyone" group, as well as setting the unattended account to one that has permissions to the share. Neither worked.

One other thing I should mention: the report renders fine from Visual Studio, presumably because I have access to the file share.

Anyone have any ideas as to how I can fix this?

Thanks in advance.

Hi everyone,

                This is a new question although it is related to what was resolved in


 I was successful in creating an array of pixel values for each component of the image R,G,B. I created each array by removing the extra stride values. Now I wanted to make sure the image is in good format and wanted to view the red or green or blue component only. But when I tried creating a bitmap image from the array without the stride values I wasnt successful in displaying the image successfully. Attached is the code I had used. The initial part is to extract RGB channels and the remainder is to convert a channel array to an image


1) I wasnt sure which pixelformat should be used for just one channel which is 8 bpp .

2) I felt extra stride elements should not be included so my array size is width*height.

3) When I didplay the image I get mutliple small sized images or colored image. I am sure the format I use is wrong.


I need to do this in order to display the output of my algorithm on each component.

private void bitmap2byteArray(byte[] Red, byte[] Green, byte[] Blue)

   // Create a new bitmap.
   Bitmap bmp = new Bitmap(openFileDialog1.FileName);

   // Lock the bitmap's bits. 
   Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
   System.Drawing.Imaging.BitmapData bmpData =
    bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite,

   // Get the address of the first line.
   IntPtr ptr = bmpData.Scan0;

   // Declare an array to hold the bytes of the bitmap.
   int bytes = bmpData.Stride * bmp.Height;
   byte[] rgbValues = new byte[bytes];

   // Copy the RGB values into the array.
   System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);

   //This is how the Red,Green and Blue arrays are //declared. If stride elements need tobe included then new //byte[stride*bmp*height]]
   // byte[] Red = new byte[bmp.Width * bmp.Height];
   //byte[] Green = new byte[bmp.Width * bmp.Height];
   //byte[] Blue = new byte[bmp.Width * bmp.Height];

   int cnt = 0;
   for (int pos = 0; pos + 2 < rgbValues.Length; pos += 3)

    if ((cnt != 0) && ((cnt % bmp.Width) == 0))
     pos = pos + 2;

     //uncomment if the stride elements are going to be included in the array 
     //for (int a = 1; a <= 0; a--)
     // //Red[cnt] = rgbValues[pos];
     // //Green[cnt] = rgbValues[pos];
     // //Blue[cnt] = rgbValues[pos];
     // //cnt++;
     // pos++;

    Red[cnt] = rgbValues[pos + 2];
    Green[cnt] = rgbValues[pos + 1];
    Blue[cnt] = rgbValues[pos];      
   //Here create the Bitmap to the know height, width and format
   Bitmap newbmp = new Bitmap(myBitmap.Width, myBitmap.Height,
 //What format to be used for red channel alone
   //Create a BitmapData and Lock all pixels to be written
   BitmapData newbmpData = newbmp.LockBits(
         new Rectangle(0, 0, newbmp.Width,
    newbmp.Height), ImageLockMode.WriteOnly, newbmp.PixelFormat);

   //Copy the data from the byte array into BitmapData.Scan0
   System.Runtime.InteropServices.Marshal.Copy(Red, 0,
            newbmpData.Scan0, Red.Length);

   // Unlock the bits.
   myBitmap = newbmp;
//Draw the image




Thank you all in advance.


My scenario:

I am working on a website, using C# with a SQL backend.  I’m using the Varbinary data type to store my images because the Image data type is eventually going away. I got the images into the DB and can pull them back out to display on the website.

 My question is how can I put the images from the DB into an Image control on the website? The images will be different sizes, so I need to keep them confined in one space on the site.  I also need to randomly display the images, one at a time, on the website. The user needs to be able to hit the Next button to see the next image when they are ready.  The user will only view the images, not make any changes and send data back to the DB.

Since the image will be confined within the image control, how can I allow the user to click on the image and open in a new window? The image needs to be bigger to allow the user to see more detail. Or would it be easier to allow the user to zoom in on the image within the current window?

I am using VWD Express, C# 2010 Express & SQL 2005 Express.

Give me simple exaple of using image buton. i m new in .net. i have to use a image button in which i have to diplay an image. i gave path in ImageURL  but at runtime it doesnot show me the Image. so help me . how to do tat. Thanks.....

Hi, I'm trying to display image in image control but I'm not able to do it. Tha path is correct and it is working fine but it is not working in code.

Here is the code

objCommand.CommandText = "select right( image_filename,50) as imagefilename, order_item_job_name from order_item_binding where order_number = '  

Dim dr1 As SqlDataReader = objCommand.ExecuteReader()

            While (dr1.Read)
                If dr1("order_item_job_name").ToString().Contains("flexbind") Then

                    'Image1.ImageUrl = " file://LABIMAGES/DP2/PICABCA" & ID & "_1/" & dr1("imagefilename")

                    Image1.AlternateText = "No Image diplay "
                End If
            End While



Hi, I want to display my image in image control but the criterias are listed below.

1) It's an intranet application

2) Load image from the different server.

3) Image name would be like 123.jpg

4) My image is in "C:\Project\Images\123.jpg" and My server name is "MyServer".

My question is how can I display images from the different server? and How do I write ImageUrl if it is different server? 

new images droped in image folder wiil not display in design view. url of image is correct to image file, path is obtained using the image control browse to locate, all path code shows correct, project virtual path good, no refreshing helps, new images will not render in local browser, somewhere a local file path problem, design view use to work fine, not sure what changed, will the installation of SP1 help?

Hello all,

I am a pretty fresh programmer (if I can use such a statement at all) and I need some help connected with displaying the image and drawing "on" it using Visual C#.

To the point:

I've created a form on which I have put few buttons and a picturebox. Then I want it to display an image in the picturebox and draw some simple shapes like lines etc. while clicking one of the buttons (the rest of them might be used later to render some image processing algorithms). Since the methods for clicking and displaying events are handled by different delegates (am I correct?) my questions is:

Shall I arrange separate functions for clicking, displaying and drawing in one class or make it more effectively somehow? (For example all the events in one function or separate classes?)

Please share your experience,


Or maybe use more explixit code?

I'm working on a C# project combined with "Crystal Reports 10".
When a user inserts something in a "TextField" in my C#-Program, it's saved 
as RTF-code (Bolt,Pictures,Underlined,....) to a database.. So if they 
reopen it in my "C#"-program they're able to see what they've entered 
including their pictures ....

But when I created a "Crystal Report"-file and combined it with the same 
database used in my "C#"-program, it only show the formatted text and not 
the pictures or images...

Is there a way to show the "Picture" or "Image" they've inserted in RTF-code 
??? When I copy the code from the database in a simple Text-File and rename 
it too "Test.rtf", it wil open correctly in word (with picture and 
everything else)...

So I hope there is a way to get the picture, Cz it's rather important 
they've got a picture of the product they wanna print ...


Hi experts,

            I am using some image processing library functions in my application. It will return the resultant image as unsigned char* format. Please any one tell me how to display that image in a picture box or anything?



We are using crystal report 11.5 in vs. 2008 to display report in one of my projects, when I try to display a report in crystal report viewer reports are displayed properly but the toolbar icons (First, Prev, Next, print, etc..) images are not getting displayed and on click of any of these buttons the report vanishes giving a blank page. the images for the same are also available at the path C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers115 Please let me know if there any other thing to be done. 

<CR1:CrystalReportViewerid="CrystalReportViewer1"style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 32px" runat="server"Height="50px"Width="350px"></CR1:CrystalReportViewer>






<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure