In my VB.Net 03 app I have a form with a Crystal Reports Viewer, using CR 10. From there user's can preview/print the report, etc. I want to run the report and store the report on the hard drive automatically. Where do I begin this?
I currently use this code below in the form load event (it just previews the report for now) ... Is it simply modifying some of this? Any help or examples would be great!
CODE
Dim param1Fields As New CrystalDecisions.Shared.ParameterFields
Dim param2Field As New CrystalDecisions.Shared.ParameterField
Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param2Field.ParameterFieldName = "@variable"
param2Range.Value = variable
param2Field.CurrentValues.Add(param2Range)
param1Fields.Add(param2Field)
CrystalReportViewer1.ParameterFieldInfo = param1Fields
CrystalReportViewer1.ReportSource = "c:\Program Files\report"
CrystalReportViewer1.Refresh()
-- This is some code to export a CR to a Word document. Has anyone done this before? Any help merging this code, or how it can work together..?
I currently use this code below in the form load event (it just previews the report for now) ... Is it simply modifying some of this? Any help or examples would be great!
CODE
Dim param1Fields As New CrystalDecisions.Shared.ParameterFields
Dim param2Field As New CrystalDecisions.Shared.ParameterField
Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param2Field.ParameterFieldName = "@variable"
param2Range.Value = variable
param2Field.CurrentValues.Add(param2Range)
param1Fields.Add(param2Field)
CrystalReportViewer1.ParameterFieldInfo = param1Fields
CrystalReportViewer1.ReportSource = "c:\Program Files\report"
CrystalReportViewer1.Refresh()
-- This is some code to export a CR to a Word document. Has anyone done this before? Any help merging this code, or how it can work together..?
Code:
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()