?
Solved

Crystal report viewer and ASP.NET 2.0

Posted on 2008-10-20
10
Medium Priority
?
695 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 900 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

777 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