473,404 Members | 2,195 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,404 software developers and data experts.

rpt.recordselectionformula and subrpt.recordselectionformula

VB .NET 2002
Crystal Reports 9

Hello:
OK, I'm getting closer with this. Can someone please help with this last piece?

Main report oracle 7 db
Subreport totally unrelated historical Access .mdb

I need to take the user's input in a text box and pass the result (wildcard) to the record selection formula prior to refreshing the crystal report.

When I set the report source to the main report, I get all the results from the main report, but the subreport isn't being read correctly.

When I set the report source to the subreport, I get results in the subreport, I only get results in the subreport.

Makes sense, right?

But I NEED results in both whenever they exist.

How do I have the report source look at both reports? Or whatever I need to do to get results from both?

I'd really appreciate your feedback!
In Public Class:

Dim rpt As New CBOPARTSDESCFORMULA2()
Dim subrpt As New ReportDocument()
Here's the code in my display click button:

Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Dim mySubReportObject As CrystalDecisions.CrystalReports.Engine.SubreportOb ject
Dim MyReportObject As CrystalDecisions.CrystalReports.Engine.ReportObjec t

CrystalReportViewer1.ReportSource = rpt

Dim RecordSelectionFormula As String
Dim reportName As String

CrystalReportViewer1.SelectionFormula = RecordSelectionFormula

CrystalReportViewer1.RefreshReport()

If I change the report source = subrpt or reportdocument, I get results in the subreport.

What's the missing piece, please?

Thanks so much!

Helen
Nov 20 '05 #1
2 8183
Now, we're getting somewhere, I'm getting results in the subreport with this code, but for some reason it's bypassing the selection formula for the main report. Does anyone know what's wrong here, please?
==========
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click

Dim SelectFormula As String()
Dim reportName As String

subrpt = CBOPARTSDESCFORMULAReport.OpenSubreport("itemdesc" )

CBOPARTSDESCFORMULAReport.RecordSelectionFormula = SelectFormula("LowerCase({LINE_ITEM.CLIN_DESC}) LIKE '" & txtDesc().Text.ToLower & "' or LowerCase({LINE_ITEM.CLIN_EXT_DESC}) LIKE '" & txtDesc().Text.ToLower & "' or LowerCase({PROC_OBJECT_1.DOC_TITLE}) LIKE '" & txtDesc().Text.ToLower & "'")

CrystalReportViewer1.RefreshReport()
End Sub

Tks,
-H

"Helen" wrote:
VB .NET 2002
Crystal Reports 9

Hello:
OK, I'm getting closer with this. Can someone please help with this last piece?

Main report oracle 7 db
Subreport totally unrelated historical Access .mdb

I need to take the user's input in a text box and pass the result (wildcard) to the record selection formula prior to refreshing the crystal report.

When I set the report source to the main report, I get all the results from the main report, but the subreport isn't being read correctly.

When I set the report source to the subreport, I get results in the subreport, I only get results in the subreport.

Makes sense, right?

But I NEED results in both whenever they exist.

How do I have the report source look at both reports? Or whatever I need to do to get results from both?

I'd really appreciate your feedback!
In Public Class:

Dim rpt As New CBOPARTSDESCFORMULA2()
Dim subrpt As New ReportDocument()
Here's the code in my display click button:

Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Dim mySubReportObject As CrystalDecisions.CrystalReports.Engine.SubreportOb ject
Dim MyReportObject As CrystalDecisions.CrystalReports.Engine.ReportObjec t

CrystalReportViewer1.ReportSource = rpt

Dim RecordSelectionFormula As String
Dim reportName As String

CrystalReportViewer1.SelectionFormula = RecordSelectionFormula

CrystalReportViewer1.RefreshReport()

If I change the report source = subrpt or reportdocument, I get results in the subreport.

What's the missing piece, please?

Thanks so much!

Helen

Nov 20 '05 #2
Well, here's the answer. Just need to add the following prior to refreshreport:

CrystalReportViewer1.ReportSource = CBOPARTSDESCFORMULAReport

Had it misplaced in the pub class.

