Solved

Crystal report viewer and ASP.NET 2.0

Posted on 2008-10-20
10
690 Views
Last Modified: 2010-05-18
What I would like to do is to open a report I created in Crystal  report thru ASP.NET page.
The report I created has a stored procedure and has to pass  2 parameters- Yeardate and CustomerID.
In the page I  have both of the pareameters stored in variables. I would like to make this dynamic as I change to the valued of teh parameters , it would display it accordingly in the report.
My question is how would I apply those variables to tthe Crystal report  using that page. I do not want the user to be prompted to type the yeardate and custumerID. Im kind of stump on this. thanks.
Im looking for code /ecample on specifically connecting variables from an asp.net page(vb.net) to pass the parameters to to Crystal
0
Comment
Question by:zachvaldez
[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
  • 6
  • 4
10 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 22767534
Check this document
Starting on page 16 is a walkthrough on running a report with parameters

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
0
 

Author Comment

by:zachvaldez
ID: 22773041
Thanks,
   I went thru this, but I'm having difficulty in passing 2 parameters (pg 20-25). The earlier pages had great example, however, when I apply it to my scenario, I m prompted with a page that is asking for the parameters.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22773508
WHat code do you have for 1 parameter?

mlmcc
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 101

Expert Comment

by:mlmcc
ID: 22773509
0
 

Author Comment

by:zachvaldez
ID: 22778134
Here;'s code as I followed the walkthrough. hope it helps

Private Const PARAMETER_PROC_LEVEL As String = "@LIT">> this is the name of the parameter
        Dim myarraylist As ArrayList = New ArrayList()
         myarraylist.Add(sid)
        Dim reportpath As String = Server.MapPath("Reports/Term.rpt")

        RptViewer.ReportSource = reportpath
        Dim myParameterFields As ParameterFields = RptViewer.ParameterFieldInfo
  'Note everything seems OK to this point until I call this....
        SetCurrentValuesForParameterField(myParameterFields, myarraylist)


    Private Sub SetCurrentValuesForParameterField(ByVal myParameterfields As  ParameterFields, ByVal myArraylist As ArrayList)
        Dim currentparametervalues As ParameterValues = New ParameterValues()
     
        For Each submittedvalue As Object In myArraylist
            Dim myParameterDiscretevalue As ParameterDiscreteValue = New                           ParameterDiscreteValue()
               myParameterDiscretevalue.Value = submittedvalue.ToString()
                   currentparametervalues.Add(myParameterDiscretevalue)
                  Next
        Dim myParameterField As ParameterField = myParameterfields(PARAMETER_PROC_LEVEL)>>>
           'Here I got the error "Specified argument was out of the range of valid values"
                myParameterField.CurrentValues = currentparametervalues
           End Sub
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22779450
Does it work?

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22779488
Sorry missed the error line in my first look.

What is Parameter_PROC_LEVEL

mlmcc
0
 

Author Comment

by:zachvaldez
ID: 22782948
The example shows to create a constant .. IN this case,  the "@LIT" is the parameter pass in Crystal..
thanks
0
 

Author Comment

by:zachvaldez
ID: 22847670
the example walkthorugh  which I find difficulty following it.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 300 total points
ID: 22852445
I agree the walkthrough is difficult.  I don't have VS to work with otherwise I would build the code and be able to just show that,

This link shows how to pass a parameter at the end of the article

http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

690 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