473,811 Members | 3,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I pass multiple discrete values to a ReportDocument using SetParameterVal ue()?

Is it possible to pass multiple discrete values to a report document so
that I can export it to PDF?

I've managed to perform the following code to display a Crystal Report
Viewer ok, but i want to be able to export that to a PDF and print it.

Dim invNos As New ArrayList -- populated elsewhere in my code.
Dim oRpt As New ReportDocument
oRpt.Load(MapPa th(<crystalRepo rt>))

Dim crParameterFiel ds As ParameterFields
Dim crParameterFiel d As ParameterField
Dim crParameterValu es As ParameterValues
Dim crParameterDisc reteValue As ParameterDiscre teValue

CrystalReportVi ewer1.ReportSou rce = oRpt
crParameterFiel ds = CrystalReportVi ewer1.Parameter FieldInfo
crParameterFiel d = crParameterFiel ds.Item("InvNos ")
crParameterValu es = crParameterFiel d.CurrentValues

For i = 0 To invNos.Count - 1
crParameterDisc reteValue = New ParameterDiscre teValue
crParameterDisc reteValue.Value = invNos(i)
crParameterValu es.Add(crParame terDiscreteValu e)
crParameterDisc reteValue = Nothing
Next

CrystalReportVi ewer1.Parameter FieldInfo = crParameterFiel ds

-- The code below errors as I haven't managed to pass my
-- InvNos parameter to my ReportDocument.

Dim st As System.IO.Strea m
st = oRpt.ExportToSt ream
CrystalDecision s.Shared].ExportFormatTy pe.PortableDocF ormat)
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.Binary Write(b)
Response.End()

I've also read this document
(http://support.businessobjects.com/l...s/c2013539.asp)
which states you can't use SetParameterVal ue() method to pass multiple
values.

So anyone got any ideas how i can? Or is it possible to export my
CrystalReportVi ewer to PDF?

Many thanks in advance for any suggestions.

Dan Williams.

Jun 27 '06 #1
1 7133
OK, think i've managed to solve this one myself.

All you need to do is pass the crParameterValu es to the ReportDocuments

SetParameterVal ue function
i.e. oRpt.SetParamet erValue("InvNos ", crParameterValu es)

Thanks anyway

Dan

Jun 28 '06 #2

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

Similar topics

4
2582
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through multiple records and want two values depending on the row they select. slaveform: x=selected
0
1629
by: Brenny | last post by:
Hi I'm developing a project and in the project, I used crystal report. Firstly my database isn't protected with password. After finishing project I determined a password for my database. Firstly I opened my database as private usage. I determined a database password. Only password, there iso no login ID or user ID. After that, I edited my crystal report.In the crystal report I changed only jet database password. In the report...
1
4646
by: crjunk | last post by:
I've got an aspx page that allows the user to select different options whenever they want to run a report. On this page, I have added an additional text box for the user to enter in comments about the report they are running. I would like to be able to have the comments that the user has entered to appear on the report that is generated. I thought that I might be able to pass this text to the report by using a session variable but I...
8
6582
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable, and then I had other usercontrols simply read this by traversing the class structure: siteClass.userControlClass.specficVariable. That worked fine. The new site I'm working on is a bit different, as I'm using multiple
1
2253
by: Ray | last post by:
Dear all, How to pass parameter from vb.net to Crystal Report? I'm now using ReportDocument and CrystalReportViewer. However, I don't know how to pass a parameter to the report and print the parameter in the report. Please help. Thanks a lot, Ray
0
1112
by: Alison Givens | last post by:
Hello, I use VB.NET 2003 and CR. In a webform I have a report that has a range value parameter. This works perfectly. What I want, is an extra parameter in the report. This has to be discrete value parameter. I tried several options, but I can't get it to work. Can anybody tell me what lines of code I have to add to get the thing going? The discrete value parameter I want to add is called 'FiliaalKeuze'.
1
1930
by: Hexman | last post by:
Hello All, I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file. My question is: How do I pass parameters thru Crystal to modify printer behavior? For Instance: 1. Pass it a path & filename to save to. eg; "C:\ReportDist\R100102-060902.pdf" (included the date in the filename) 2. Tell the Adobe PDF printer to overwrite an existing file if...
0
2824
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 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:
1
3564
by: murthychvrm | last post by:
why we declare "ReportDocument doc;" in this coding?what it is doing here? using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI;
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
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 we have to send another system
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.