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

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

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



2 Replies

BV Bala Vennelaganti August 11, 2010 02:59 PM UTC

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


GM Geetha M Syncfusion Team August 12, 2010 09:53 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon