Solved

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

Posted on 2010-09-02
6
2,063 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

624 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