We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Strange behavior of images on different worksheets

Hi,

I need your help in figuring out this strange issue. I am creating excel files through a console application. Each workbook can have mulitple worksheets. On each worksheet, there would be a tabular data at the top and images at the bottom. For some reason, the same image is shown as stretched on few worksheets. I am attaching the output of the excel files. I would appreciate if Syncfusion can look into it or help me troubleshoot the problem.

If you look at the images in both the worksheets of "2011 Custom Design.xlsx", they are stretched by few pixels. In some cases, they are clearly visible.

My code that inserts image into the worksheet -

IPictureShape picture = sheet.Pictures.AddPicture(row + 1, column, image, 100, 100);

Here the variables row and column are determined dynamically.

Thanks!



2011 Custom Design_d5c54b22.zip

7 Replies

RT Ram Thatikonda February 19, 2011 02:10 PM UTC

Syncfusion,

I am looking for a solution on this problem since we have a go-live next week. All my images are of height 100 pixels and varying widths. Same images on different workbooks look little different.

Each row of the excel by default is 17 and 6 excel rows would be 102 pixels. All the images should fit within 6 rows. But on some worksheets it goes little beyond 6 rows. I am not able to figure out what is causing the issue. One more thing, if I try to write only 1 of the worksheet that has the problem it comes up correctly. I dont have any logic to insert images by (x,y) co-ordinates. All I do, is insert images based on row and column index, where the row and column indexes are determined dynamically by business rules.

I would really appreciate Syncfusion looking into this urgently!

Thanking you.



RT Ram Thatikonda February 19, 2011 03:08 PM UTC

I wrote a small sample which is a extract of the original code so that the problem can be reproduced. Most of the code is commented. Please ignore those lines. The program inserts image from embedded resources into excel which is of 133 pixels (width) x 100 pixels (height). The zip file also has 2 excel files that were produced through the code. SampleProject90.xlsx shows the image correctly whereas SampleProject132.xlsx has the same image little stretched vertically. You will see image crossing the bottom line of the 6th row which does not happen in the other excel file.

I would appreciate if Syncfusion can look into this issue at the earliest. As I said earlier, we have a go-live next week.

Thanking you.



EssentialXlsIO2_19c5f63c.zip


SR Sridhar Syncfusion Team February 21, 2011 11:22 AM UTC

Hi Ram,

Thanks for the update.

From your last updated sample, The resulatant image are displays correctly in excel.The sample.xlsx file contains the images where the sizes are same and we uanble to reproduce the reported issue.

Could you please update us the following details so that we can help you more on this issue.
1.The issue reproducing simplified sample
2.The Syncfusion essential studio version you are using.

Please let me know if you have nay queries.

Thanks,
Sridhar.S




RT Ram Thatikonda February 21, 2011 02:25 PM UTC

Hi Sridhar,

I am uploading the images to show the issue.

There are 2 images in file SampleProject90.jpg. Both the images do not touch the bottom line of the row 15 and row 24.

Whereas the same image in SampleProject132.jpg file touches the bottom line of the row 15 and row 25. This was one type of a example. In other cases, same images in some places cross the bottom line and not in other places.

I would like to question - why there is a difference between the worksheets for the same image?

I hope I tried to explain the problem clearly.

The version of the assembly that I am using is 9.103.0.20.

Thanks!



SampleProject-images_5730238b.zip


SR Sridhar Syncfusion Team February 22, 2011 07:30 AM UTC

Hi Ram,

Thanks for the update.

I have attached here the sample to insert the images based on height and width of the cells.Please try the sample at your side and let us know if this helps you.

AS your SampleProject90.xlsx and SampleProject132.xlsx i got that the image height are varies. ANd we tried the sample(EssentialXlsIO2) at our side and could not able to reproduce the issue.

I have given below your sample link and where the issue in not able to reproduce in the output template.and the images are place correctly.

EssentialXlsIO2-2070720394.zip

Pleae let us know if you have any queries.

Thanks,
Sridhar.S





InsertImage-700990036_8656b865.zip


RT Ram Thatikonda February 22, 2011 02:27 PM UTC

Hi Sridhar,

It looks like - I am not able to clearly explain the problem. Inserting an image was not a problem at all and the sample that you provided is showing the image correctly. I want all my images to appear the same on different worksheets and on different excel files. This is where the XlsIO control is failing.

In my case - I also insert images, but more than one and on multiple worksheets. The problem I am trying to explain, same image on different worksheets lookly differently. You can use the sample I provided to reproduce the issue.

I am uploading a new zip file to highlight the issue. File SampleProject90.jpg shows the images correctly as it should appear on the excel file. I am highlighting the 2 pixels difference by a red circle. Both the images on this excel file do not touch the bottom line of the row 15 and row 24.

Whereas the same image in SampleProject132.jpg file touches the bottom line of the row 15 and row 25. This is my problem. Why it is touches the bottom line when the height of the image is same? I want your team to address this issue rather than creating some samples in demonstrating how to insert images.

I would appreciate if you can provide your direct contact number so I can give a call to explain the problem.

I hope I tried to explain the problem this time.

Thanking you!



SampleProject-images-2_eb4c0af5.zip


SR Sridhar Syncfusion Team February 23, 2011 09:30 AM UTC

Hi Ram,

Thanks for the update.

Please follow up the incident 77429 for more details on this issue.
We have forwarded to the development team for further more analysis.
We regret for the inconvenience.

Please let us know if you have any queries.

Thanks,
Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon