Solved

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

Posted on 2010-09-02
6
1,975 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sqlquerystress - To test db performance 8 39
Email Notifications for SQL 2005 9 27
string fuctions 4 25
Update a text value in another table 10 35
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now