Click here to Skip to main content
16,010,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the below code to open a new word document in my vb.net Project
VB
Dim oWord As Word.Application
       Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
           oWord.Visible = True



This code open a new word document in word and then i make necessary changes and then save it.Similerly can i export a pdf document in th button click
Posted

 
Share this answer
 
v2
Comments
Member 8390746 20-Dec-11 6:50am    
When you run this program you will get the PDF file (crystalExport.pdf) in your computer's C: Next time When i run this program it will overwrite.Is any solution for this?
thatraja 20-Dec-11 6:54am    
Give dynamic path. Like concatenating current date time with file name. Ex. Report_20_12_2011_05_25_20.rpt
Member 8390746 20-Dec-11 7:05am    
This is working. But I dont want to save the pdf .I want to open it as a new pdf file.Is it working?
thatraja 20-Dec-11 7:17am    
If you want generate PDF file then check my updated answer
Member 8390746 21-Dec-11 1:56am    
I dont want to generate PDF file .In the button click I want to export the crystal report into pdf and open that pdf.
It's quite easy: all you have to do is get a new instance of a crystalreport object

Dim rpt as new CrystalReport1


Set the necessary properties, like datasource, SelectionFormula, etc.
Then call the Export method as follows:

rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "Report.pdf")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900