Solved

Crystal report viewer and ASP.NET 2.0

Posted on 2008-10-20
10
687 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 100

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 100

Expert Comment

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

mlmcc
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 100

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 100

Expert Comment

by:mlmcc
ID: 22779450
Does it work?

mlmcc
0
 
LVL 100

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 100

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

740 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