This is a migrated thread and some comments may be shown as answers.

Reporting showing images with autosize falls short

3 Answers 320 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 2
Juan asked on 03 Jun 2013, 04:31 PM
I have a sql server 2005 database with a table that stores images in a varbinary field.
These images have different dimensions, it could be 150x150 px or 1024x768 px.
Trying to print a text at the top and then the image below per each record.
Sometimes there are no pictures (null value).
Setting the  picturebox field SIZING property to "AutoSize" gives you a format like seen below, that allows to maximize the paper printout since if there is no image, it will not print as if it was leaving a placeholder (as it does with any other setting), see below and keep reading after where the problem is described.
 Page 1
____________________________

TEXT (rec# 1)
         ----------------------------------
         |   Picture (rec# 1)            |
         |                                         |
         ---------------------------------
TEXT (rec# 2)

TEXT (rec# 3)
          ---------------------------------
         |   Picture  (rec# 3)           |
         |                                         |
         |                                         |
         |                                         |

         |                                         |

          ---------------------------------

 TEXT (rec# 4)
          ---------------------------------
         |   Picture   (rec# 4)         |
          ---------------------------------
(desired format, and partially achieved with Sizing prop set to "AutoSize", the layout repeats along pages depending on the picture size, as long as the width fits in one page, otherwise it will print the remnant of the image in a 2nd page alone)


Now, when the image goes beyond the size that can fit in the width or height of he page, you would get an additional page for whatever did not fit in the original area for the image.
What the "Autosize" is lacking is the ability to automatically resize, but up to a certain point so it does not span to a second page to print what did not fit in the original place but rather fits to the maximum dimension that can be fit in one page.

Page 1
 ____________________________

 TEXT Record 1
          ---------------------------------
         |   Picture Record 1          |
         |                                         |
          ---------------------------------
 TEXT Record 2
          ---------------------------------
         |   Picture Record 2          |
          ---------------------------------
 ____________________________
Page 2
         ----------------
         |  Picture    |    (this is what did not fit width in the previous page for this record
         |  Record 1 |
         ----------------
 ____________________________
Page 3
TEXT Record 2
         ----------------------------------
         |   Picture  record 2          |
         |   Picture  record 2          |
         |   Picture  record 2          |

         |   Picture  record 2          |

         ----------------------------------

 TEXT Record 3
         ----------------------------------
         |   Picture  record 3          |
         |   Picture  record 3          |
         |   Picture  record 3          |

         |   Picture  record 3          |

          ---------------------------------

 TEXT Record 4
 TEXT Record 5
         -------------------------------
         |   Picture  record 5      |
         |   Picture  record 5      |
         |   Picture  record 5      |

         |   Picture  record 5      |

         -------------------------------


Extremely annoying because you have to end up using a fixed area that is left empty blank when the record does not have an image associated, thus wasting a lot of paper and providing an odd layout.

any plans to resolve this?

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 06 Jun 2013, 12:04 PM
Hello Juan,

If the PictureBox Sizing options does not fit your scenario, you can use a user-defined function to pass images to the item's Value property. In this function you can retrieve and size an image as needed per requirements.

I hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Juan
Top achievements
Rank 2
answered on 06 Jun 2013, 04:59 PM
do you have an example of how an image size could be handled with an udf?
Not exactly sure I made myself clear so you could fully understand, so I doubt what I'm trying to do is doable via a UDF and also don't understand if you imply that more recent versions take care of this automatically (as the balloon dialogue in your signature suggests). 
0
Stef
Telerik team
answered on 11 Jun 2013, 02:33 PM
Hi Juan,

This is a banner announcing the upcoming DevCraft Q2 2013 release. Feel free to register for the webinar and check what new is included.

On your question, please take a look at the attached sample report definition, it illustrates an example of using user-defined function to adjust an image within the item.

i hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Juan
Top achievements
Rank 2
Answers by
Stef
Telerik team
Juan
Top achievements
Rank 2
Share this question
or