Hi all,
While I use the ReportDocument of vb.net to set filter to the data to the
Crystal Report, it is successful for the first time while running the
program. However, for the second time while running the program, when I set
filter to other set of data, all the data is lost.
Please help.
Thanks a lot,
Ray 6 5129
Hi Ray,
Can we see some code?
Bernie Yaeger
"Ray" <so*****@microsoft.com> wrote in message
news:ud**************@TK2MSFTNGP11.phx.gbl... Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while running the program, when I set filter to other set of data, all the data is lost.
Please help. Thanks a lot, Ray
Dear Bernie,
Here is the code.
## Code for define the Report Document
Dim ReportDoc As New ReportDocument
Dim pfieldname As String = "abc"
Dim StrReport As String = ""
StrReport = "E:\test.rpt"
ReportDoc.Load(StrReport)
For Each table In ReportDoc.Database.Tables
logoninfo = table.LogOnInfo
With logoninfo.ConnectionInfo
.ServerName = "SERVER"
.DatabaseName = "Sea"
.UserID = "admin"
.Password = "abcd3"
End With
table.ApplyLogOnInfo(logoninfo)
Next table
ReportDoc.RecordSelectionFormula = "{TableName.fieldname} = """ &
pfieldname & """"
Dim Form As New frmPrintForm(temp, ReportDoc, blnPrintsw)
Form.Show()
###################################
I have created another form and put the crystalreportviewer on it. I pass
the ReportDocument defined by the code above to this form and the code is
Me.CRViewer.ReportSource = ReportDoc
Thanks a lot,
Ray
"Bernie Yaeger" <be*****@cherwellinc.com> ¦b¶l¥ó
news:uM*************@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g... Hi Ray,
Can we see some code?
Bernie Yaeger
"Ray" <so*****@microsoft.com> wrote in message news:ud**************@TK2MSFTNGP11.phx.gbl... Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while running the program, when I set filter to other set of data, all the data is lost.
Please help. Thanks a lot, Ray
Hi Ray,
OK, looked at the code. When you call the report the second time, what is
the value of pfieldname and what code calls the report? It must be
different code, because if you called this code again, pfieldname would have
to be the same (ie, abc).
Bernie
"Ray" <so*****@microsoft.com> wrote in message
news:ud**************@TK2MSFTNGP11.phx.gbl... Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while running the program, when I set filter to other set of data, all the data is lost.
Please help. Thanks a lot, Ray
Dear Bernie,
I use the text box to input the data name should be filtered and then
pass to the ReportDocument.
So I use the same code in the second time also. For the first time, I
call the report by input a data name to the text box while running the
program, then I close the report, then I input another data name to the text
box and call the report again. For this time, the necessary data cannot be
filtered out.
It seems that the report's data has been filtered to the data in the first
time, and since the data in the second time is not within the data in the
first time, so the data in the second time cannot be filtered out.
Is there any problems for my code?
Thanks a lot,
Ray
"Bernie Yaeger" <be*****@cherwellinc.com> ¦b¶l¥ó
news:eE**************@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g... Hi Ray,
OK, looked at the code. When you call the report the second time, what is the value of pfieldname and what code calls the report? It must be different code, because if you called this code again, pfieldname would
have to be the same (ie, abc).
Bernie
"Ray" <so*****@microsoft.com> wrote in message news:ud**************@TK2MSFTNGP11.phx.gbl... Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while running the program, when I set filter to other set of data, all the data is lost.
Please help. Thanks a lot, Ray
Hi Ray,
No, the code looks fine.
Does the report use a physical table, a view, an sp or a dataset to report.
I understand your point about it having been already filtered - that could
only happen, I think (since the report is closed and then again opened), if
the report is using a dataset/datatable as its source.
Try this: in the second pass, use the same pfieldname; if it works, then you
are correct and the data is filtered and has remained filtered. But that
would mean that the report is using a dataset/datatable. Once we know this,
we should be able to fix it.
Bernie
"Ray" <so*****@microsoft.com> wrote in message
news:Ow**************@tk2msftngp13.phx.gbl... Dear Bernie, I use the text box to input the data name should be filtered and then pass to the ReportDocument. So I use the same code in the second time also. For the first time, I call the report by input a data name to the text box while running the program, then I close the report, then I input another data name to the text box and call the report again. For this time, the necessary data cannot be filtered out. It seems that the report's data has been filtered to the data in the first time, and since the data in the second time is not within the data in the first time, so the data in the second time cannot be filtered out. Is there any problems for my code? Thanks a lot, Ray
"Bernie Yaeger" <be*****@cherwellinc.com> ¦b¶l¥ó news:eE**************@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g... Hi Ray,
OK, looked at the code. When you call the report the second time, what is the value of pfieldname and what code calls the report? It must be different code, because if you called this code again, pfieldname would have to be the same (ie, abc).
Bernie
"Ray" <so*****@microsoft.com> wrote in message news:ud**************@TK2MSFTNGP11.phx.gbl... > Hi all, > While I use the ReportDocument of vb.net to set filter to the data to > the > Crystal Report, it is successful for the first time while running the > program. However, for the second time while running the program, when I > set > filter to other set of data, all the data is lost. > > Please help. > Thanks a lot, > Ray > >
Dear Bernie,
Yes, if the same pfieldname is used. The same data will be filtered. How
to fix the problem?
Thanks,
Ray
"Bernie Yaeger" <be*****@cherwellinc.com> ¦b¶l¥ó
news:eg**************@TK2MSFTNGP15.phx.gbl ¤¤¼¶¼g... Hi Ray,
No, the code looks fine.
Does the report use a physical table, a view, an sp or a dataset to
report. I understand your point about it having been already filtered - that could only happen, I think (since the report is closed and then again opened),
if the report is using a dataset/datatable as its source.
Try this: in the second pass, use the same pfieldname; if it works, then
you are correct and the data is filtered and has remained filtered. But that would mean that the report is using a dataset/datatable. Once we know
this, we should be able to fix it.
Bernie
"Ray" <so*****@microsoft.com> wrote in message news:Ow**************@tk2msftngp13.phx.gbl... Dear Bernie, I use the text box to input the data name should be filtered and then pass to the ReportDocument. So I use the same code in the second time also. For the first time, I call the report by input a data name to the text box while running the program, then I close the report, then I input another data name to the text box and call the report again. For this time, the necessary data cannot
be filtered out. It seems that the report's data has been filtered to the data in the
first time, and since the data in the second time is not within the data in
the first time, so the data in the second time cannot be filtered out. Is there any problems for my code? Thanks a lot, Ray
"Bernie Yaeger" <be*****@cherwellinc.com> ¦b¶l¥ó news:eE**************@TK2MSFTNGP09.phx.gbl ¤¤¼¶¼g... Hi Ray,
OK, looked at the code. When you call the report the second time, what is the value of pfieldname and what code calls the report? It must be different code, because if you called this code again, pfieldname would have to be the same (ie, abc).
Bernie
"Ray" <so*****@microsoft.com> wrote in message news:ud**************@TK2MSFTNGP11.phx.gbl... > Hi all, > While I use the ReportDocument of vb.net to set filter to the data
to > the > Crystal Report, it is successful for the first time while running the > program. However, for the second time while running the program, when
I > set > filter to other set of data, all the data is lost. > > Please help. > Thanks a lot, > Ray > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: AMeador |
last post by:
I have, at one point in time, been a pretty good programmer, but
that was years ago. I can pass programming classes with and A with no
problem, but writting a business class application is a bit of...
|
by: Diggler |
last post by:
I was working on a report that is populated with three different tables in a
strongly-typed dataset. The tables are populated from custom objects rather
than directly from SQL Server. I loop...
|
by: Brad Allison |
last post by:
Okay, after spending the past 4 1/2 hours trying to figure this out I am
getting some answers but I am also getting very frustrated. And again, if
this is the wrong forum to post to I apologize.
...
|
by: Ray |
last post by:
Hi all,
While I use the ReportDocument of vb.net to set filter to the data to the
Crystal Report, it is successful for the first time. However, for the second
time, when I set filter to other set...
|
by: Ray |
last post by:
Dear Bernie,
Yes, if the same pfieldname is used. The same data will be filtered. But
I only use the code shown you before. I have not used any dataset or
datatable. How to fix the problem?...
|
by: Chubbly Geezer |
last post by:
I'm using a particular font (for credit card symbols) within a crystal
report which looks fine when I preview, however when I run the report with
real data, the font is now shown correctly. It...
|
by: mike11d11 |
last post by:
For some reason I'm getting no data populating in my crystal report. I
built my crystal report off my dataset in my project, and I fill the
dataset when opening the main form, and count the...
|
by: Sheryl 37 |
last post by:
Can any1 give me the coding for the following problem.....How to i filter data in Crystal Report using a combo option (e.g Company Name).
There1 combo box for the Company, and a crystal report....
|
by: narpet |
last post by:
Hello all...
I have a C# forms application that I am developing using MS Visual Studio 2005. I am trying to add some Crystal Reports to this application using the built in Crystal Reports tools...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |