Click here to Skip to main content
11,479,841 members (47,129 online)
Click here to Skip to main content

Create flexible and robust reports using VB's datareport utility

, 4 Nov 2001 533.9K 18.5K 43
Rate this:
Please Sign up or sign in to vote.
This application shows how to create flexible and robust reports using VB's data report utility.

Sample Image - datarep.jpg

Introduction

This project will show you how to create reports in VB using the data report utility. This utility is very easy to use and it only takes minutes to create flexible reports using this utility. For this project, I have used the biblio database that comes with VB6, so make sure that the biblio database is available on your machine in the directory where VB is installed. I have used data environment to connect to the database and the report fetches the records directly from the database (via data environment). I wanted to write a complete article about the usage of this utility but alas! the time is short. So, you will have to delve into the code yourself to see what's happening. On the main form, you will see the following four buttons:

  1. Show Report: This will display the report on the screen.
  2. Print Report: This will send the report to the printer, printer should be installed or you will get an error message saying that no printer was found.
  3. Export to HTML: This will export your report to HTML format, you can select the number of pages you want to be exported to HTML.
  4. Exit: You can exit the application by clicking this button.

You can drag the fields directly from the data environment on to your report. That's it!!!!

Creating the application

Here are the steps needed to create the project:

  1. Start a new VB project (EXE).
  2. Insert data environment and change its connection property to point towards the biblio database that comes with VB.
  3. Insert a command and point it towards the publishers table.
  4. Insert a child command and point it towards a title table.
  5. Add a data report utility from the project menu.
  6. Open the data environment and data report windows and place them side by side.
  7. To change the data report utility to better suit the data environment that was previously defined, first change the data report's datasource property to dataenvironment1 (you can change the name of the data environment) and its datamember property to publishers. Next, right click anywhere within the data report window and choose the retrieve structure option. Click yes.
  8. Change the format of the report according to your own needs.
  9. See the form's code to understand the functions that are needed to display, print and export the report to HTML format.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

S.S. Ahmed
Web Developer
Pakistan Pakistan
S.S. Ahmed is a senior software engineer and works for a web and software development firm. Ahmed is a Microsoft Office SharePoint Server MVP. Ahmed specializes in creating database driven dynamic web sites. He has been creating customized SharePoint solutions for the last five years. Ahmed has worked in Visual Basic, Visual C, Java, ASP, .NET, SharePoint, InfoPath, BizTalk, etc. Ahmed enjoys travelling and has been to many parts of the world. Ahmed distributes most of his work freely to many internet sites. Ahmed also participates in different newsgroups and tries to help people out with their problems. Ahmed can be reached at share.point@yahoo.com

PEACE

S.S. Ahmed
Web: www.walisystems.com
Blog:www.sharepointblogs.com/ssa