So, this one's done.
"Helen" wrote:
Now, we're getting somewhere, I'm getting results in the subreport with this code, but for some reason it's bypassing the selection formula for the main report. Does anyone know what's wrong here, please?
==========
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click

Dim SelectFormula As String()
Dim reportName As String

subrpt = CBOPARTSDESCFORMULAReport.OpenSubreport("itemdesc" )

CBOPARTSDESCFORMULAReport.RecordSelectionFormula = SelectFormula("LowerCase({LINE_ITEM.CLIN_DESC}) LIKE '" & txtDesc().Text.ToLower & "' or LowerCase({LINE_ITEM.CLIN_EXT_DESC}) LIKE '" & txtDesc().Text.ToLower & "' or LowerCase({PROC_OBJECT_1.DOC_TITLE}) LIKE '" & txtDesc().Text.ToLower & "'")

CrystalReportViewer1.RefreshReport()
End Sub

Tks,
-H

"Helen" wrote:
VB .NET 2002
Crystal Reports 9

Hello:
OK, I'm getting closer with this. Can someone please help with this last piece?

Main report oracle 7 db
Subreport totally unrelated historical Access .mdb

I need to take the user's input in a text box and pass the result (wildcard) to the record selection formula prior to refreshing the crystal report.

When I set the report source to the main report, I get all the results from the main report, but the subreport isn't being read correctly.

When I set the report source to the subreport, I get results in the subreport, I only get results in the subreport.

Makes sense, right?

But I NEED results in both whenever they exist.

How do I have the report source look at both reports? Or whatever I need to do to get results from both?

I'd really appreciate your feedback!
In Public Class:

Dim rpt As New CBOPARTSDESCFORMULA2()
Dim subrpt As New ReportDocument()
Here's the code in my display click button:

Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Dim mySubReportObject As CrystalDecisions.CrystalReports.Engine.SubreportOb ject
Dim MyReportObject As CrystalDecisions.CrystalReports.Engine.ReportObjec t

CrystalReportViewer1.ReportSource = rpt

Dim RecordSelectionFormula As String
Dim reportName As String

CrystalReportViewer1.SelectionFormula = RecordSelectionFormula

CrystalReportViewer1.RefreshReport()

If I change the report source = subrpt or reportdocument, I get results in the subreport.

What's the missing piece, please?

Thanks so much!

Helen

Nov 20 '05 #3

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

Similar topics

2
by: Darrin | last post by:
Hello, I am looking for a web reporting solution. I have researched some things on crystal reports but read that the version that is bundled with Visual Studio 2003 does not allow you to print...
2
by: Barry Edmund Wright | last post by:
Hi, I have two reports that I want to attach to the same email: rptBugReport rptBugLog I can sent the one using: DoCmd.SendObject acOutputReport, "rptBugReport", acFormatSNP How can I add...
2
by: carmen | last post by:
i have the folowing code Dim y As New frmCobranz Dim MyReport As New RPTCobranz MyReport.DataDefinition.RecordSelectionFormula = "{CobH.RelNbr}= y.txtNoRelac.Text...
0
by: hodgesp | last post by:
I have a c# web application. I have created a crystal report and report view er. I can get the report to display by itself but when I add a subreport I eithe r get a logon error or object not...
0
by: Rachana | last post by:
RecordSelectionFormula doesn't return correct records. every time Hi! I am working in VB6-CR8.5 Either I use RecordSelectionFormula or SqlQueryString, getting the same problem: My...
16
by: freedom | last post by:
How to use the record selection formula in CR9 programatically using vb.net? I have a combo box that displays the date. If I select date, I can generate a report based on the selected date. Thanks in...
1
by: justin00 | last post by:
I'm having some trouble whenever I'm trying to apply date queries to my report recordselectionformula. I'm using c# with an Access db. The report is a subquery with links already established...
15
by: WhiteShore | last post by:
I'm kinda stuck of making this Report1.RecordSelectionFormula = "{Sales.Date} In (" & Format(cboMonth.Text, "MMMM") & ")" it wont work to display monthly report based on combobox (january,...
3
by: charvi | last post by:
i am using crystal reports 9 i want a report to know the time spent on each day for a client here i use cross tab report now if i want to see for a particular month how to query it pls help
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.