473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Filtering data in CR

TS
Hi all,
In my windows form, I need the user to select a client name from a combo box
and click on a button that opens another form having CRViewer showing the
data for that client selected.
I connected to the SQL database where the cbo box gets the clients names
from and I can see the names in cbo box. I created my CR and put the CRViewer
on another windows form. What's next? I need help with the code.
Thanks in advance
--
TS
Nov 21 '05 #1
3 1149
Hi TS,

There are several ways to do this. Perhaps the most straightforward would
be to pass a parameter to the report and set the report's record selection
criteria to include only the client names who match the parameter.

HTH,

Bernie Yaeger

"TS" <TS@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi all,
In my windows form, I need the user to select a client name from a combo
box
and click on a button that opens another form having CRViewer showing the
data for that client selected.
I connected to the SQL database where the cbo box gets the clients names
from and I can see the names in cbo box. I created my CR and put the
CRViewer
on another windows form. What's next? I need help with the code.
Thanks in advance
--
TS

Nov 21 '05 #2
TS
Thanks for your response. Can you tell me how the code for this looks like.
Or do you know of any white papers that can help with that.

"Bernie Yaeger" wrote:
Hi TS,

There are several ways to do this. Perhaps the most straightforward would
be to pass a parameter to the report and set the report's record selection
criteria to include only the client names who match the parameter.

HTH,

Bernie Yaeger

"TS" <TS@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi all,
In my windows form, I need the user to select a client name from a combo
box
and click on a button that opens another form having CRViewer showing the
data for that client selected.
I connected to the SQL database where the cbo box gets the clients names
from and I can see the names in cbo box. I created my CR and put the
CRViewer
on another windows form. What's next? I need help with the code.
Thanks in advance
--
TS


Nov 21 '05 #3
Hi TS,

Here's an example of passing a global variable to the report in order to
filter that report. 'globals' is a module that has global scope and has a
string variable in it called 'gl_selectionstring:

Dim mglobals As New globals
mglobals.gl_selectionstring = "{bnlsum.invnum} >= '" & startnumbox.Text &
Chr(39) & " and {bnlsum.invnum} <= '" & endnumbox.Text & Chr(39)

gl_browseprintvar = "f:\imcapps\bnlinv.rpt"

Dim newmdichild As New reportprinter_viewerparam

newmdichild.Text = "BNL Summary Invoice"

newmdichild.Show()

reportprinter_viewerparam is a form that displays the report. In that form,
here's the code for that report:

CrystalReportViewer1.SelectionFormula = mglobals.gl_selectionstring

CrystalReportViewer1.ReportSource = "f:\imcapps\bnlinv.rpt

HTH,

Bernie Yaeger

"TS" <TS@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
Thanks for your response. Can you tell me how the code for this looks
like.
Or do you know of any white papers that can help with that.

"Bernie Yaeger" wrote:
Hi TS,

There are several ways to do this. Perhaps the most straightforward
would
be to pass a parameter to the report and set the report's record
selection
criteria to include only the client names who match the parameter.

HTH,

Bernie Yaeger

"TS" <TS@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
> Hi all,
> In my windows form, I need the user to select a client name from a
> combo
> box
> and click on a button that opens another form having CRViewer showing
> the
> data for that client selected.
> I connected to the SQL database where the cbo box gets the clients
> names
> from and I can see the names in cbo box. I created my CR and put the
> CRViewer
> on another windows form. What's next? I need help with the code.
> Thanks in advance
> --
> TS


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: N.K. | last post by:
Hello, I'm trying to find a way to flexibly filter a column in a row of data read from a file. I will have data type of that column, the operation to be performed on it (like >, <, <= etc.) and the...
3
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
10
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
2
by: Jason Huang | last post by:
Hi, I use the ReadXML method in my C# Windows Form project. Here is some of my C# code: xmlDS.ReadXml(curDir + "\\Dept.xml") ; There're 20 rows and 5 columns in the Dept.xml. But now I just...
2
by: JUAN ERNESTO FLORES BELTRAN | last post by:
Hi you all, I am developping a python application which connects to a database (postresql) and displays the query results on a treeview. In adittion to displaying the info i do need to implement...
3
by: Shawn Ramirez | last post by:
As with most web applications speed is a huge deal to me in my applications. My customers don't really care if my app is a true 3 tier application or not, they just want it to be faster then it was...
3
by: Harry Haller | last post by:
Hello, I want to implement a generic list which will be used to display 7 columns in a GridView. One should be able to sort, filter and page each of the 7 columns. Ideally the filter should be...
0
by: Lyn | last post by:
I have a problem using the form .Filter and .FilterOn properties which causes Access to crash (as detailed in a separate post). The form operates in continuous mode, displaying matching records...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.