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
Solved

selection formula and parameter to create Crystal Report

Posted on 2008-10-24
2
2,285 Views
Last Modified: 2013-11-07
Hello,
I have the following situation.
I am developing a web application to create Crystal Reports using CrystalReportViewer control.
Platform: ASP.NET (2.0), Code Behind: VB.NET, Database: Oracle 10G
In the form, I enter the search criteria and create a selection formula as well as parameter for the Crystal report. I know how to pass this selection formula and parameter in VB 6.0 but not in asp.net. Therefore, I am not looking for the answer in vb 6.0.
My question is after I creat the selection formula from the form's data entry, how can I call/pass this selection formula to create the crystal report using the crystal report viewer control.
Does anyone have a complete sample code which shows step by step of creating crystal reports using asp.net (vb.net) ?

For example, my selection formula is: strSelectionFormula (whatever is there)
my parameter is: strParam (whatever is there)
Next, I did the following lines
        Dim Report1 As ReportDocument
        Report1 = New ReportDocument()
        Report1.Load(Server.MapPath("CrystalReport\Sample.rpt"))

Then I do not know what to do. My crystal report viewer control is in the same page of web form. I am not calling a different page using response.redirect (reportpage.aspx). I hope my question is clear.

Thanks a ton in advance,
mamun

0
Comment
Question by:mamunahmed
2 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22798277
Here is a tutorial for VS2005.  I believe the same ideas will work with VS2008.  I think the parameter passing starts on page 141.  Check the table of contents.

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

mlmcc
0
 
LVL 4

Accepted Solution

by:
anipeddi earned 50 total points
ID: 22798375
Try This Code

Partial Class MyReport
    Inherits System.Web.UI.Page
 
    Private customerReport As ReportDocument
 
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
 
        ConfigureCrystalReports()
 
    End Sub
 
    Private Sub ConfigureCrystalReports()
 
        Dim Report1 as  ReportDocument()
        Report1=New ReportDocument()
        customerReport.Load(Server.MapPath("CrystalReport\Sample.rpt"))
                    CrystalReportViewer1.SelectionFormula = strSelectionFormula
         CrystalReportViewer1.ReportSource = customerReport
 
    End Sub
 
End Class

// Try this link for step by step instructions to create Crystal Reports with ASP.NET and VB.NET
http://www.aspfree.com/c/a/ASP.NET/Working-with-Parameters-with-Crystal-Reports-and-ASP-NET-2-0/

 
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

792 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