Hi there,
Using VBNET2008, Crystal Report 9, SQL SERVER 2000, Northwind database for application purposes.
The CrystalReportInvoice.RPT was embedded onto VBNET2008 FORM via CrystalReportViewer1 whose datasource was not connected to table or dataset.
As requested by Team Leader, 3 Crystal Report TEXT OBJECT were inserted in the Crystal Report SECTION DETAILS which are filled with data using DATA READER which consist of 7 rows of data but only one row was display because the DATAREADER Row override the row before it becaues no NEW LINE was created .
Here are the coding - Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowReport.Click
-
-
Dim strSql As String = Nothing
-
-
strSql &= "Select OrderID, OrderDate, ProductName"
-
strSql &= " From Invoices "
-
strSql &= " Where CustomerId = '" & txtcustId.text & "' "
-
-
sqlConn = New SqlConnection(connStr)
-
sqlCmd = New SqlCommand(strSql, sqlConn)
-
sqlConn.Open()
-
sqlDR = sqlCmd.ExecuteReader
-
-
' ---- setup crystal Report option and TEXT Pbject defination ---- '
-
Dim objRpt As New CrystalOrderInvoice
-
Dim cryTextObject As TextObject = Nothing
- Dim FmulaNewLine As FormulaFieldDefinition = Nothing
-
-
Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
-
-
objRpt.Load(cryFolder)
-
Me.CrystalReportViewer1.ReportSource = objRpt
-
Me.CrystalReportViewer1.Visible = True
-
-
While sqlDR.Read
-
-
' --- OrderID
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
-
cryTextObject.Text = sqlDR("OrderID")
-
-
' --- OrderDate
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
-
cryTextObject.Text = sqlDR("OrderDate")
-
-
' --- productname
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
-
cryTextObject.Text = sqlDR("ProductName")
-
-
' --- new line
-
FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
-
FmulaNewLine.Text = Chr(10) & Chr(13)
-
-
End While
-
-
sqlconn.Close
-
-
End Sub
-
-
-
-
Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowReport.Click
-
-
Dim strSql As String = Nothing
-
-
strSql &= "Select OrderID, OrderDate, ProductName"
-
strSql &= " From Invoices "
-
strSql &= " Where CustomerId = '" & txtcustId.text & "' "
-
-
sqlConn = New SqlConnection(connStr)
-
sqlCmd = New SqlCommand(strSql, sqlConn)
-
sqlConn.Open()
-
sqlDR = sqlCmd.ExecuteReader
-
-
' ---- setup crystal Report option and TEXT Pbject defination ---- '
-
Dim objRpt As New CrystalOrderInvoice
-
Dim cryTextObject As TextObject = Nothing
-
Dim FmulaNewLine As FormulaFieldDefinition = Nothing
-
-
Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
-
-
objRpt.Load(cryFolder)
-
Me.CrystalReportViewer1.ReportSource = objRpt
-
Me.CrystalReportViewer1.Visible = True
-
-
While sqlDR.Read
-
-
' --- OrderID
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
-
cryTextObject.Text = sqlDR("OrderID")
-
-
' --- OrderDate
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
-
cryTextObject.Text = sqlDR("OrderDate")
-
-
' --- productname
-
cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
-
cryTextObject.Text = sqlDR("ProductName")
-
-
' --- new line
-
FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
-
FmulaNewLine.Text = Chr(10) & Chr(13)
-
-
End While
-
-
sqlconn.Close
-
-
End Sub
-
Hi Lennie,
I spent almost an entire day on getting your solution even to run, but without any result. I give up, perhaps someone else?
Sorry.
Steven
19 5016
For as far as I can see, you refill the same objects over and over again in your loop.You should create the new objects within your While...End While-loop.
Try - cryTextObject = New objRpt.ReportDefinition.ReportObjects("ctxtOrderId ")
-
etc...
Steven
Hi Awesome MrMancunian
Thank you again for your information. I will try it out. Once I got it working I will post the coding here to share with Newbies who have the same approach.
You are very awesome.
Cheers,
Lennie
Hi MrMancunian
I amended the codes by adding the word NEW
cryTextObject = New objRpt.ReportDefinition.ReportObjects("ctxtOrderId ")
cryTextObject = New objRpt.ReportDefinition.ReportObjects("cTxtOrderDa te")
cryTextObject = New objRpt.ReportDefinition.ReportObjects("cTxtProduct e")
It generated this error message to my surprise. Type 'objRpt.ReportDefinition.ReportObjects' is not defined.
Can you put up your complete solution for download? Then I can try it at my own PC :-)
Steven
Hi MrMancunian,
I have extracted all the coding and pasted on WORD Document. How to download it so that you have try it ? Do you mean paste the coding here as I have initially done it when I asked for help ?
I don't see any Attachment Button opton here.
Cheers,
Lennie
Hi Lennie,
Just ZIP your complete solution and put it up for download at rapidshare or something alike :-) Then send me the URL...
Steven
Hi MrMancunian,
I have no idea of any Internet Server where I can download my zip files
Hi MrManCunian,
Thank you very much for your offer to help me. You are very awesome person.
I have download it as VbNet2008Crystal.zip in the http://www.rapidshare.com/...
Here is the URL Link: http://rs102tl.rapidshare.com/cgi-bi...04693242865787
Prior to download, I was testing almost similar application developed by another progammer and I encounter this error message from Crystal Report Viewer:- AxCrystalActiveXReportViewer1
With Me.AxCrystalActiveXReportViewer1
.ReportSource = cryRpt <--- generate error "This value is Write-only "
.Refresh()
End With
Thank you for your help.
Have a Good Day,
Cheers,
Lennie
Hi MrManCunian,
Lennie here,
How's my downloaded ZIP application regarding Crystal Report TEXT OBJECT ?
Can you please get back to me with information ?
Thanks
Hi Lennie,
I've been away for a few days, so I wasn't able to respond. I will download your solution right away and get back to you soon :-)
Steven
Lennie,
The link you posted is dead...Click it yourself and you'll see. Perhaps you posted the wrong link?
Steven
Hi MrMancunian,
Good to meet you again. It's wonderful that you have a break.
I have uploaded the ZIP file again and the URL LINK is listed beow 1. Download Link: Click here to download file http://rapidshare.com/files/37022395...ystal.zip.html
MD5: F8FDE4F259734A4682E18729D263BD11
Ok, can you hook me up with the following libs?
- AxCRVIEWER9Lib
- CRVIEWER9Lib
Steven
Hi Lennie,
I spent almost an entire day on getting your solution even to run, but without any result. I give up, perhaps someone else?
Sorry.
Steven
Hi MrMancunian, Thank you very much for spending your precious time trying to solve my coding problems. Please do not feel bad about it without the solution. I really appreciate your effort trying to help me. You are a very awesome person.
Once I got the coding working and running, I will share it with you and other Newbies by posting it here.
Here is the explanation why using Crystal Report TEXTOBJECT. Instead of creating alot of Crystal Reports for transactions reporting, it's better to use TEXTOBJECTs ( Eg. txtData1, txtData2, txtData3, txtData4, txtData5, etc...)
With these txtData as TEXTOBJECT name it creates the Crystal Report very flexible. The various Progams that extraction different transactions from SQL SERVER use DATAREADER and fill the rows of records into txtDATA object.
That will save the company development time and cost.
I am hoping that some VB.NET Crystal Report Developer will share their knowledge of how to create a new row after fill the txtDATA object instead of override the txtDATA objects like its happening right now. Instead of displaying 7 rows of data it display only the last row as it overrides the row before it. Have a Good Day, MrMancunian.
Hi MrMancunian,
I did submit the problem to the URL link and until today I have not received any response from them. I am not sure they did not responsed to it.
Nevetheless, I will logged on to the URL Link to check it out.
Thank you very much for the URL Link.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stephan |
last post by:
Hi,
I'm using Visual Studio 2003 (C#) with the integrated
Crystal Report software and have the following question:
How can I assign a value (string) to an unbound (string)
field in Crystal...
|
by: Stig |
last post by:
I'm having two tables with no relation and I want to list them both in one
report. How can I do this. I have tried to use sub report, but cant get it to
work? can someone please help me.
If I just...
|
by: Rutko |
last post by:
Is it possible to dynamically create report and save it in rpt file?
For example I want to add an text object in report on x,y position in page
header. I need that dynamically, because I have a...
|
by: Karthic |
last post by:
When i right click on the .rpt file in the VS 2003, i see a property
printer setting.
It says "No printer" on the top and there is option to select printer
and paper settings etc..
I want to...
|
by: Deasun |
last post by:
I need some help please!
Crystal is driving me nuts.
Heres my code so far, see below.
Problem:
On the .export() line it comes back with error #5 Login failed!
I know the login info is good so...
|
by: Milan Todorovic |
last post by:
Hello,
I need help. I have experience in ASP.NET programming, but this is my first
dealing with Crystal Reports. I'm trying to make the most basic report
purely for testing purposes: connect to...
|
by: dekern |
last post by:
Good afternoon all,
I guess I am missing the benefit of using datasets with Crystal. For
years I have written wrapper apps that used the Pull method and I let
Crystal do all the sql work. Now...
|
by: Rodo |
last post by:
Hi all,
I'm trying to generate a simple crystal report without a database. Several
people mention the use of a dataset. Someone mention in a msdn forum that I
could use the SetParameterValue to...
|
by: Brock |
last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The
reason for this is that I want the user to be able to change values
without updating the database, but still have their report...
|
by: firozfasilan |
last post by:
I am new to visual basic 2008. In the past I have used vb6 to display an existing crystal report. I would like to accomplish the same with vb.net. However I am not clear on the syntax to display a...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |