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
  3.         Dim strSql As String = Nothing
  5.         strSql &= "Select  OrderID,  OrderDate, ProductName" 
  6.         strSql &= " From Invoices "
  7.         strSql &= " Where CustomerId = '" & txtcustId.text & "' "
  9.         sqlConn = New SqlConnection(connStr)
  10.         sqlCmd = New SqlCommand(strSql, sqlConn)
  11.         sqlConn.Open()
  12.         sqlDR = sqlCmd.ExecuteReader
  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
  19.         Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
  21.         objRpt.Load(cryFolder)
  22.         Me.CrystalReportViewer1.ReportSource = objRpt
  23.         Me.CrystalReportViewer1.Visible = True
  25.         While sqlDR.Read
  27.             ' --- OrderID
  28.             cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
  29.             cryTextObject.Text = sqlDR("OrderID")
  31.             ' --- OrderDate
  32.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
  33.             cryTextObject.Text = sqlDR("OrderDate")
  35.             ' --- productname
  36.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
  37.             cryTextObject.Text = sqlDR("ProductName") 
  39.           ' --- new line  
  40.               FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
  41.             FmulaNewLine.Text = Chr(10) & Chr(13)   
  43.      End While
  45.        sqlconn.Close
  47.     End Sub
  51.  Private Sub btnShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowReport.Click
  53.         Dim strSql As String = Nothing
  55.         strSql &= "Select  OrderID,  OrderDate, ProductName" 
  56.         strSql &= " From Invoices "
  57.         strSql &= " Where CustomerId = '" & txtcustId.text & "' "
  59.         sqlConn = New SqlConnection(connStr)
  60.         sqlCmd = New SqlCommand(strSql, sqlConn)
  61.         sqlConn.Open()
  62.         sqlDR = sqlCmd.ExecuteReader
  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
  69.         Dim cryFolder As String = "H:\VBNet2008CrystalReportApps\CrystalOrderInvoice.rpt"
  71.         objRpt.Load(cryFolder)
  72.         Me.CrystalReportViewer1.ReportSource = objRpt
  73.         Me.CrystalReportViewer1.Visible = True
  75.         While sqlDR.Read
  77.             ' --- OrderID
  78.             cryTextObject = objRpt.ReportDefinition.ReportObjects("ctxtOrderId")
  79.             cryTextObject.Text = sqlDR("OrderID")
  81.             ' --- OrderDate
  82.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtOrderDate")
  83.             cryTextObject.Text = sqlDR("OrderDate")
  85.             ' --- productname
  86.             cryTextObject = objRpt.ReportDefinition.ReportObjects("cTxtProduct")
  87.             cryTextObject.Text = sqlDR("ProductName") 
  89.             ' --- new line  
  90.             FmulaNewLine = objRpt.DataDefinition.FormulaFields("FmulaNewLine")
  91.             FmulaNewLine.Text = Chr(10) & Chr(13)
  93.         End While
  95.        sqlconn.Close
  97.     End Sub
Mar 20 '10
19 5040
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 ?

Mar 28 '10 #11
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 :-)

Mar 31 '10 #12
569 Recognized Expert Contributor

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

Mar 31 '10 #13
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

MD5: F8FDE4F259734A4 682E18729D263BD 11
Mar 31 '10 #14
569 Recognized Expert Contributor
Ok, can you hook me up with the following libs?


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

1. Download Link: Click here to download file

MD5: CD6D0D9516E15F6 4F013209FB6DB7D 40
Mar 31 '10 #16
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?


Apr 2 '10 #17
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
569 Recognized Expert Contributor
Hi Lennie,

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

Apr 3 '10 #19
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

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,
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.
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....
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
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.
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,...
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...
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...
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...
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...
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...
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...
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,...
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...
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();...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.