Saturday, March 10, 2012

How to call crystal report in Visual Basic 2010 with Record Selection Formula

Visual Basic Sample code on how to call and filter crystal report in Visual Basic 2010 using the Record Selection Formula. Download Project


Visual Basic Source Code
 
Imports CrystalDecisions.CrystalReports.Engine
Imports System.IO

Public Class Form1


    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cryReport As New ReportDocument
        RepLocation = Path.GetFullPath( _
            Path.Combine(Application.StartupPath, "..\..")) & _
            "\CrystalReport1.rpt"

        cryReport.Load(RepLocation)
        If TextBox1.Text <> "" Then
            cryReport.RecordSelectionFormula = "{Customer.CustomerID} = " & TextBox1.Text
        End If
        CrystalReportViewer1.ReportSource = cryReport
        CrystalReportViewer1.Refresh()
    End Sub
End Class

42 comments:

djiesoft team said...

keren!!!! sip banget!

Zil said...

thanks for this piece of code!! :)

gunadaya said...
This comment has been removed by the author.
gunadaya said...

ijin sedot gan...thanks
Gunadaya.com

aparna john said...

Hi, Nice Visual Basic Program in Crystal Report.Thanks, its really helped me......

-Aparna
Theosoft

Purushothaman Mathakode said...

Superb and Simple Coding

Anonymous said...

Plese Could you send your code..

Thanks a lot

peterson said...

Your information about VB scripts is really interesting and innovative. Also I want you to share latest updates about this VB. Can you update it in your website? Thanks for sharing
Dot net training institute in Chennai

venkatesh krishna said...

Nice peice of example. thanks for sharing

SEO training in chennai

murali karthik said...

Thanks for sharing your informative article on investing in social media marketing. Your entire blog was totally awesome. Keep on updating with such awesome information. SEO Training in Chennai

jack wilson said...

Thank You for Sharing Valuable Information. I like this blog and this is very informative.

Dot Net Course in Chennai

swetha raj said...

Thanks a lot.i have learned to lot. of information.hadoop training chennai

john son said...

This information you provided in the blog that was really unique I love it!!, Thanks for sharing such a great blog..Keep posting..

J2EE Training in Chennai

sewahg v said...

Thank you so much.hadoop training in chennai

Mahesh Gajipara said...

Thank You Very Much Its Really Working

Tutarni Aliya said...

Hi visualbasicnetcode Thanks for your post, really working for the practics

Andria BZ said...

Thanks for sharing these niche piece of coding to our knowledge. Here, I had a solution for my inconclusive problems & it’s really helps me a lot keep updates…
DOT NET Training in Chennai

rebeka christy said...

Dot Net Training Chennai

Thanks for your wonderful post.It is really very helpful for us and I have gathered some important information from this blog.If anyone wants to get Dot Net Training in Chennai reach FITA, rated as No.1 Dot Net Training Institute in Chennai.





jack wilson said...

I have read your blog and i got a very useful and knowledgeable information from your blog.its really a very nice article. I did Loadrunner Training in Chennai. This is really useful for me. Suppose if anyone interested to learn Manual Testing Training in Chennai reach FITA academy located at Chennai Velachery.

regards...

Software Testing Training in Chennai

dhanamlakshmi palu said...

.This Information very helpful for the beginners.In this each step have a wonderful explaination.I would study and known about the application.thanks for giving wonderful information.
PHP Training in chennai | PHP Training chennai | PHP course in chennai | PHP course chennai

Jitendra singh said...

this information very useful and helpful . i am very interested your post
website designing company in India

Isak Hoxha said...

thanks, an important source for me

Roberto said...

Muy bueno.
Mas ejemplos: http://tupagina.comuf.com/

Zach said...

I am using crystal report 9. Once i install my program (vb.net 2008) on any other PC with different SQL server name, to view the reports it is asking database connection and if i give relative server name,user and pass it will fail to connect. So i need to know how to update connection string for reports dynamically.

PLC Training in Chennai said...

thanks for sharing

Rohit P said...

nice informative article
good to know that reports also has this kind of presentations
seo reports also helps in analysis your complete business online through different mode of digital marketing
just learn seo seo training in bangalore

Priya said...

Really interesting content which is interesting and provided me the required information.
SEO Training in Chennai | SEO courses in Chennai | SEO training Chennai | SEO institutes in Chennai

Web Designers Pitampura said...

This is the precise weblog for anybody who needs to seek out out about this topic. You notice so much its almost arduous to argue with you. You positively put a brand new spin on a subject that's been written about for years. Nice stuff, simply nice!

akmal niazi khan said...

Programming is very interesting and creative thing if you do it with love. Your blog code helps a lot to beginners to learn programming from basic to advance level. I really love this blog because I learn a lot from here and this process is still continuing.
Love from Pro Programmer

NetTech India said...

Thanks for sharing such a useful information.
We a whole team from Nettech India appreciates you.

NetTech India said...

Thanks for sharing such a useful information.
We a whole team from Nettech India appreciates you.

Nikshitha S said...

The usage of third party storage system for the data storage can be avoided in cloud computing and we can store, access the data through internet.
cloud computing training in chennai | cloud computing courses in chennai

Nikshitha S said...

Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
Hadoop Training Chennai | PHP Training in Chennai

Nikshitha S said...

The content you posted helps me to get the in depth knowledge about the various technology and it is very interesting to go through it. Thanks for sharing it.
AngularJS Training in Chennai | AngularJS course in Chennai

YouLoseBellyFat said...

VBasic Examples

Mobile Game Developers Delhi said...

Awesome work.Just wanted to drop a comment and say I am new to your blog and really like what I am reading.Thanks for the share

mythily mythu said...

Awesome work.
hibernate training in chennai

1croreprojects said...

Thanks for sharing this valuable information.
ieee java projects in chennai
ieee dotnet projects in chennai
mba projects in chennai
be projects in chennai
ns2 projects in chennai
mca projects in chennai
bulk projects in chennai
bsc projects in chennai
msc projects in chennai

Iqbal Dlk said...

very nice and informative blog
dot net training in chennai
java training in chennai

Iqbal Dlk said...

very useful blogs.
hotels near us consulate chennai
hotels near apollo hospital chennai

yasar said...

very nice and informative blog
big data projects chennai
mobile computing projects chennai
cloud computing projects chennai
secure computing projects chennai

Rajapriya R said...

helpful article.. this blog having very clear content so easy to understand

dot net training | best dot net training | dot net training and placement | dot net training in chennai

Post a Comment

 
Powered by Blogger