Solved

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

Posted on 2008-06-12
4
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Accepted Solution

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

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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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