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.
Unfortunately, activation email could not send to your email. Please try again.

Image falls out of cell on print when using FitToPagesTall as page size increases

Thread ID:

Created:

Updated:

Platform:

Replies:

95943 Aug 11,2010 09:44 AM Aug 12,2010 05:53 AM ASP.NET Web Forms (Classic) 2
loading
Tags: XlsIO
Bala Vennelaganti
Asked On August 11, 2010 09:44 AM

Hi,
My application generates a spreadsheet with the each product image and its details in a table of 10 rows and there is a row space after every 10 rows.

The issue I am facing is during print preview or print, the images is going out of the cell either up or down and as the page size increases. Normal view, the image is in the cell and no issues. I think it is something to do with the FitToPagesTall option which invokes the Scaling Factor and guess that the image is not resized appropriately and wonder if there is a way to fit the image to cell while using FitToPagesTall option.

If you have a code to scale the image size by percentage, it would be helpful. I use pixels currently.

Based on the number of product types the page size increases. Here is a just an example code that I use to fit to number of pages based on number of product types.

sheet.SetRowHeightInPixels(row, 100);
image = new System.Drawing.Bitmap(OriginalImage, 100, 100);

IPictureShape picture = sheet.Pictures.AddPicture(row, column, image, 80, 80);
sheet.SetRowHeightInPixels(row, image.Height);
picture.Left = picture.Left + ((100- picture.Width) / 2);
picture.Top = picture.Top + ((100- picture.Height) / 2);
picture.IsSizeWithCell = true;
sheet.PageSetup.FitToPagesTall = 10; //hard coded for demo
sheet.PageSetup.FitToPagesWide = 1;

I appreciate your help. I am not able to attach the excel file as it is confidential. If you absolutely need, I might have to write a small app and send it across your way.

I appreciate your quick response as we need to fix the bug immediately.

Thanks
Bala



Bala Vennelaganti
Replied On August 11, 2010 10:59 AM

Here is the Excel file and sample code inside the zip folder.

Please note that as you move down to the very end of the document in PRINT PREVIEW (NOT NORMAL VIEW), the image goes up. In the real application, it goes up or down which blocks the other details of the items.


YOUR QUICK RESPONSE IS APPRECIATED.



SyncFusionImageGoingOutOfCellIssue_4345d232.zip

Geetha M [Syncfusion]
Replied On August 12, 2010 05:53 AM

Hi Bala,

Thank you for the details.

I was able to reproduce the problem. Could you please create a new incident in direct-trac so that we can further update you with the details of the Image problem?

Regards,
Geetha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;