Archive

Archive for July, 2007

Landscape printing in Reporting Services

July 26, 2007 7 comments

I always get asked about printing in Reporting Services. The 2 issues are always
 
1) Printing in Landscape in Reporting Services
2) After creating reports , when printed or exported to PDF you get blank pages.
 
Lets talk about the blank pages first. What I’ve found when authoring reports , is that when you are creating portrait reports ( reports that should either print on a normal A4 page , or be exported to a PDF file ) make sure that the report width is not more than 16 cm’s. Sometimes a report author has a table or matrix that is short enough , but still gets the extra blank page. Thats because the report width is greater than 16 cm’s. What you need to do is remove all the extra space at the right of the report. This is normally the cause of the "Extra Blank Pages" that you see when you print or export to PDF.

The above illustrates a report where the actual table is less than 16 cms but the report width is not. You will still get extra blank pages when you print this or export to PDF. Make sure therefore that there is no extra space after the table on the right ( if not needed ).

The other way to control the report width is on the Report Properties Tab.


This is a useful window, lots of properties to set here

Which brings me to the Landscape Printing option. To set your report to always print / export in Landscape mode, you need to go into the report properties box , select the Layout tab and inverse the Width and Height ie. The normal settings are 21cm for Page Width and 29.7cm for Page Height. Swop these around and you should get a Landscape Report.

The above image shows the same report exported to PDF after the change is made. Easy as pie…….

Advertisements
Categories: Reporting Services

Deploying RS onto an internet facing environment

July 16, 2007 Leave a comment

As you know , Reporting Services works very well within an intranet environment, in part to the integrated security. But what if you want to deploy RS onto a site that’s internet facing ?
 
You need to study your network architecture carefully to make sure that what you want to do is feasible. Most companies have only the web servers accesible from the outside and normally the Reporting Services server is behind the firewall and won’t be acessible to the end user directly.
 
So URL access to the reports won’t work. Now I know that many people, when writing ASP.NET applications. use URL access to call Reporting Services reports , and although this is quick and easy, get to learn more about the Reporting Services Web Service. It is a powerful ally !!
 
Your 2 options therefore are :
 
1) To use the Report Viewer control to display the reports ( and if you are using subreports there are some tricks you need to perform )
2) Use the Web Service to render the report to the bytestream. Once you do this you could simply display as HTML or PDF ( PDF is better for printing ). Make sure you set the MIME type in the latter case so that IE will know that it’s getting a PDF document.
Categories: Reporting Services

Markus’s Blog

July 16, 2007 Leave a comment

My good friend Markus Hain has an excellent Microsoft Blog , which I shall now shamelessly plug :
 
 
Categories: Uncategorized

More on Dates in Reporting Services – DateDiff

July 16, 2007 1 comment

It seems like you always have to perform comparisons with dates to do conditional formatting in Reporting Services. Many of you will know the DateDiff function :


DateDiff("d",Fields!Date1.Value,Fields!Date2.Value)
 

You can also  :

  • Use Parameters or static fields instead of fields from the dataset ( This applies to most functions )
  • Change the "d" ( which means compare days ) to "M" or "yyyy"

If it doesn’t work , remember that the values you are comparing must be date values. Use "CDate" to convert strings to Date values.

And remember , when you want compare a date to todays date , getdate() won’t work, since this is VB Script not SQL !! Use the Now() command as follows :


DateDiff("d",Fields!Date1.Value,Now())
 

If the first date is smaller than the second date , the difference will be a positive number. You need to remember this since normally your expression for conditional formatting is normally something like :


=iif(DateDiff("d",Fields!CalendarDate.Value,Now())>30,"White","Black")
 
Categories: Reporting Services