473,836 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create New Row after filling a row of TEXT OBJECT

126 New Member
Hi there,

Using VBNET2008, Crystal Report 9, SQL SERVER 2000, Northwind database for application purposes.

The CrystalReportIn voice.RPT was embedded onto VBNET2008 FORM via CrystalReportVi ewer1 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

Expand|Select|Wrap|Line Numbers
  1.  Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowReport.Click
  2.  
  3.         Dim strSql As String = Nothing
  4.  
  5.         strSql &= "Select  OrderID,  OrderDate, ProductName" 
  6.         strSql &= " From Invoices "
  7.         strSql &= " Where CustomerId = '" & txtcustId.text & "' "
  8.  
  9.         sqlConn = New SqlConnection(connStr)
  10.         sqlCmd = New SqlCommand(strSql, sqlConn)
  11.         sqlConn.Open()
  12.         sqlDR = sqlCmd.ExecuteReader
  13.  
  14.         ' ---- setup crystal Report option and TEXT Pbject defination ---- '
  15.         Dim objRpt As New CrystalOrderInvoice
  16.         Dim cryTextObject As TextObject = Nothing
  17.         Dim FmulaNewLine As FormulaFieldDefinition = Nothing
  18.  
  19.         Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
  20.  
  21.         objRpt.Load(cryFolder)
  22.         Me.CrystalReportViewer1.ReportSource = objRpt
  23.         Me.CrystalReportViewer1.Visible = True
  24.  
  25.         While sqlDR.Read
  26.  
  27.             ' --- OrderID
  28.             cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
  29.             cryTextObject.Text = sqlDR("OrderID")
  30.  
  31.             ' --- OrderDate
  32.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
  33.             cryTextObject.Text = sqlDR("OrderDate")
  34.  
  35.             ' --- productname
  36.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
  37.             cryTextObject.Text = sqlDR("ProductName") 
  38.  
  39.           ' --- new line  
  40.               FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
  41.             FmulaNewLine.Text = Chr(10) & Chr(13)   
  42.  
  43.      End While
  44.  
  45.        sqlconn.Close
  46.  
  47.     End Sub
  48.  
  49.  
  50.  
  51.  Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowReport.Click
  52.  
  53.         Dim strSql As String = Nothing
  54.  
  55.         strSql &= "Select  OrderID,  OrderDate, ProductName" 
  56.         strSql &= " From Invoices "
  57.         strSql &= " Where CustomerId = '" & txtcustId.text & "' "
  58.  
  59.         sqlConn = New SqlConnection(connStr)
  60.         sqlCmd = New SqlCommand(strSql, sqlConn)
  61.         sqlConn.Open()
  62.         sqlDR = sqlCmd.ExecuteReader
  63.  
  64.         ' ---- setup crystal Report option and TEXT Pbject defination ---- '
  65.         Dim objRpt As New CrystalOrderInvoice
  66.         Dim cryTextObject As TextObject = Nothing
  67.         Dim FmulaNewLine As FormulaFieldDefinition = Nothing
  68.  
  69.         Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
  70.  
  71.         objRpt.Load(cryFolder)
  72.         Me.CrystalReportViewer1.ReportSource = objRpt
  73.         Me.CrystalReportViewer1.Visible = True
  74.  
  75.         While sqlDR.Read
  76.  
  77.             ' --- OrderID
  78.             cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
  79.             cryTextObject.Text = sqlDR("OrderID")
  80.  
  81.             ' --- OrderDate
  82.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
  83.             cryTextObject.Text = sqlDR("OrderDate")
  84.  
  85.             ' --- productname
  86.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
  87.             cryTextObject.Text = sqlDR("ProductName") 
  88.  
  89.             ' --- new line  
  90.             FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
  91.             FmulaNewLine.Text = Chr(10) & Chr(13)
  92.  
  93.         End While
  94.  
  95.        sqlconn.Close
  96.  
  97.     End Sub
  98.  
Mar 20 '10
19 5040
lenniekuah
126 New Member
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
Mar 28 '10 #11
MrMancunian
569 Recognized Expert Contributor
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
Mar 31 '10 #12
MrMancunian
569 Recognized Expert Contributor
Lennie,

The link you posted is dead...Click it yourself and you'll see. Perhaps you posted the wrong link?

Steven
Mar 31 '10 #13
lenniekuah
126 New Member
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: F8FDE4F259734A4 682E18729D263BD 11
Mar 31 '10 #14
MrMancunian
569 Recognized Expert Contributor
Ok, can you hook me up with the following libs?

- AxCRVIEWER9Lib
- CRVIEWER9Lib

Steven
Mar 31 '10 #15
lenniekuah
126 New Member
Here is the URL Link

1. Download Link: Click here to download file

http://rapidshare.com/files/37025391...alDLL.zip.html
MD5: CD6D0D9516E15F6 4F013209FB6DB7D 40
Mar 31 '10 #16
MrMancunian
569 Recognized Expert Contributor
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
Apr 2 '10 #17
lenniekuah
126 New Member
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.
Apr 3 '10 #18
MrMancunian
569 Recognized Expert Contributor
Hi Lennie,

Perhaps you can find something at the Crystal Reports forum: http://www.crystalreportsbook.com/Forum/.

Steven
Apr 3 '10 #19
lenniekuah
126 New Member
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.
Apr 4 '10 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

1
19192
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 Report at runtime? Example: private void button1_Click(object sender,
3
6277
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 create an subreport with one static text object it will not even then show at runetime.
1
6331
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 lot of reports made in Visual FoxPro. It would be nice if I could make a converter. I read VFP Report a.frx, see a text on position x,y in header and I create text object in crystal reports on the same position etc... and save the report to a.rpt....
1
12189
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 know how will this affect a report rendered by a crystal viewer. I have a web page with a crystal viewer rendering the report on the page. I build my application in one of my development machines and deploy it
3
3791
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 why is the bloody thing doing this. The paths have been checked and are correct. The crystal Report is a .rpt file. Not one created in the VS.net IDE but in crystal itself.
3
15043
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 the remote SQL DB and create a report on one of the tables. Every time I do it, I get the Logon Failed error (CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed) The internet search shows that this is a common problem,...
3
1802
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 I have an issue where the queries run for 4+ minutes so I don't want Crystal doing repeated legwork. I was under the impression that once the DataSet is filled and bound to the report the report (crystalviewer) would not need to re-run the...
1
11053
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 easily fill the fields in a simple report. So. I looked at datasets and I think I'll try this way first. I'm pretty new and I still don't understand much of this stuff. So. here is what I did . and it is not working :-(. 1.-create new windows...
8
3093
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 reflect the values they anticipate committing to see hypothetical totals of columns from a set of records. These records are displaying properly on my DataGrid but I'm not sure how to get Crystal Reports 10 to use as its datasource the dataset...
3
3068
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 crystal report using the crystal report viewer or crystal report document. Here is my code from vb6 Private Sub Form_Load() CrystalReport1.Connect = "DSN=perfection;UID=crystal;PWD=crystal" CrystalReport1.ReportFileName = "e:\Nittany...
0
9810
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
10821
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10573
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10241
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6973
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5812
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4001
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3102
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.