Solved

Reporting Services - How to change the image size dynamically based on the number of columns parameter

Posted on 2010-09-02
6
2,000 Views
Last Modified: 2012-08-13
I have a report that displays different number of images based on how many parts are passed as input parameter. The report accepts a string of comma delimited part numbers as a single imput parameter and then returns the images in a matrix format of rows and columns. The number of part numbers embedded in the string passed as input parameter is unknown. I want to make sure that the size of image reduces or increases based on the number of part numbers passed (BTW each part number has one associated image). I am passing the number of part numbers as a separate second parameter to the report. Is it possible to increase or reduce the size of the iamge based on that second parameter. E.g. if the second parameter value is 4, then the image size should be 5px by 5px, if the second parameter value is 8 then the image size should be 2px by 2px. etc.

If yes, would I have to use the second parameter value in exprsssion of the image control or any other parent control, such as list control or Matrix control? If yes how can I achieve that?
0
Comment
Question by:skaleem1
  • 3
  • 2
6 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 33591193
0
 
LVL 1

Author Comment

by:skaleem1
ID: 33591316
I do not see any direct relation with the issue I am asking with the links you have sent. May be I missed the relevant sections. Can you please direct me there?
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33594164
Hi

My initial thought was to change width/height dynamically but its SSRS doesn't support expressions on columns/rows or image width/height.

http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/8dc9aebc-197f-4c44-b029-68332bbdef6c

You also cannot use expression on subreport names but I think you might be able to add several different matrix reports to your subreport (with different image size and number of columns and display only one using visibility so if you have:

3x3 and you have matrix report 2x2, 3x3, 4x4 then when you pass the parameter it should actually tell you which one to use. @Matrix if 1 then 2x2 if 2 then 3x3 if 3 then 4x4 so the @matrix will be used in matrix table visibility property.

Hope that makes sense and helps.

Let me know if you need more info on that (I won't be able to reply today)

Regards
Emil
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 1

Author Comment

by:skaleem1
ID: 33594703
Can you show me one expression for (say) the case when parameter provided is 4, then use the first Matrix in the subreport, the one that has 2X2 image layout? One example will help...
0
 
LVL 10

Accepted Solution

by:
itcouple earned 500 total points
ID: 33602379
Hi

In visibility expression that would be something like
=IIF(Parameters!MyParameter.Value = 4, true, false)
or
=IIF(Parameters!MyParameter.Value = 4, false, true)
-- I always have problems to select the correct one.

Use the same for the rest it will only show the one which has the correct value.

Regards
Emil
0
 
LVL 1

Author Closing Comment

by:skaleem1
ID: 33619925
This one really helped. I have now three seprate Matrix controls in the sub report. As an example, one of the expression in the Visibility of one Matrix is as follows:

=IIF(Parameters!ImageCount.Value > 4 and Parameters!ImageCount.Value <= 6, false, true)

and it works great. Thanks a lot emil.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question