Solved

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

Posted on 2010-09-02
6
1,937 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

743 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

16 Experts available now in Live!

Get 1:1 Help Now