Solved

Crystal report viewer and ASP.NET 2.0

Posted on 2008-10-20
10
670 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
  • 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

17 Experts available now in Live!

Get 1:1 Help Now