Solved

Laying out a report in SSRS to export in Word

Posted on 2013-11-27
13
4,445 Views
Last Modified: 2013-12-02
I have a report that we want to be the starting point of a final project report that will be saved as a Word document.  There is data to pull from the database and then project managers will put their feedback in certain sections.  I've already designed the report and it looks great but I'm having trouble getting the page to break where I want it to.  I'm using tables to position static information as well as data, even using tables within cells to line up things perfectly (I should probably remove those but I thought it would keep a table together if it was inside another table's row).  But my problem is tables spawning 2 pages.  I thought there were settings for rendering specific to the output you would like but I can't seem to find anything online.  

Is there a way tweak a report so it is Word-export friendly?
0
Comment
Question by:HSI_guelph
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
13 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39682934
I thought there were settings for rendering specific to the output you would like but I can't seem to find anything online.

Are you referring to the RenderFormat properties?  Through RenderFormat.Name, you can determine what format the user is exporting to and hide/show items accordingly.

Check here for a list of possible values: Hide/Show Items Dependant On Export Format (SSRS)
0
 

Author Comment

by:HSI_guelph
ID: 39684048
@ValentinoV - I think that was what I remember from before.  But is there a way to format a report for optimal output to Word?  I've got it looking pretty good except for where tables split even though I've gone into the Tablix Properties and checked off Keep together on one page if possible.  Is there a way to force it to stay together?
0
 
LVL 1

Expert Comment

by:FriedTyGuy
ID: 39684063
Can the output even fit on one page?  As in if more rows are returned than what would fit on a page no matter what it will spit out on two pages?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:HSI_guelph
ID: 39684210
@FriedTyGuy - No the output is 4 pages, 5 because one page only has 2 lines on it due to my attempt to format it, lol.  I would like to tell it where to split into the next page but I can't find out how or if it even is possible.
0
 
LVL 1

Expert Comment

by:FriedTyGuy
ID: 39684290
All over the place...  You can page break by table, rectangle, group, etc.  What version of VS are you creating this in?  2005, 2008, 2010, 2012 or 2013?
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39684743
Something isn't clear to me yet: is your table splitting horizontally or vertically?

In case of vertically, you'll have to play with the cell widths a bit to stop this.  A vertical split happens when the width of the table exceeds the page width.

Interesting to read:
Pagination in Reporting Services (Report Builder and SSRS)
Add a Page Break (Report Builder and SSRS)
0
 

Author Comment

by:HSI_guelph
ID: 39685541
It is splitting the tables horizontally.  I know this is hard to control since the data is being generated dynamically but some of the tables are not dynamic but static such as the Project Goals table and since it's so close to the edge of the page I had hoped the 'keep together if possible' feature would drop it one line and keep them together.

example of page split
0
 

Author Comment

by:HSI_guelph
ID: 39685880
This is the format feature I was thinking of
http://myrshost/ReportServer?/myreport&rs:Format=PDF

Does anyone know how to set that value in the URL?
0
 
LVL 1

Expert Comment

by:FriedTyGuy
ID: 39685888
That feature just bypasses the report viewer and opens the report in PDF.  All you need to do (if the report isn't parameterized) is open the report in the report view, copy the link from the address bar and add "&rs:Format=PDF" to the end of it.

As for your page breaks, are you creating these reports in visual studio?  If so, what version?
0
 

Author Comment

by:HSI_guelph
ID: 39686061
I am using Microsoft Visual Studio 2008 Version 9.0.30729.4462 QFE with Microsoft .NET  Framework Version 3.5 SP1.  So that '&rs:Format=PDF' would open in Adobe Reader if it was a link in the report?  I'm thinking I could create a link and have them click on it in the report to open a Word document with the report rendered in it.  I find the changes I've made make for a readable Word document but the actual report feels a bit odd in the browser.  Way over to the far left and lots of whitespace.  I think I may have misunderstood the capabilities of the render.  I know you can export reports into a few different formats but I thought that there were things you could format in a report to make a better export in Word.  Kind of like having a web page and creating a printer-friendly version.
0
 
LVL 1

Assisted Solution

by:FriedTyGuy
FriedTyGuy earned 250 total points
ID: 39686078
You can try &rs:Format=Doc or &rs:Format=Word

Are you still having issues with the page break? You should be able to set EACH table/group to "Keep Together" then it should page break to keep the tables together when possible.

I'm pretty sure you can &rs:Format=HTM also, to which there would be no page breaks (browser).

You could also consider &rs:Format=XLS and have it all on a single spreadsheet.

There are several formats you can export direct to, if you want to look them up on MSDN.

You can test all the links by creating shortcuts on you desktop to the report in the report viewer and appending the link with the &rs:Format=xxx
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 250 total points
ID: 39689332
"I know you can export reports into a few different formats but I thought that there were things you could format in a report to make a better export in Word.  Kind of like having a web page and creating a printer-friendly version."

There's no "printer-friendly" setting or anything like that but you can implement one yourself by making use of that RenderFormat.Name property mentioned earlier.  Basically you implement two different tablixes: one for web and one for print (or Word/PDF).  Then, depending on render format, you hide one of them.
0
 

Author Closing Comment

by:HSI_guelph
ID: 39690836
I tried adding a textbox and setting the action to go to URL but when I add the &rs:Format=XXX it gives me an error.  Doesn't matter what I set for the XXX (Doc, Word, PDF, HTM) it won't open the report.  

I did try making each table have the 'Keep together if possible' open checked off but it didn't always work, I'd still find one line off a page.  So I think we'll just pass the information along that the report will need minor formatting when rendered.  It looks pretty good otherwise, I'm just surprised the report can't be tailored more for exporting to Office programs.

Thank you both for your replies and input!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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