Solved

selection formula and parameter to create Crystal Report

Posted on 2008-10-24
2
2,258 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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

9 Experts available now in Live!

Get 1:1 Help Now