# New page in Export Word (.doc)

**URL:** <https://www.ruby-forum.com/t/new-page-in-export-word-doc/163420>\
**Category:** Rails\
**Created:** [March 20, 2009, 6:55am UTC](https://www.ruby-forum.com/t/new-page-in-export-word-doc/163420 "2009-03-20T06:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [March 20, 2009, 6:55am UTC](https://www.ruby-forum.com/t/new-page-in-export-word-doc/163420/1 "2009-03-20T06:55:46Z")

</div>

Hello Everyone,  
I have nearly 13 reports in my application, the user can select  
whichever report(s) he wants to view/export to DOC file.

So whenever the user selects more than 1 report, I am supposed to give a  
page-break. I have solved this issue in View report (html file) with  
this CSS style =\> “style=‘page-break-before:always;’”.

But I am unable to do the same while Exporting it to a word document.  
Here is the method which I am using,

def export\_report  
date\_value = Date.today  
filename = “report\_”+date\_value.to\_s+".doc"  
headers[‘Pragma’] = “public”  
headers[“Content-type”] = “application/msword”  
headers[‘Cache-Control’] = “no-cache, must-revalidate, post-check=0,  
pre-check=0”  
headers[‘Content-Disposition’] = “attachment;  
filename=”#{filename}""  
headers[‘Expires’] = “0”  
report\_content = Report.generate\_report\_content()  
render :text =\> report\_content  
return false  
end

Could anyone please help me to solve this issue?

Thanks in advance,  
Vasanth

---

<div class="post-metadata">

**Author:** ![vasan\_cec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/258eb7/32.png) [@vasan\_cec](https://www.ruby-forum.com/u/vasan_cec)\
**Post date:** [March 20, 2009, 8:47am UTC](https://www.ruby-forum.com/t/new-page-in-export-word-doc/163420/2 "2009-03-20T08:47:05Z")

</div>

By the way, is there any GEM available for doing Export to Word document  
just like PDF::Writer?
