DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Export Crystal report in word from ASP .Net (http://www.daniweb.com/forums/thread89882.html)

virendra_sw Sep 17th, 2007 6:51 am
Export Crystal report in word from ASP .Net
 
Hi,

I want to export crystal report fom ASP .Net in word format. I am able to export crystal report but it dosen't give be the Word toolbar as we can see in the when Msword document is opened.

oStream = DirectCast(Me.reportdocoument.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.WordForWindows), MemoryStream)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.[End]()

where reportdocoument is the crystal report document.

When we will execute this code it will ask 2 options to save or to open the word document. If you select the open word document then it will show the word document but no word toolbar as we can see in Msword. If we want to print this document then we can not print.

Please Help.

Reply from the earliest is really appreciated.

With Regards,
Virendra

dotnetdelegate Jun 13th, 2008 7:07 am
Re: Export Crystal report in word from ASP .Net
 
Hi Veeru,

U can use Ctrl+P for print Dialog.

Thanks
Hari


Quote:

Originally Posted by virendra_sw (Post 435386)
Hi,

I want to export crystal report fom ASP .Net in word format. I am able to export crystal report but it dosen't give be the Word toolbar as we can see in the when Msword document is opened.

oStream = DirectCast(Me.reportdocoument.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.WordForWindows), MemoryStream)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.[End]()

where reportdocoument is the crystal report document.

When we will execute this code it will ask 2 options to save or to open the word document. If you select the open word document then it will show the word document but no word toolbar as we can see in Msword. If we want to print this document then we can not print.

Please Help.

Reply from the earliest is really appreciated.

With Regards,
Virendra


Kusno Jul 11th, 2008 3:37 am
Re: Export Crystal report in word from ASP .Net
 
Hi,

Try this code :
Quote:

Crs.ReportDocument.ExportToDisk(ExportFormatType.WordForWindows, yourReport)


Crs is your ReportSourceID. That is located in CrystalReportViewer control.

Thanks,

Kusno.


All times are GMT -4. The time now is 1:37 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC