I have a table in Reporting Services 2005 that contains potentially 75 columns ... They are displayed based on the parameter i pass. However, they are all set to not show if they are not passed in the parameter. The report is working fine and the export to Excel is also working fine - but if printing or exporting to PDF or selecting the print option from reportviewer , all the
blankpages caused by the original width of the table are included. That is, the table with its full 75 columns is a lot wider than the actual result the user sees, and that width is taken up with blank pages. At designtime, I cannot alter the width of the table because even if I make all the fields small enough and then set them to "Can Grow" - they don't grow and I end up with a squished-looking mess. Which is frustrating because I would have thought that's the whole point of "Can Grow" and "Can Shrink".
Has anyone got any idea how we can get around this issue?
Thanks in advance,
P.S : Even if PDF option doesnot work,,its ok. I want the print button option to work...Let me know the workaround...i m stuck up ...
Is upgrading to RS 2008 an option for you? In RS 2008 dynamically hidden columns do not consume any space and you won't get any of the blank pages.
In RS 2005, one option you may want to try is the following: once you are done with your entire report design, open the report in e.g. Notepad or an Xml editor, and then under the <Report> element find the <Width> element. Try setting the Width element to something like <Width>6.5in</Width> and publish the report. This may or may not work in your situation depending on your overall report layout/contents.
- Proposed as answer by Daniel Bello Wednesday, June 01, 2011 4:34 PM
In your notes/mail above you said ==> "Reporting Services 2005 that contains potentially 75 columns ... They are displayed based on the parameter i pass. However, they are all set to not show if they are not passed in the parameter"
I would say, why don't you return the values from those column that are desired / selected, insted of hiding/un-hiding the column dynamically?
I tried the width approach but it doesnot seem to work..
I need to render all the 75 columns because the user might select any no of columns. If i write a dynamic sql query n get data for the required columns, my report will not work since the column names that are not fetched in the query will pose a problem coz they are renderered. Thanks for you suggesstion. Can u please suggest me some other method to overcome this problem.
Does anyone know...how to print just the part of a report programatically(asp.net with C#) ...
I know this is kind of an old topic, but I wanted to propose that you take a look at this post in case it would help you:
xslt can alter many properties of the resulting excel doc - could possibly solve your problem by not inserting columns where there is no data or based on a variable condition.
Just and idea.
- Proposed as answer by Robert BrucknerMicrosoft employee, Owner Friday, May 22, 2009 1:08 AM