Showing posts with label fit. Show all posts
Showing posts with label fit. Show all posts

Thursday, March 29, 2012

Exporting reports to PDF

Does anybody know how to export reports to PDF so that it fit to page?

Thanks,

Addin

hii

do you want the visual studio report what ever you developed to in sql server 2005 to be exported into pdf format ?

then just see the preview of your report. then in that same page one botton is there just before to the fontsize called the export bottom. just see the drop down list to what you wanted to export your report ,you can choose there. you can see there that you can export your report to tiff format,web archive format,pdf format and excel format also.

hope you have asked this

then it will work fine for you

thanks and regards

mahasweta

|||

hii

you can do it on the same page of the rivew of the ssrs in visual studio.there is one botton, just before the font size ,caled export .just check there .you can export to any format you want.those are tiff format,webarchiev format,pdf and excel format

thanks and regards

mahasweta

|||Hi,
I am not clear about your question?
1)whether you want the data which is running in to the second page has to be fit in to a single page.
2)Do you have blank in second page without any data and you want to reduce no of pages to 1.
If you make this point clear.,then i can help you.|||Hi,

Let's say, i have this Transfer Notice report which has 10 columns.

When i export this report to PDF, i cant see all the 10 columns on page 1. It was split into 2 page.

Page 1 contains 1st - 7th columns, and..
Page 2 contains 8th - 10th columns.

I wanted to see the whole table in one page only. Is there any option so that i could "fit to page" the report?

Thanks for the answers!
|||

i think i have the exact same problem i think.

lets say i make a reporting thats A3 size, when i export to PDF the stupid thing renders it as A4 and mashes it over to another page.

|||Hi,
I got your problem .First check which layout you are using.whether its Landscape or Portrait.
Then your Components (such as List,matrix or Table) + margins(Left,Top,Right,Bottom) should be equal to or less than Page width and height.If the components extends the desired Page width and height then the data will be shifted to next page.
In your case ,Please check your page width.
Hope it was useful to you.

Cheers,
Shri|||Hi,

on the preview, I could set the layout to landscape. But when I export it to PDF, the result's still the same.

I've already check the margins, it's all okay.

Is there anyway to set the layout to landscape as default?

Thanks!
|||

I HAVE THE ANSWER!!!

example, my report needs to be A2 size.

go report>report properties>layout

set your page width and margins to the size you need (mine is 42cm,59.4cm)

this is the only thing that forces pdf rendering to go beyond the standard A4 size.

|||Great!

Thanks!

Friday, March 9, 2012

Export to PDF Is a Mess

I have several reports on a report server that export to Excel just fine. When I export them to PDF, the columns don't fit, the font gets much larger and the columns that got cut off are put on extra pages. It is absolutely unusable. Any suggestions out there?

Hi, I had lots of problems with this when I was starting out.

I found that more often than not it was caused by the page property settings of the report found in report designer.

There are page size properties. check that these match the output you want.

e.g I want an A4 portrait output,so set it page witdh to 21cm; page length to 29.7cm

if it is A4 landscape I want the width = 29.7 length is 21cm

Also important in page properties are margins, most important are the left and right margins.

They are important because if in the designer the body of your report plus these page margins is greater than an A4 output then PDFs will spill onto other pages.

e.g Page property is a4 landscape 29.7width. Page margins are 2cm left and 2cm right. The width of the body of my report is 26cm.

I have a problem because :26(body) + 2(L margin) +2(R margin) = 30 which is greater the the page output property (29.7).

Solution: reduce the margins to 1cm each .

|||Yes, you are right. I found the margin settings and reduced all of them. The columns all appear on the same page now but there is a blank page between each page of the report. The blank page has only the header on it. I have the page size set to 8.5 x 11. Any ideas on that one?|||Width of your report content + left margin + right margin <=8.5 in your case. Defatult margin is 1in, so your report width should be 6.5in or less. If this is your case, you can either change margin size or reduce your content width.|||

I've got the margins working just fine now. It's the blank pages I can't figure out. I get a PDF like this:

Page 1: Header with data
Page 2: Header and no data
Page 3: Header with next data
Page 4: Header and no data

|||What is the width of your rdlc report and your margins from the report properties' Layout tab?|||

It's an .rdl report with these parameters:

Interactive size: 8.5in, 11in
Margins: 0.5in, 0.25in, 1in, 0.25in
PageSize: 8.5in, 11in

|||Thank you for giving me this. But what I want to know most is the ruler width (the top ruler of the report in the design view). This is the Width of the report.|||Sorry about that. The grid goes out to the 8" mark. Should I pull it in some?|||

Hello:

This is the problem. You page width now is 8+your margins. You need to reduce this 8 to make room for your margins. You will be fine after that.

|||Yes! I pulled it in to 7.75 and no more blank pages. I understand what you mean now. The report width cannot exceed the page width minus the sum of the margins. Iwas .25 off.

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