Showing posts with label menu. Show all posts
Showing posts with label menu. Show all posts

Friday, March 9, 2012

Export to PDF and print in landscape

Hello

I have a report which I can print on legal paper, once I choose the landscape settings on print menu. When the same report is set to export to a file share in pdf format, it renders in portrait format. Is it possible to have the pdf document look like the landscape view so that the user can just hit print.

Thanks

Inder

No,

you would probably have to setup two reports, one in landscape and one in portrait.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Hello

Thanks for the answer, but how do I set up the report in landscape or for that matter portrait?

|||

HI,

In the report designer, click on the small square in the top left hand corner of the page so you can view the page properties. Now set the page size in the properties box to 29.7 width and 21 height.

I can get screenshots if you need them?

Friday, February 24, 2012

Export to Excel - Fit to one page property?

It is possible to set scaling property "fit to ... page(s) wide" = 1 (menu "File" ->"Page Setup") , when I export report to Excel from Reporting Services 2005?

Thank you

Fit to Page is not currently supported in the Excel renderer.

-Chris

|||

If you go to:

menu>reoprt> report properties

click on the layout tab and change the size to what ever you need probably bigger, that should do it.

-Rohit

|||
I use the following code to format Excel on Export from my .net page
everything works except the line "sb.Append"<x:FitToPage>true</x:FitToPage>".

I've tried "yes", "1", "true", none worked.

I read at a couple sites that FitToPage is not supported in Excel.

Response.Write(AddExcelStyling())

Private Function AddExcelStyling() As String

Dim sb As New StringBuilder()

sb.Append("<html xmlns:o='urn:schemas-microsoft-com:office:office'" & Chr(10) & "" + "xmlns:x='urn:schemas-microsoft-com:office:excel'" & Chr(10) & "" + "xmlns='http://www.w3.org/TR/REC-html40'>" & Chr(10) & "" + "<head>" & Chr(10) & "")
sb.Append("<style>" & Chr(10) & "")

sb.Append("@.page")
sb.Append("{margin:.25in .5in .25in .5in;" & Chr(10) & "")

sb.Append("mso-header-margin:.5in;" & Chr(10) & "")

sb.Append("mso-footer-margin:.5in;" & Chr(10) & "")
sb.Append("{size:11in 8.5in; " & Chr(10) & "")
sb.Append("mso-page-orientation:landscape;}" & Chr(10) & "")
sb.Append("</style>" & Chr(10) & "")

sb.Append("<!--[if gte mso 9]><xml>" & Chr(10) & "")
sb.Append("<x:ExcelWorkbook>" & Chr(10) & "")

sb.Append("<x:ExcelWorksheets>" & Chr(10) & "")
sb.Append("<x:ExcelWorksheet>" & Chr(10) & "")

sb.Append("<x:Name> </x:Name>" & Chr(10) & "")
sb.Append("<x:WorksheetOptions>" & Chr(10) & "")

sb.Append("<x:Print>" & Chr(10) & "")
sb.Append("<x:ValidPrinterInfo/>" & Chr(10) & "")
sb.Append("<x:FitToPage>true</x:FitToPage>" & Chr(10) & "")

sb.Append("<x:PaperSizeIndex>9</x:PaperSizeIndex>" & Chr(10) & "")
sb.Append("<x:HorizontalResolution>600</x:HorizontalResolution" & Chr(10) & "")

sb.Append("<x:VerticalResolution>600</x:VerticalResolution" & Chr(10) & "")
sb.Append("</x:Print>" & Chr(10) & "")

sb.Append("<x:Selected/>" & Chr(10) & "")
sb.Append("<x:DoNotDisplayGridlines/>" & Chr(10) & "")

sb.Append("<x:ProtectContents>False</x:ProtectContents>" & Chr(10) & "")
sb.Append("<x:ProtectObjects>False</x:ProtectObjects>" & Chr(10) & "")

sb.Append("<x:ProtectScenarios>False</x:ProtectScenarios>" & Chr(10) & "")
sb.Append("</x:WorksheetOptions>" & Chr(10) & "")

sb.Append("</x:ExcelWorksheet>" & Chr(10) & "")
sb.Append("</x:ExcelWorksheets>" & Chr(10) & "")

sb.Append("<x:WindowHeight>12780</x:WindowHeight>" & Chr(10) & "")
sb.Append("<x:WindowWidth>10035</x:WindowWidth>" & Chr(10) & "")

sb.Append("<x:WindowTopX>0</x:WindowTopX>" & Chr(10) & "")
sb.Append("<x:WindowTopY>15</x:WindowTopY>" & Chr(10) & "")

sb.Append("<x:ProtectStructure>False</x:ProtectStructure>" & Chr(10) & "")
sb.Append("<x:ProtectWindows>False</x:ProtectWindows>" & Chr(10) & "")

sb.Append("</x:ExcelWorkbook>" & Chr(10) & "")
sb.Append("</xml><![endif]-->" & Chr(10) & "")

sb.Append("</head>" & Chr(10) & "")
sb.Append("<body>" & Chr(10) & "")

Return sb.ToString()
End Function