473,386 Members | 1,708 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,386 software developers and data experts.

Generating Reports Using VB.net

zxc
hi i want to ask how can we retrieve data from MS sql server table
northwind and generate report of same data in formated form in MS word
using VB.net ... i need its code can any one help please .. its real
urgent .. i m currently using Visual Studio 2003 ... and MS SQL server
2003
thanks in advance

Apr 26 '06 #1
3 1811
Hi zxc,

imvho your question to be answered fully might even require a few years
of work, unless you need a real simple output and you want to use third
part tools which incorporate those functionalities. Just the making -
from scratch - of a report engine (which could also allow crosstabs,
sections, interruptions, cell merging, alarms, conditional formatting)
is quite an effort...

-tom

zxc ha scritto:
hi i want to ask how can we retrieve data from MS sql server table
northwind and generate report of same data in formated form in MS word
using VB.net ... i need its code can any one help please .. its real
urgent .. i m currently using Visual Studio 2003 ... and MS SQL server
2003
thanks in advance


Apr 26 '06 #2
zxc
hi tom
thanks for replying... i need a simple output .. i m able to write hard
coded values in MS word using VB.net but i m unable to write the values
from MS SQL database ... heres my code but problem is this when i run
this program a word document opens and displays SELECT emp_id, minit,
lname, fname FROM employee
but i want there database values not this exact statement .. how can i
do it .. a little help is needed here thanks
Word = CreateObject("Word.Application")
oWord.Visible = True
oWord.Activate()
'Create a new document.
oWord.Documents.Add()
Dim connStr As String = "workstation id='DEV-INTERN';packet
size=4096;integrated security=SSPI;data source='DEV-INTERN';persist
security info=False;initial catalog=pubs"
Dim myconnection As New SqlClient.SqlConnection(connStr)
Dim query As String = "SELECT emp_id, minit, lname, fname FROM
employee"
Dim mycommand As SqlClient.SqlCommand = New
SqlClient.SqlCommand
Dim rng As Word.Range = oWord.ActiveDocument.Range(start:=0, End:=0)
rng.Text = query
End Sub

Apr 28 '06 #3
Hello zxc,

sorry for delay. I have been busy on my project for few days.
If I were you I would export by using XML. It's extremely fast. Forget
about Ole, it's ridicolously slow. People would laugh at your program.

The same strategy can be used for EXCEL (whose xml is much much simpler
tha word's). Go here to study the basics:

http://blogs.msdn.com/brian_jones/

the rest you can learn by reverse eng.

Keep me update about your project I am interested in it. I have done
some massive export to Excel with XML and it is very handy and fast. I
never tried to export to word, but just for curiosity I have studied a
little its XML, and it is quite more complex than excel (because word
does more things and probably because Microsoft has put more effort in
it....)

tommaso

May 12 '06 #4

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

Similar topics

1
by: Raheel Hussain | last post by:
hi, guyz. I want to generate HTML based reports with ASP. But the problem which i m having is to controll the Paging operation while printing the reports. Unlike the Professional reports...
2
by: Vikram | last post by:
i want simple report functionality for which i do not want to use any reporting tool like crystal etc. Is there any class or code available which can be used for generating reports using asp.net...
4
gregerly
by: gregerly | last post by:
Hello All, I just wanted to get some input from the experts, what options are available for generating reports using PHP / MySQL. I can easily create HTML reports, but I'm thinking more along the...
1
by: sreedivya | last post by:
Hi, I am using Crystal Reports with .NET 2.0 for generating reports in my project. My database is SQLSERVER 2000. I want to display list of absentees between 2 given dates. For this I have written...
0
by: Aswanth | last post by:
I'm Generating Reports in SSRS-2005.. Previously I got the Data from One Database & Generated Reports.. Now I used to get the Data from Two Different Databases(ie Database-1 & Database-2) & to...
0
by: Aswanth | last post by:
I'm Working with Asp.Net with C#.. & I'm Generating Reports in SSRS-2005.. Till Now I'm Generating Reports in SSRS-2005 with Stored Procedure.. in Which I'm Generating Reports for One...
0
by: Aswanth | last post by:
I'm Using Asp.Net with C# & SSRS 2005 for Generating Reports.. I'm Having HUGE Data in Text Log File.. I want to Get this Data from this Log File & to Generate REPORTS in SSRS 2005.. Please...
1
by: Aswanth | last post by:
I'm Using Asp.Net with C# & SSRS 2005 for Generating Reports.. I'm Having HUGE Data in Microsoft Excel Sheets .. I want to Get this Data from this Microsoft Excel Sheets & to Generate REPORTS in...
1
by: sbettadpur | last post by:
hello everybody, please give me an information for generating reports in pdf format. where i will get library files, with an example of creating pdf files thank you
2
by: veer | last post by:
hi i made program in which i am generating the report of a ms-table database it works fine only on my computer and generatin the reports but when i run this exe on any computer the whole programe...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...

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.