Comments and Discussions

 
Questionexecuting shell script from VB Pin
bhaskar.paul6-Apr-12 2:55
memberbhaskar.paul6-Apr-12 2:55 
QuestionPrinting two items from one filed next to each other Pin
denric18-Jun-11 21:27
memberdenric18-Jun-11 21:27 
Generalrefresh datareport Pin
firosjas18-May-10 2:08
memberfirosjas18-May-10 2:08 
Generalversions of visual basc and crystal report Pin
firosjas18-May-10 2:04
memberfirosjas18-May-10 2:04 
Generaldata report refreshing Pin
firosjas18-May-10 2:02
memberfirosjas18-May-10 2:02 
GeneralReport by 1/2 band paper and creating pricelist like Pin
cherry michael18-Jan-10 16:57
membercherry michael18-Jan-10 16:57 
GeneralMy vote of 2 Pin
subdeery3-Jul-09 7:17
membersubdeery3-Jul-09 7:17 
Questionhow to find data from report using VB6.0 Pin
linda_azrul18-Mar-09 15:44
memberlinda_azrul18-Mar-09 15:44 
AnswerRe: how to find data from report using VB6.0 Pin
sowsri15-Aug-09 2:14
membersowsri15-Aug-09 2:14 
QuestionExporting in HTML from MSHFLEXIGRID ON FORM Pin
Parag Raibagkar29-Dec-08 20:36
memberParag Raibagkar29-Dec-08 20:36 
Generalhelp!!!! Pin
Xhanty8-Oct-08 7:26
memberXhanty8-Oct-08 7:26 
GeneralData report Pin
Payal Tewari22-Jun-08 21:59
memberPayal Tewari22-Jun-08 21:59 
Questiondata report user selection Pin
shaktipunjabi200820-May-08 6:25
membershaktipunjabi200820-May-08 6:25 
AnswerRe: data report user selection Pin
firosjas18-May-10 1:26
memberfirosjas18-May-10 1:26 
Questionhow to generate report on user's selection or conditions Pin
kiarm24-Apr-08 2:30
memberkiarm24-Apr-08 2:30 
GeneralThe most challenging report i have ever come across Pin
nareshagarwal19-Dec-07 0:46
membernareshagarwal19-Dec-07 0:46 
QuestionPrint forms, receipts and others reports Pin
nareshagarwal19-Dec-07 0:27
membernareshagarwal19-Dec-07 0:27 
GeneralGenerating data report from two different database Pin
vickyVB15-Sep-07 23:50
membervickyVB15-Sep-07 23:50 
QuestionHow to create data report base on user define entery Pin
Enyim7-Sep-07 2:02
memberEnyim7-Sep-07 2:02 
AnswerRe: How to create data report base on user define entery Pin
spidy22057-Jul-09 18:38
memberspidy22057-Jul-09 18:38 
Questionhow to create a report using vb as front end and access as backend? Pin
preci9-May-07 1:58
memberpreci9-May-07 1:58 
Questionis this a joke? Pin
isyan1-May-07 15:49
memberisyan1-May-07 15:49 
AnswerRe: is this a joke? Pin
PIEBALDconsult1-May-07 16:12
memberPIEBALDconsult1-May-07 16:12 
GeneralData Environment !!! Pin
Dawyne7-Apr-07 3:33
memberDawyne7-Apr-07 3:33 
Questionhow to bold and hight use in run time line on datareport Pin
trimurarisingh5-Mar-07 4:06
membertrimurarisingh5-Mar-07 4:06 
AnswerRe: how to bold and hight use in run time line on datareport Pin
tusprogramas716-Mar-07 16:59
membertusprogramas716-Mar-07 16:59 
GeneralRe: how to bold and hight use in run time line on datareport Pin
helitb5-Jun-07 19:11
memberhelitb5-Jun-07 19:11 
Generaldata report connection through coding Pin
vhinzhientt3-Jan-07 4:50
membervhinzhientt3-Jan-07 4:50 
GeneralRe: data report connection through coding Pin
oxela14-Jun-09 22:01
memberoxela14-Jun-09 22:01 
QuestionCoulmnwise total in VB6 data report utility Pin
arun a27-Oct-06 3:23
memberarun a27-Oct-06 3:23 
QuestionNumber of Records per page Pin
Andre Falci10-Oct-06 4:48
memberAndre Falci10-Oct-06 4:48 
QuestionRe: Number of Records per page Pin
lalit agrawal3-Nov-08 8:25
memberlalit agrawal3-Nov-08 8:25 
GeneralReport on user input [modified] Pin
Chira Chandra28-Sep-06 3:55
memberChira Chandra28-Sep-06 3:55 
GeneralRe: Report on user input Pin
mujahidah_2829-Jul-07 21:12
membermujahidah_2829-Jul-07 21:12 
GeneralRe: Report on user input Pin
oxela14-Jun-09 22:02
memberoxela14-Jun-09 22:02 
GeneralERROR: Invalid data source Pin
stun_dreamer5-Sep-06 21:47
memberstun_dreamer5-Sep-06 21:47 
Questionhow to eliminate duplicate records in combo box.. Pin
M.S.Ashok Kumar28-Aug-06 1:55
memberM.S.Ashok Kumar28-Aug-06 1:55 
AnswerRe: how to eliminate duplicate records in combo box.. Pin
tusprogramas716-Mar-07 17:04
membertusprogramas716-Mar-07 17:04 
QuestionHOW TO GET CRYSTAL REPORT IN MY COMPONENT LIST (CRYSTAL REPORT NOT FOUND DESPITE LOADING VB6) Pin
Durgesh Haritas23-Aug-06 21:40
memberDurgesh Haritas23-Aug-06 21:40 
GeneralDataReport in Vb6 Pin
Durgesh Haritas23-Aug-06 21:10
memberDurgesh Haritas23-Aug-06 21:10 
GeneralDataGrid Pin
arman_honey22-Aug-06 20:51
memberarman_honey22-Aug-06 20:51 
GeneralRecords repeatition in Data Report Pin
dpcwizard22-Jul-06 9:03
memberdpcwizard22-Jul-06 9:03 
Questioncustomized report? Pin
_kane_1-Feb-06 5:32
member_kane_1-Feb-06 5:32 
Generalerror in source files Pin
math1111-Jan-06 11:43
membermath1111-Jan-06 11:43 
Generali,Calling VB Data Reports through ASP.NET application Pin
babatalya21-Nov-05 20:24
memberbabatalya21-Nov-05 20:24 
Generali,Calling VB Data Reports through ASP.NET application Pin
babatalya21-Nov-05 20:20
memberbabatalya21-Nov-05 20:20 
QuestionSequence no. generation for each record in Data Report Pin
NishthaSH17-Oct-05 20:44
memberNishthaSH17-Oct-05 20:44 
AnswerRe: Sequence no. generation for each record in Data Report Pin
roshni7512-Dec-05 23:13
memberroshni7512-Dec-05 23:13 
QuestionRe: Sequence no. generation for each record in Data Report Pin
ENVIROSOFT28-Apr-07 7:08
memberENVIROSOFT28-Apr-07 7:08 
GeneralReport does not when executed through exe on different machine Pin
akhaware3-Jul-05 23:17
sussakhaware3-Jul-05 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 5 Nov 2001
Article Copyright 2001 by S.S. Ahmed
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid