Export Report in doc Format at runtime!!!!

sohaib

Well-known member
Joined
Apr 30, 2005
Messages
64
Programming Experience
3-5
Hi Guyz!!!

I Came back with a new problem!! Which is very interesting though...

I want to export report in .doc format and that report should be saved at particular folder with the name of the report....

Then further i want to use it for attaching with my email message ....I already found out the attaching method but i want the report should be saved and exported at particular location at runtime!!!

I hope for the better response from you people soon...

ok
Bye
 
Hi Kulrom!!

You are right, I am also astonished about it...anyways I am using Visual Studio.Net Enterprise Edition 2003 and as far as changes are concerned i have no changes but i think so there might be a problem related to loading Report and it can be happen due to the location where report exists....or there might be some other problem but according to the error it showed that there is a problem regarding loading report....

I hope you will help me to sort out this problem....

Best Regards,

Sohaib
 
Well, all i can say here is that you should check the DB from the report ... in FieldExplorer right click the "Database Fields" and select Verify Database.
If it says "The database is up to date" then go to F5/Run your app.
Otherwise, reestablish the connection to DB (Right click "Database Fields" againg and select "Add/Remove Database" then find the DB and simply add ...)

Cheers ;)
 
Hi Kulrom!!

Thanx a lot...Now, it's working..........yes, there was a problem regarding DB Connectiivity.....anywayz it's working there as a module....

but one thing when i use that function in my program....there is little bit problem...
Actually I am using Add Command (With QuerY) no table for getting only one record at a time right.....

so there is a problem in

Document.SetparamValue("Command.Reference #",Reference.text)....

how i can manage it....can u have an idea about it...

if i neglect this line then whole document exported with all client Names (I mean all records have been exported)...

Thanx again in the end

Best Regards,

Sohaib
 
Hi Kulrom!!

I have still a problem with your given code...

I have made a module in that way...so plz reply me by finding errors in it...Actually I made a module so check it out all these thing. I can't understand how i can make a report as a sub report as I told you about that I want a report with a single record.

......Code Here....

Sub ExportReport()
Dim docTitleWORD As String = Application.StartupPath & "\Reports\" & Me.Reference.Text & ".doc"
Dim document As ReportDocument
document = New ReportDocument
document.Load(Application.StartupPath & "\..\NewClientsReport.rpt")document.ExportToDisk(ExportFormatType.WordForWindows, docTitleWORD)
'Dim myProccess As Process = Process.Start(Application.StartupPath & "\Reports\" & Me.ID.Text & ".doc")
MsgBox("The file has been exported", MsgBoxStyle.Information)
End Sub

With Best Regards,

Sohaib
 
Back
Top