Hello Friends,
I've used vb6.crystal report8.5 and access in my software. when i print report it's printing fine but when i export that into windows for word format, it is not exactly exporting as it is printing. it's changing bit formatting. plz is there any way to export it in the same manner as it prints. i used following code:
]VB Code:
Dim rsStudent As New ADODB.Recordset Dim sSQL As String Dim sRepFileName As String Dim sDiskFile As String Dim Report As Report sRepFileName = "Enrol" & Format(Date, "ddmmyy") & Format(Time, "hhmm") & ".doc" sDiskFile = App.Path & "\letters\" & txtStudentID.Text & "\" & sRepFileName sSQL = "select * from tblStudent where studentid='" & txtStudentID.Text & "'" rsStudent.CursorLocation = adUseClient rsStudent.Open sSQL, cn Set Report = New rptRegLetter With Report .ExportOptions.FormatType = crEFTWordForWindows .ExportOptions.DiskFileName = sDiskFile .ExportOptions.DestinationType = crEDTDiskFile .DiscardSavedData .RecordSelectionFormula = "{tblStudent.studentid}='" & txtStudentID.Text & "'" .EnableParameterPrompting = False .ParameterFields(1).AddCurrentValue sName .Database.SetDataSource rsStudent '.PrintOut .Export False End With




Reply With Quote