473,471 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Crystal Report.Net discrete parameter with multiple values

I'm having a problem with Crystal report.net with ASP.NET.
The problem occurs when exporting the report. The report
uses a discrete parameter with multiple values. When the
report is loaded into the crystal report view it shows all
the values from the discrete parameter. But when I export the
report it only shows the values from the last discrete parameter value
enter.
My code is listed below:
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()

' Start Loading Report
'CR(Variables)
Dim opTeam As String()
Dim crParameterValues As New ParameterValues
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition

Dim paramFields As New ParameterFields
Dim paramField As New ParameterField
Dim discreteVal As New ParameterDiscreteValue
Dim rangeVal As New ParameterRangeValue

CrystalReportViewer1.Visible = True
crReportDocument.Load(Server.MapPath("CrystalRepor t1.rpt"))
crReportDocument.SetDatabaseLogon("****", "****")

Dim t As System.Web.UI.WebControls.ListBox

If Session("ListBox2") Is Nothing Then
t = New ListBox
't.Item(0).Text = "All"
Else
t = Session("ListBox2")
End If

Dim ind As Integer
Dim CRdiscretevalue As New
CrystalDecisions.Shared.ParameterDiscreteValue

crParameterFieldDefinitions =
crReportDocument.DataDefinition.ParameterFields
crParameterFieldLocation =
crParameterFieldDefinitions.Item("Operator Team")
crParameterValues = crParameterFieldLocation.CurrentValues
paramField.ParameterFieldName = "Operator Team"

Dim paramDiscreteValue As ParameterDiscreteValue
paramDiscreteValue = New ParameterDiscreteValue
If t.Items.Count 0 Then
For ind = 0 To t.Items.Count - 1
paramField.ParameterFieldName = "Operator Team"
discreteVal = New ParameterDiscreteValue
discreteVal.Value = t.Items(ind).Text
paramField.CurrentValues.Add(discreteVal)
Next
Else
paramField.ParameterFieldName = "Operator Team"
discreteVal = New ParameterDiscreteValue
discreteVal.Value = "All"
paramField.CurrentValues.Add(discreteVal)
End If

paramFields.Add(paramField)

crReportDocument.SetParameterValue("Operator Team",
discreteVal)
'Bind the report to the viewer

CrystalReportViewer1.ReportSource = crReportDocument
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.DataBind()
' End Loading Report

'Export Code
oStream = crReportDocument.ExportToStream( _

CrystalDecisions.Shared.ExportFormatType.PortableD ocFormat)

With Response
.ClearContent()
.ClearHeaders()
.Buffer = True
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline;
filename=Report.pdf")
.BinaryWrite(oStream.ToArray())
.End()
End With

Sep 20 '06 #1
0 2777

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maria | last post by:
Hello! I am new to Crystal reports an I have problems passing parameters form outside to Crystal report an creating a report with data from more than one table This is the problem: I have to...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
0
by: John F | last post by:
Hi, If there is a more appropriate group for this, please point me in the right direction. I have a Crystal Report .rpt file that I can get to launch from my code and I can view it. I pass...
0
by: Dean Sabella | last post by:
Hi, I was trying to run a crystal report in the .net sample application given at: http://support.crystaldecisions.com/communityCS/FilesAndUpdates/ cppnet_win_subreport_basic.exe.asp (I've...
2
by: drisso | last post by:
Hello, I have searched that error on these message boards, msdn and crystaldecisions.com. I found tutorials that showed how to export a crystal report to pdf, but like many others I am getting...
12
by: Bill Nguyen | last post by:
What's the VB syntax to run the CR report using the following SP? I use CrystalreportViewer and ReportDocument. Thanks Bill Here's the SP in SQLserver 2K: CREATE proc mysp_ReportSubmission...
0
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable...
1
by: Hardy Wang | last post by:
Hi all, I have a piece of code in my C# console application to export from crystal report files to PDF. For some reports files, I get errors below. I have Crystal Reports 8.5 with service pack...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.