Solved

how can we call crystal report into a .net aplication and pass parameters?

Posted on 2008-06-12
4
598 Views
Last Modified: 2013-11-26
how can we call crystal report into a .net aplication and pass parameters?
0
Comment
Question by:cinibia_nidhin
4 Comments
 
LVL 4

Accepted Solution

by:
habibb earned 170 total points
ID: 21768232
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 160 total points
ID: 21768365
0
 
LVL 14

Assisted Solution

by:rachitkohli
rachitkohli earned 170 total points
ID: 21768396
Here's an easy way to pass parameters      
' Declare variables needed to pass the parameters to the viewer control.
            Dim paramFields As New ParameterFields
            Dim paramField As New ParameterField
            Dim discreteVal As New ParameterDiscreteValue

' The first parameter is a discrete parameter with multiple values.
' Set the name of the parameter field, this must match a parameter in the report.
            paramField.ParameterFieldName = "@LevyYear"
'*** SETTING THE FIRST DISCRETE VALUE & PASS IT TO THE PARAMETER ***
            discreteVal.Value = "Levy Year: " & glbLevyYear
            paramField.CurrentValues.Add(discreteVal)
'*** ADDING THE PARAMETER TO THE PARAMETER FIELDS COLLECTION ***
            paramFields.Add(paramField)

 '*** PASSING A SECOND PARAMETER (DISCRETE VALUE) ***
            paramField = New ParameterField
            paramField.ParameterFieldName = "@Description"
            discreteVal = New ParameterDiscreteValue
            discreteVal.Value = "Levy Year: " & glbLevyYear & " | Commitment Number: " & glbCommitNumber
            paramField.CurrentValues.Add(discreteVal)
            paramFields.Add(paramField)
'*** DON'T FORGET TO ALWAYS ADD THE PARAMETER TO THE PARAMFIELDS AFTER ENTERING THE VALUE *** IT MUST BE ADDED AFTER EACH NEW PARAMETER ***

'*** SET THE PARAMETER FIELDS COLLECTION INTO THE VIEWER CONTROL ***
            crpViewer.ParameterFieldInfo = paramFields
0
 

Author Closing Comment

by:cinibia_nidhin
ID: 31466490
THANK U ALL..It worked
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now