944,144 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 8415
  • VB.NET RSS
Aug 14th, 2007
0

How can I generate report from data grid??

Expand Post »
Dear frens,

from your help I succeeded in creating data grid . Thank you for it.

Now i need to generate report from data grid.

my data grid code is as follows;
VB.NET Syntax (Toggle Plain Text)
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. <code class="inlinecode">
  3. Db1DataSet1.Clear()
  4. Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=K:\Database\db1.mdb"
  5. Dim con As OleDb.OleDbConnection = New OleDb.OleDbConnection(conStr)
  6. Dim S As String
  7. Dim datagrid1 As New DataGrid
  8. S = "select * from add1 where ID='" & TextBox1.Text & "'"
  9. Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(S, con)
  10. da.Fill(Db1DataSet1, "add1")
  11. datagrid1.DataSource = Db1DataSet1.DefaultViewManager
  12. </code>
  13. End Sub

Now I want to generate report from the data field available in data grid in the form :
[Salutation] [fname] [mname] [lname], [degree]
[Position]
[organisation]
[Street] [City]
[State]
[Country]
Phone:[tel1] ,[tel2],[tel3]
Fax: [fax]
Email: [email]
URL: [URL]

I want to make two columns in the report to show various contacts' addresses in the data grid into printable form by generating report.

I don have any idea to generate report as i have never done it .

Please provide me with help with necessary explanations.

Anticipating for your help

Regards;
Kshiteesh
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kshiteesh is offline Offline
23 posts
since Jun 2007
Aug 14th, 2007
0

Re: How can I generate report from data grid??

hai,
first check out -crystal report is installed in ur system& if its yes-then connect crystal report with db(by clicking on source option-present in file,menu)
And also manually connect db with reports-by writing code invb.net....i think after that,u should b able todo!!!!
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007
Aug 17th, 2007
0

Re: How can I generate report from data grid??

Ya. thanks Pretham. saroja

I did as u said. But I have a problem while designing a report. I have to put different text fields in a format however the values have variable lengths.

I found trouble in managing the gaps between the fields. Is there any process or solution to make such that the values autoaccomodate the text boxes so that it looks like
VB.NET Syntax (Toggle Plain Text)
  1. [Salutation] [fname] [mname] [lname], [degree]
  2. [Position]
  3. [organisation]
  4. [Street] [City]
  5. [State]
  6. [Country]
  7. Phone:[tel1] ,[tel2],[tel3]
  8. Fax: [fax]
  9. Email: [email]
  10. URL: [url]

for example above format should show in report as;
VB.NET Syntax (Toggle Plain Text)
  1. Dr. Preetham Saroja, Phd(USA)
  2. Executive Director
  3. International Centre for Information Technology
  4. 16 Avenue Stree, Mery Land
  5. 12121WA, USA
  6. Phone: 001923823283232, 0012832832382,001232323223
  7. Fax: 00123237626322
  8. Email: preetham.saroja@icit.org
  9. URL: www.icit.org

But I have the difficulty , like when I design long name keeping in mind and use short name instead for eg: Ram instead of Gangottery. then
a problem exists the space between two field vaues broadens....

I m using VB.net version 8. I m using msaccess as bacend.

Please help me and provide me with necessary code if there is any. I have got just a week left for the deadline of my project.

Anticipating your reply

Kshiteesh
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kshiteesh is offline Offline
23 posts
since Jun 2007
Dec 5th, 2008
0

Re: How can I generate report from data grid??

How can I generate report from data gridview control
Reputation Points: 8
Solved Threads: 1
Newbie Poster
gomathinayagam is offline Offline
15 posts
since Nov 2008
Dec 5th, 2008
0

Re: How can I generate report from data grid??

How can I generate report from data gridview in vb.net.
Reputation Points: 8
Solved Threads: 1
Newbie Poster
gomathinayagam is offline Offline
15 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Insert Image in to MYSQL 5.0 throw VB.NET ?
Next Thread in VB.NET Forum Timeline: MEnu Item Disable





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC