English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have created a crystal report templete that has araound 12 parameters in it. I then created a VB .NET solution and created a form that has textfields. I also added the Crystal Report Templete file to the solution as an existing item. I need to send the values from the textbox to the parameter fields in the Crystal report Templete. Please help...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text1 As String
Dim text2 As String
text1 = TextBox1.Text
text2 = TextBox2.Text
try
Dim crpt As Templete2 --- Templete2 is the name of the report in the solution item
crpt = New Templete2
crpt.Parameter_pBranchName.CurrentValues.Insert(0, text1)
'crpt.SetParameterValue("pBranchName", text1)
crpt.Parameter_pTxnDate.CurrentValues.Insert(0, text2)

2007-02-19 20:59:39 · 2 answers · asked by IT007 1 in Computers & Internet Programming & Design

2 answers

Here's a direct link to sample code that does what you want:
http://bloggingabout.net/blogs/jschreuder/archive/2005/12/13/10533.aspx


I recommend you visit the Business Objects website. You will find very helpful documentation and sample code, including samples that address your specific question.

BusinessObjects XI R2

http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm
Click on link to "Crystal Reports .NET SDK".
Here you will find the .NET Developer Guide and API Reference.
You will also find a link named "Samples" which includes tutorials and sample code that you can download.

BusinessObjects XI

http://devlibrary.businessobjects.com/BusinessObjectsXI/en/devlib.htm
Click on link to "Crystal Reports".
Click on link to "Crystal Reports .NET SDK".
Here you will find the .NET Developer Guide and API Reference.
You will also find a link named "Samples" which includes tutorials and sample code that you can download.

2007-02-23 06:15:00 · answer #1 · answered by Jeff B 5 · 0 0

Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New _
DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
CrDiskFileDestinationOptions.DiskFileName = _
"c:\crystalExport.pdf"
CrExportOptions = cryRpt.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
cryRpt.Export()

More info : http://vb.net-informations.com/crystal-report/vb.net_crystal_report_parameter_string.htm

2014-03-06 03:24:55 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers