Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Visual Basic 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 47

Visual Basic 6 (VB6)

Top of Form

partner-pub-3010 FORID:10

Search
Bottom of Form

RSS: Site Feed

Navigate To

Home Tutorials Source Code Samples Add Your Tutorial VB.NET Tutorials Forums Articles External Links Advertise Here! Contact Us Beginner Guide Controls Guide Database Guide Introduction to SQL Using Data Control Using DAO Code Using RDO Using ADO ADO and ListView ADO stored procs Using Crystal Reports

Guides

Navigation

Create content
Top of Form

User login
Username: *

Password: *
Log in

Create new account Request new password


form-90e9ed801 user_login_block
Bottom of Form

Home Tutorials

Using Crystal Reports


Level: Written By TheVBProgramer. This tutorial shows you how to use Crystal Reports 4.6, which is the version of Crystal Reports that shipped with Visual Studio / Visual Basic 6.0. Crystal Reports provides a relatively easy way to incorporate reporting into your application. The basis of a report is a database query. It should be pointed out that this version of Crystal Reports is quite old, and that this version and the past versions of Crystal Reports that have shipped with VB are generally "watered down" versions that do not have all the bells and whistles of the standalone product that is sold by Seagate Software. Furthermore, CR 4.6 will not work with MS-Access databases higher than Access 97. That said, what you learn about designing reports with CR 4.6 will help when working with later versions. Regarding the MS-Access issue, later versions of Access (2000, 2002, etc.) can read and save in Access 97 format. Installing Crystal Reports 4.6 Crystal Reports 4.6 is bundled with Visual Studio/Visual Basic 6.0, but it is not installed automatically. To install it manually, locate the CRYSREPT folder on your installation CD for Visual Studio 6.0, the path is COMMON\TOOLS\VB\CRYSREPT on the third CD. In that folder, double-click the file CRYSTL32.EXE. You will be asked if you want to install Crystal Reports. Respond Yes. It will then tell you where it is going to install CR; you can override the location if desired. Following that, CR will be installed, and a few moments later you should get a message indicating that installation was successful. The Sample Database The sample database used for this tutorial (as well as others to follow) is an Access 97 format database named EMPLOYEE.MDB.

EMPLOYEE.MDB contains three tables: EmpMast, DeptMast, and JobMast. The tables are structured as follows: EmpMasttable: Field Name EmpNbr EmpFirst EmpLast DeptNbr DataType AutoNumber Text (50) Text (50) Number (Long Integer) Comments Primary Key. Uniquely identifies each employee in the database. Employee's first name Employee's last name Foreign Key to PK of DeptMast table. Identifies which department the employee works in. Foreign Key to PK of JobMast table. Identifies the employee's job. Date the employee was hired Employee's hourly rate The number of hours per week the employee is scheduled to work.

JobNbr HireDate HrlyRate SchedHrs

Number (Long Integer) Date/Time Number (Single) Number (Single)

DeptMasttable: Field Name DeptNbr DeptName Location DataType Number (Long Integer) Text (50) Text (50) Comments Primary Key; uniquely identifies each department in the database. The name of the department. The department's location (could be a building, suite number, floor, etc.)

JobMasttable: Field Name DataType Comments

JobNbr JobTitle MinRate AvgRate MaxRate

AutoNumber Text (50) Number (Single) Number (Single) Number (Single)

Primary Key; uniquely identifies each job in the database. The job title (description). The minimum hourly rate that somebody working in this position is usually paid. The average hourly rate that somebody working in this position is usually paid. The maximum hourly rate that somebody working in this position is usually paid.

Designing the Reports Two reports will be developed from this database: "Annual Salary Expenses by Department" and "Annual Salary Expenses by Job". For the Annual Salary Expenses by Department report, you want to show various fields from the employee database tables grouped and subtotaled by department. You also want to show a grand total at the end of the report. A sketch of the design might look something like the following:

Annual Salary Expenses by Department JOB WKLY HRLY EMP # EMP NAME # JOB TITLE HIRE DATE HOURS RATE ANN SALARY ----- -------- --- --------- --------- ----- ---- ----------

DEPT XXXX XXXXXXXXXXXXXXXX


XXX XXXXXXXXXXXXXXX XXX XXXXXXXXXX XX/XX/XX XX.XX XX.XX $XXX,XXX.XX XXX XXXXXXXXXXXXXXX XXX XXXXXXXXXX XX/XX/XX XX.XX XX.XX $XXX,XXX.XX DEPT XXXX XXXXXXXXXXXXXXXXXXXXXXXX TOTALS: $XXX,XXX.XX . . . GRAND TOTALS: $XXX,XXX.XX

The design of the Annual Salary Expenses by Job report is similar, except that you want to show various fields from the employee database tables grouped and subtotaled by job. You might sketch the design as follows:

Annual Salary Expenses by Job DEPT WKLY HRLY EMP # EMP NAME # DEPT NAME HIRE DATE HOURS RATE ANN SALARY ----- -------- --- --------- --------- ----- ---- ----------

JOB XXX XXXXXXXXXXXXXXXX


XXX XXXXXXXXXXXXXXX XXXX XXXXXXXXXX XX/XX/XX XX.XX XX.XX $XXX,XXX.XX XXX XXXXXXXXXXXXXXX XXXX XXXXXXXXXX XX/XX/XX XX.XX XX.XX $XXX,XXX.XX JOB XXX XXXXXXXXXXXXXXXXXXXXXXXX TOTALS: $XXX,XXX.XX . . . GRAND TOTALS: $XXX,XXX.XX

This tutorial will start off by showing the step-by-step process for designing the first report, "Annual Salary Expenses by Department". Once that is done, it will be a simple matter to copy that report and modify it to create the Annual Salary Expenses by Job report. With the report designs in mind, open Crystal Reports (Report Designer) from the VB Add-Ins menu:

A registration form appears. Click the Cancel button.

From the Crystal Reports File menu, select New:

The Create New Report dialog box appears. Click the Standard button.

The Create Report Expert dialog box appears with the Step 1: Tables tab open. Click the Data File button:

The Choose Database File dialog box appears. Navigate to the directory where your database file resides, then click the name of the database file so that it appears under "File Name:". Click the Add button, then click the Done button.

The 2: Links tab then appears, showing you a diagram similar to that of Access' Relationships diagram.

Move on by clicking the 3: Fields tab.

The "3: Fields" tab initially looks like this:

Using the "Add ->" button, select the desired fields from the "Database Fields" listbox so that they appear in the "Report Fields" listbox. Select the fields based on the initial design. For fields that are involved in a primary key foreign key relationship, only select one of those fields from either table (for example, select the DeptNbr field from either the DeptMast table OR the EmpMast table, but not both). Select the following Database Fields: Select DeptNbr and DeptName from theDeptMast table. SelectEmpNbrFrom the EmpMast table. Skip down to the JobMast table and select the JobNbr and JobTitle. Jump back up to the EmpMast table and select the HireDate, HrlyRate, and SchedHrs. Your screen should look like this:

Still sticking with Tab 3, you can specify column headings by selecting each of the Report Fields in turn, and giving them a heading by typing the desired text in the "Column Heading:" textbox (by default, the column heading is the same as the field name). Specify the column headings as follows: Report Field DeptMast.DeptNbr DeptMast.DeptName EmpMast.EmpNbr JobMast.JobNbr JobMast.JobTitle EmpMast.HireDate EmpMast.HrlyRate EmpMast.SchedHrs Column Heading Dept # Dept Name Emp # Job # Job Title Hire Date Hrly Rate Wkly Hours

We're still not done with Tab 3. We need two computed columns, one for the employee name (which will be a concatenation of the EmpLast and EmpFirst fields) and one for the annual salary (which will be the employee's hourly rate multiplied by their weekly hours multiplied by 52). Click the Formula button. The "New Formula" dialog box appears. Type EmpName in the textbox and click OK

The "Edit Formula" dialog box appears. In the "Formula text" area, type: TrimRight ({EmpMast.EmpLast}) + ", " + TrimRight ({EmpMast.EmpFirst}) Your screen should look like this:

Note: Crystal Reports has its own formula syntax, which differs from the syntax of VB and Access expressions. You can scroll the "Fields", "Functions", and "Operators" listboxes above the Formula text entry area to see what's available. Also, instead of typing everything directly into the text entry area, you can double-click on a listbox selection and the text of that selection will appear in the Formula text box. Click the Check button. If you entered the formula correctly, the message "No errors found" will pop up. Passing that, click the Accept button. The formula will then appear in the Database Fields listbox (as "@EmpName"). With @EmpName highlighted, click the "Add->" button to add it to the Report Fields list. In the Report Fields list, drag and drop "@EmpName" so that it appears under "EmpMast.EmpNbr". Give @EmpName a column heading of "Employee Name".

Now we must create the annual salary formula. To do so, follow these steps: Make sure anything OTHER than @EmpName is selected in the Database Fields listbox. Click the Formula button. In the "New Formula" dialog box, type "AnnSal" and click OK. In the "Edit Formula" dialog box, type {EmpMast.HrlyRate} * {EmpMast.SchedHrs} * 52 click Check, then Accept. Use the "Add->" button to bring @AnnSal over from the Database Fields list to the Report Fields list. In the Report Fields listbox, drag and drop the @AnnSal formula so that it is the last field in the list. Give @AnnSal a column heading of "Ann Salary".

Click the 4: Sort tab. Select DeptMast.DeptNbr from the "Report Fields" list and click the "Add->" button. DeptMast.DeptNbr then appears in the "Group Fields" list. Repeat this process for @EmpName. Your screen should look like this:

Click the 5: Total tab. Within this Total tab, an inner tabbed dialog appears, with one tab for each field selected in the sort. On the "DeptMast.DeptNbr" tab, remove all items except "@AnnSal" from the Total Fields list, as shown below. What we are saying is that we want to print a subtotal for the annual salary every time there is a change, or break, in the department number.

Still in the "5: Total" tab, click the "@EmpName" tab and remove all items from the Total Fields list, as shown below. (We don't want to print subtotals after every employee name.)

We don't need to do anything in tab 6, so click the 7: Style tab. For the title, type "Annual Salary Expenses by Department".

Click the Preview Report button. At this time, the "Create Report Expert" is finished and you can't go back to it, but you can make any desired changes in the Crystal Reports interface. Following is the screen that is initially displayed after you click the Preview Report button from Step 7 of the Expert:

On the Crystal Reports toolbar, click the Zoom button, so you can see what the Expert did for you (it gives you a start, but it needs some work):

Click the Design tab:

Perform the following steps to fix up the report: Go to the File menu, select Printer Setup, and change the Orientation to Landscape. In the Page header area, click the title ("Annual Salary Expenses by Department") to select it. Resize the title so that it spans the width of the entire report. Go to the format bar and click the center button to center the title. From the Insert menu, select Text Field. In the dialog box that appears, type Run Date: and click the Accept button. At that point, your mouse pointer will also have box representing the text field you just entered. Drag this box to the line where the date is. Use your mouse to arrange the items so that they look like this:

Still in the Page Header area, remove the column headings for Dept # and Dept Name. (Do this by selecting each item with the mouse and pressing the Delete key.) In the first area labeled #1: DeptNbr A (the one aboveDetails), select the item there and delete it. In the Details area, select the DeptNbrandDeptName fields, and drag them with the mouse to the first #1: DeptNbr -A area. Once in the new area, select these two fields and click the Bold button. Insert a text field in this area (using the same technique as you did with "Run Date:") with the text "Department:". Make this text field bold as well. Arrange the fields so that they look like the following (you can resize a field by selecting it and dragging on the handles, just like resizing a control on a VB form):

Note that the default format for the department number contains a comma. We don't want that. Right click the department number, and select Change Format from the context menu. The Format Number dialog appears, as shown below. Clear the "Thousands Separator" checkbox and click OK. (Note: You can also add or remove comma formatting by selecting the field and clicking the comma button on the formatting toolbar.)

Remove the commas from the formats for the employee number and the job number. Resize the fields on the detail line and resize their corresponding column headings so that the column headings can be fully read and the field data is lined up beneath them. Use the screen shot below as a guide:

In the second area labeled #1: DeptNbr A (the one belowDetails), you will see a text item (denoted by X's) on the far left of the line. Delete that text item. In the same area, toward the right-hand side of the line, you will see a numeric item (denoted by "55.56"). This is the department subtotal. Resize this item to make it larger, and move it to the right so that it lines up with the detail annual salary field, as shown below:

Insert a text field with the text "Subtotal for Department" to the left of the subtotal (not to the immediate left, because we are going to insert another field between these two). Click the Bold button to make it bold. On the Insert menu, select Database Field The "Insert Database Field" dialog box comes up (shown below). From it, select DeptNbr and drag the DeptNbr field to the subtotal line, between the text "Subtotal for Department" and the numeric subtotal.

The second area labeled #1: DeptNbr A should now look like this:

In the area of the report labeled Grand Total, delete all fields except the first one (a text item with the text "Grand Total") and the last one (a numeric item that is the grand total of the annual salaries). Resize and line up the remaining two items so that the report looks like the following:

In the Page Footer area of the report, there is a field for the page number. With your mouse, move this field up to the right-hand side of the page heading area. Add a text field that says "Page:" and place it adjacent to the page number, as in the following screen-shot:

That's just about it. Click the Preview tab to check out the finished product. Due to the fact this was set up to print in landscape orientation, a few screen shots are presented to show the final report. Below is the left-hand side of the report:

Scrolling to the right, we see the following:

Scrolling down, we see the following:

At this point, if you want to do any further tweaking, you can click the Design tab and do so. You can also print the report at this time. Before exiting Crystal Reports, save the report in the same directory as your VB project, under the name SALDEPT.RPT (Crystal Reports automatically appends the .RPT extension). The real objective is to be able to print the report from the VB program. The how-to for that is coming up shortly, but first, there is another report to create. The second report is

similar to this one, except that it will be sorted and subtotaled by job, not department. Fortunately, this second report does not have to be built from scratch. We can modify the first report to create the second report. To create the second report, follow these steps: 1. Copy the SALDEPT.RPT file and name the new file SALJOB.RPT. 2. Double-click SALJOB.RPT to open it in Crystal Reports. 3. Dismiss the registration screen by clicking Cancel. 4. Click the Design tab. 5. From the Report menu, select Report Title ... The Edit Report Title dialog box appears. Change the title to Annual Salary Expenses by Job and click the Accept button. 6. From the Report menu, select Change Group Expert. The Edit Group Section dialog box appears. There should only be one item in the listbox, reading Group #1: DeptMast.DeptNbr A. Select that item and click OK. Another Edit Group Section dialog box appears. The first combo box should have "DeptMast.DeptNbr" selected. Click the drop down arrow and select JobMast.JobNbr and click OK. 7. In the Page header area, right-click the title, select Edit Text Field, change the word "Department" to "Job" and click Accept. 8. The next objective is to switch the department fields in the first #1: JobNbr Aarea with the job fields in the Details area. To do this, perform the following steps: a. Move the job number and job title fields from the Details line to an open area of the #1: JobNbr A line. b Move the department number and department name fields from the first #1: JobNbr A line to the space formerly occupied by the job fields in the Details line. Resize the department name field so that it fits. c. In the first #1: JobNbr A line, edit the text of the "Department:" text field so that it says "Job:". Move the job number and job title fields close to the "Job:" text field and make these two items bold.

d. In the Details line, remove the bold formatting from the department number and department name fields. e. Back in the Page header area, change the text of the "Job #" and "Job Title" column headings to "Dept #" and "Dept Name", respectively. f. Make cosmetic adjustments as necessary. 9. In the second #1: JobNbr Aarea, delete the department number field. Replace it with the job number field. To do this, go to the Insert menu, select Database field, and select JobNbr. Resize the JobNbr field so that its small enough to fit where the department number used to be. Remove the commas from the formatting and make it bold. Edit the text field "Subtotal for Department", changing the word "Department" to "Job". Make cosmetic adjustments as necessary. 10. That's just about it. Click the Preview tab to view the fruits of your labor. If you wish, go back and make any adjustments you deem necessary and print out the report. When you are done, save the report and exit Crystal Reports. How to Print a Crystal Report from a VB Program First, you must add the Crystal Report control to your VB toolbox. To do so, go to Project Components and check Crystal Report Control 4.6 from the Components dialog box, as shown below:

The Crystal Reports control will then appear in the VB toolbox (it is circled in the screen shot below):

The form used in the demo application associated with this topic, named frmCRDemo, is shown below. The form contains two sets of option button control arrays (each contain two option buttons indexed 0 and 1). The first option button control array, named optReport, appears in the frame labelled "Select Report"; the second option button control array, named optDestination, appears in the frame labelled "Select Destination". The Crystal Report control was renamed rptAnnSalExp. No other properties of the Crystal Report control were set at design-time; all necessary properties are set in code at run-time. Only one Crystal Report control is necessary to print any number of reports off of a form. The Crystal Report control is not visible at run-time. Finally, there are two command buttons on the form; the OK button and the Exit button. The OK button runs the report based on the options selected by the user in the frames above; the Exit button ends the application.

Following is the code for both the frmCRDemo form and a standard module called modCommon. The Crystal Reports-related code will be explained following the code listings. Code for frmDemo: Option Explicit '----------------------------------------------------------------------Private Sub Form_Load() '----------------------------------------------------------------------CenterForm Me End Sub '----------------------------------------------------------------------Private Sub cmdOK_Click() '-----------------------------------------------------------------------

On Error GoTocmdOK_Click_Error Dim strReportName As String Dim intReportDestination As Integer If optReport(0).Value = True Then strReportName = "SALDEPT.RPT" Else strReportName = "SALJOB.RPT" End If If optDestination(0).Value = True Then intReportDestination = crptToWindow Else intReportDestination = crptToPrinter End If With rptAnnSalExp .ReportFileName = GetAppPath() &strReportName .DataFiles(0) = GetAppPath() & "EMPLOYEE.MDB" .Destination = intReportDestination .Action = 1 ' 1 = "Run the Report" End With Exit Sub cmdOK_Click_Error: MsgBox "The following error has occurred:" &vbNewLine _ &Err.Number& " - " &Err.Description, _ vbCritical, _ "cmdOK_Click" End Sub '----------------------------------------------------------------------Private Sub cmdExit_Click() '-----------------------------------------------------------------------

Unload Me End Sub

Code for modCommon: Option Explicit '----------------------------------------------------------------------Public Sub CenterForm(pobjForm As Form) '----------------------------------------------------------------------With pobjForm .Top = (Screen.Height - .Height) / 2 .Left = (Screen.Width - .Width) / 2 End With End Sub '----------------------------------------------------------------------Public Function GetAppPath() As String '----------------------------------------------------------------------GetAppPath = IIf(Right$(App.Path, 1) = "\", App.Path, App.Path& "\") End Function Note that in the cmdOK_Clickevent procedure, the variable strReportName is set to "SALDEPT.RPT" or "SALJOB.RPT", depending on which optReport button was clicked. The variable intDestination is set to either crptToWindow or crptToPrinter, both built-in Crystal Reports constants, depending on which optDestination button was clicked (if you choose to send the report to a window, a "print preview" type screen

appears allowing the user to view the report on screen; if you choose to send the report to the printer, it will be sent directly to the default printer with no preview). The sample app references the following properties of the Crystal Report control: ReportFileName refers to the name of the report definition that you saved in Crystal Reports. Alternatively, this property can also be set at design-time. DataFiles is a Crystal Reports property array specifying the database file(s) to be used as the basis for the report. The file you specify here will override the database file used when the report was created in Crystal Reports. Although different MDB files can be used (at Crystal Reports design-time vs. VB run-time), they still must contain the same table and/or query names, with the same structure, that were used to build the report. Destination refers to where you want to direct the output of the report. In code, you can use a predefined constant (like crptToPrinter) or its numeric equivalent as used in the sample code. This property can also be set at design-time. The sample app uses either crptToWindow (numeric value of 0) or crptToPrinter (numeric value of 1). Action is the property that triggers the running of the report. It must be set to 1 to run.

Download the project files for the sample application here.

Similar links
Naming Database Objects Access SQL VB6 With Access Oracle and Visual Basic using ADO Database Access with RDO (Remote Data Objects) Database Access with the Data Control Using ADO and the ListView control Visual Basic & ADO Tutorial Creating PDF files in Visual Basic VB6 Animated Charts (With FusionCharts)

383652 reads Thu, 07/21/2011 - 21:27 jkl (not verified)

pls help to link


pls help to link reply Thu, 07/21/2011 - 21:26 jkl (not verified)

i want to link the crystal


i want to link the crystal report 8.5 in vb6. i want the report's to be print and display when i click a command button please help me reply Fri, 06/03/2011 - 20:12 rock (not verified)

Thank you ...


Thank you ... reply Sat, 05/14/2011 - 01:10 mackyrey (not verified)

knows how to print now


THX for the tutorial..it helps me a top ^_^ reply Sat, 05/14/2011 - 01:12 mackyrey (not verified)

knows how to print now


*lot reply Wed, 04/27/2011 - 18:28 Anonymous (not verified)

hi
hi reply Wed, 03/16/2011 - 08:24 Anonymous (not verified)

Parameters not affected


Hi I use MS Acess 2003 and develop VB 6 and used Crystal Reprts 11, i made report and added dynamic parameters, but they are not affecting on report. How to do it? Please explain reply Sun, 03/06/2011 - 06:46 PriyabrataChakraborty (not verified)

To know How to make crystal report.


how to make crystal report in vb 6.0 reply Tue, 01/18/2011 - 08:15 shri (not verified)

IS IT POSSIABLE TO GET PAGE TOTAL ON EVERY PAGE OF CRYSTAL REPOR


IS IT POSSIABLE TO GET PAGE TOTAL ON EVERY PAGE OF CRYSTAL REPOR reply Mon, 01/03/2011 - 09:35 Abdul Saeed (not verified)

Program example of vb6 for multiple equipmets


I have learn at Ni.com How to control GPIB based single equipment by vb6. Now I want to control/communicate more than one GPIB equipments. Please help me in this regard. Thanks My email address is abdulsaeed150@gmail.com reply Sat, 10/30/2010 - 16:55 indra (not verified)

Friends please can you know


Friends please can you know the address for downloading crsytal not a free report ????? reply Wed, 10/20/2010 - 21:58 jainah (not verified)

caranampilkantanggalperiode
hai lam kenalya,,,, mhonbantuannyanihgimanacaranyanampilkantanggalperiode di crystal report seperti " 14-03-2010 s/d 14-10-2010" tanggal di ambildari database menggunakan program visual basic,,, terimakasihatasbalasannya reply Wed, 02/02/2011 - 19:11 Anonymous (not verified)

caranampilkantanggalperiode
MayongkangsilbiakikaniinbingOdokasimbahan reply Sat, 10/02/2010 - 19:20 Anonymous (not verified)

to know about crystal reports


sir i want to know that if this crystal report option is not present in addins then what can i do reply Wed, 08/25/2010 - 00:02 Nikita (not verified)

Creating crystal Report


I had develop a database project in vb 6.0 and backend as Microsoft Sql Server 2005. i m not able to open the database in crystal report section, How to connect the database, can u plz help me reply Tue, 08/10/2010 - 02:57 SK (not verified)

Re: Creating serial numbers in crystal report in VB6

i wish to know how to generate the serial number (like 1,2,3, .. for every record) using crystal report in VB6. reply Sun, 08/01/2010 - 00:22 hariharshrestha (not verified)

hi
how to save photo in database reply Sun, 08/01/2010 - 00:22 hariharshrestha (not verified)

hi
how to save photo in database reply Tue, 01/18/2011 - 05:02 Anonymous (not verified)

just using save image


just using save image reply Thu, 06/10/2010 - 00:56 Anonymous (not verified)

vb code for creat new table..


how to creat a new table in ms access using vb 6 codes... reply Sat, 06/05/2010 - 12:38 akhileshkumaryadav (not verified)

How To Add ms access 2000/2003..etc database in CRYSTL32.EXE


in CRYSTL32.EXE ms access 95/97 formate database only added but i want to add other version of ms access like 2000/2003...etc reply Sun, 06/19/2011 - 06:44 Anonymous (not verified)

access 2003
there's one way to open up you access 2003 database in cystal 32, convert access 2003 to access 97, ive had similar problems like that. that's the only remedy i could tell you reply Sat, 10/02/2010 - 15:05 Anonymous (not verified)

Not possible
Not possible reply Sun, 05/02/2010 - 11:20 Jose David (not verified)

More than 2 tables in a report

Hi, I'm trying to create a report on VB 6, CR 4.6. The problem is that every time I try with more than 2 tables (I'm using ODBC) it doesn't work (well, at least that's what I have realized). The report is very simple, it only has three JOINs. Thanks, reply Fri, 04/23/2010 - 02:42 sundar (not verified)

insert crystal reports in vb0.6


I am using vb0.6 cry rpt0.8 Idesain a project in vb and insert cry rpt in form and conect with my oricaldatabase. but i want know how to open database for cry reps al redey i open my databas for my vb form use but i'cont open my database for cry rpt plz send me suttable code for this error reg sundar reply Wed, 04/14/2010 - 09:24 Anonymous (not verified)

hi, please help on crystal report installer


hi, can you give me a link where to find an installer of crystal report 4.6? im really in need of it. thanks. reply Mon, 04/05/2010 - 08:16 bhuvaneshwari (not verified)

vb-report
how to get the report designer in vb if it is not in add-ins..? reply Sun, 04/04/2010 - 03:08 joben (not verified)

how to access a database with password


how can i send the password at runtime? when i am accessing the report my system asks for a database password , how can i send the password at run time so that it will not ask for a password ? thanks in advance reply Tue, 07/06/2010 - 12:34 Esau (not verified)

withcrviewer
withcrviewer dimmcrAPP As New CRAXDRT.Application dim Report As CRAXDRT.Report Set Report = crAPP.OpenReport("path\namereport.rpt") Report.Database.Tables(1).SetLogOnInfo "servername", "database", "user", "password" with control crystal report you use controlcrystalreport.logonserver "dll","servername", "database", "user", "password" reply

Wed, 05/26/2010 - 10:10 Ahmedd (not verified)

Use Connect property and


Use Connect property and define your database connection parameters reply Wed, 02/02/2011 - 19:16 Anonymous (not verified)

Public gconAudit
Public gconAudit As ADODB.Connection Public cmdAudit As ADODB.Command Public AUDIT_OK As Boolean Function OpenSQLAudit() As Boolean On Error GoToerrcde Set gconAudit = New ADODB.Connection gconAudit.Mode = adModeReadWrite gconAudit.CursorLocation = adUseClient gconAudit.ConnectionString = DMIS_Audit_Connection gconAudit.Open OpenSQLAudit = True AUDIT_OK = True Exit Function errcde: OpenSQLAudit = False AUDIT_OK = False End Function Sub LogAudit(USER_ACTION As String, MODULE_NAME As String, Optional ByValTrackingMemo As String = vbNullString) AUDIT_OK = False If AUDIT_OK = False Then Exit Sub If TrackingMemo<>vbNullString Then Public gconAudit As ADODB.Connection Public cmdAudit As ADODB.Command Public AUDIT_OK As Boolean Function OpenSQLAudit() As Boolean On Error GoToerrcde Set gconAudit = New ADODB.Connection gconAudit.Mode = adModeReadWrite gconAudit.CursorLocation = adUseClient gconAudit.ConnectionString = DMIS_Audit_Connection gconAudit.Open OpenSQLAudit = True AUDIT_OK = True Exit Function errcde: OpenSQLAudit = False AUDIT_OK = False End Function

Sub LogAudit(USER_ACTION As String, MODULE_NAME As String, Optional ByValTrackingMemo As String = vbNullString) AUDIT_OK = False If AUDIT_OK = False Then Exit Sub If TrackingMemo<>vbNullString Then gconAudit.Execute ("INSERT INTO DMIS_AUDIT ( USER_ID, USER_ACTION,MODULE_NAME, ACTION_DATE,TRACKING_MEMO) VALUES( " & LOGID & "," & N2Str2Null(USER_ACTION) & "," & N2Str2Null(MODULE_NAME) & " , getdate(), " & N2Str2Null(TrackingMemo) & ")") Else gconAudit.Execute ("INSERT INTO DMIS_AUDIT ( USER_ID, USER_ACTION,MODULE_NAME, ACTION_DATE) VALUES( " & LOGID & "," & N2Str2Null(USER_ACTION) & "," & N2Str2Null(MODULE_NAME) & " , getdate())") End If End Sub reply Mon, 03/01/2010 - 02:44 afsar (not verified)

Crystal report
how to Make a Report in Run time, kindly send me the step by step(Screen Shot) reply Thu, 02/25/2010 - 19:24 Anonymous (not verified)

how to show subreport that


how to show subreport that are suppressed using codes? reply Sat, 02/06/2010 - 00:05 Muhammad Yousaf (not verified)

Great
HHello!! I am new comer in this field its very help ful, I did not now hw to use. But i done nw. reply Mon, 02/01/2010 - 22:35 DigvijaySarnaik (not verified)

crystal report info


sir/madam, i create salary payment crystal report. my error is i dont show 5th digit code number of employee but first first 3digit show also space what i do ? reply Wed, 02/10/2010 - 03:19 Ravi Kumar Noneria (not verified)

crystal report info


Please describe Field description where you have to got 3 digit number instead of 5 Thanks

reply Wed, 12/09/2009 - 02:32 Anonymous (not verified)

crystal report with VB DAO


Can anybody kindly help me with step by step coding of using crystal report 9 with VB DAO ( Access Database)? I am able to create crystal report but not able to connect with VB DAO. Regards Aditi reply Mon, 11/23/2009 - 01:17 Anonymous (not verified)

Crystal mitGraphiken und VB6


Hallo Zusammen, ichhabeeinkleines Problem In Crystal 9 habeicheinen Report erstellt, der eineGrafikenthlt. DieseGrafikstelleichbestimmteEigenschaftenwirLiniendiagrammusw.ein. Wennich nun dieseGrafik resp. den Report via VB6 ApplikationaufrufeerhalteichimmereinBalkendiagramm. Was muss ichhierfr Parameter mitgeben, dassesesLiniendiagrammgibt? Mfg reply Tue, 07/28/2009 - 23:26 SANDEEP JAKHOTYA (not verified)

Changing DataSource Location at Run time


with subject to above, i want 2 ask that what is the procedure to change the Data Source Location for reports in the designer? changing of source location at design time is available if we right click on the designer n select Change Datasource Location option, however i want to change the same at RUN time so how do i? Please help SANDEEP JAKHOTYA reply Tue, 06/23/2009 - 03:29 Anonymous (not verified)

need help
i build the program with vb6 cr8.5 mssql2000 when i have a small data i can show the report in cr8.5, bur when the data is bigger i get message timeout expired and overflow. how i solve this problem rgds, ready reply Thu, 02/25/2010 - 01:07 Anonymous (not verified)

Crys Report

Dear Sir/Madam Using "Perform Grouping on Server" or use Index if not so, best way is to have made done Stored Procedure then create report It will give you the best performance and avoidness of "Timed out Expired" Thanks - Haris reply Thu, 06/11/2009 - 22:14 Rainwalker (not verified)

How to use Crystal Reports 10.2 in VB 6


Hi I am a newbie to both VB 6 and CR 10.2 My task is to make changes in a report developed by earlier version of Crystal Reports. I edited the report using the Visual Studio 2005 IDE, but the edited report is not being recognised by the VB6 application . It throws an eror "Invalid TLV Record". Is there any way I can change my VB6 app to use CR 10.2. whatdll's should I use to do this? Can any one please send me a sample code of how to use CR 10.2 report in the VB6 application? PS: I cant upgrade the VB6 App to .net I dont have exact version Crystal Reports Editor. please help. Thanks in advance, Ramesh.. reply Wed, 06/15/2011 - 08:35 Anonymous

have you got the solution for your issue?


please share your solution with me .i am run into same issue as you had / mentioned in the blog. reply Fri, 06/05/2009 - 02:30 Oussama (not verified)

Using Crystal report file in vb6


I test le code above and the result is error number 13. Thank you for helping me "How to crrectit ?" reply Wed, 06/03/2009 - 22:16 afsar khan (not verified)

regarding material & query


Material is so good for new learners god bless you , you are doing very good job freshers and freelancers keep it up. good luck reply Wed, 05/13/2009 - 04:36 svinodh (not verified)

How to check Empty values?

is there anyway I could check whether It passes empty values to the report? reply Tue, 04/28/2009 - 03:12 Anonymous (not verified)

Column access in cs file


How to access a column of a subreport in .cs file. I want to hide or display the column depending on the value. Suppress is not a good option since it leaves the space for the column. I want to hide or remove the column from the page. Please suggest some code to access the column and set the width to 0 or something reply Thu, 04/23/2009 - 00:55 ishee (not verified)

error 20728
i tried this but it didn't work.. im using crsytal report 8 in vb6 am i missing some dll or ocx? if i run it it says, "runtime error '20728' F" plz help. tnx! reply Wed, 02/04/2009 - 11:21 Anonymous (not verified)

really helpful tutorial,


really helpful tutorial, thanks a lot!! :) reply Thu, 01/22/2009 - 21:41 Ania (not verified)

Please help - cannot open Access 2002


Hi, Can someone please help me as I cannot open in Crystal Reports a database file created in Access 2002 but it I can open one created in prior version. When I try to open the newer version it asks me for a "Microsoft Access Password". Please help it is frastrating!!! Thank you Ania reply Sun, 06/07/2009 - 05:01 Anonymous (not verified)

to get password
please find Access passviewsoftwar from net to get forgotenpasswore of Access File after you get this software just drag your access file into this software and get all password reply Tue, 01/20/2009 - 20:06 noob programmer (not verified)

nice one

whydont you include a sample database with data in it so the viewer like me can easily see the result.. thanks...... reply Sat, 01/03/2009 - 10:37 Anonymous (not verified)

How to change database at runtime


How to change database at runtime reply Fri, 12/26/2008 - 02:29 Anonymous (not verified)

drill down group


Can anyone help me, I would like the group to drill down on the same page of the report rather than it opening a new tab every time I drill down. Thanks in advance reply Sun, 12/14/2008 - 23:55 Anonymous (not verified)

IMAGE in Crystal report 4.6


IMAGE in Crystal report 4.6 i am having a problem.... i create image box from my form and i have a field that stores the path of a picture... in a form i can show that corresponding picture but in datareport or crystal report... it does not... i saw some tutorial but they use crystal report 8.5...... while in vb it has 4.6 version... just wanna know how to load an image using the path stored in my database... tnx reply Sat, 12/06/2008 - 12:24 Fullmetal John (not verified)

Hello
Hi.. I just wanted to ask if you can help me by providing a tutorial using Crystal Report as the report generator and SQL as the database.. I would really appreciate if you could.. Thanks a lot.. reply Wed, 11/12/2008 - 04:48 sankar (not verified)

CRYSTALREPOTS
SA HAI SIR iam creating a one project sir in vb sir tahat project is database project i iam using crystalreports 4.6 sir but my problam is reports not gentate sir how gentate reports run time sir reply Sat, 05/02/2009 - 00:15 chandravadhana (not verified)

creating crystal report


please send

step by step process to create crystal report reply Wed, 11/12/2008 - 04:48 sankar (not verified)

CRYSTALREPOTS
SA HAI SIR iam creating a one project sir in vb sir tahat project is database project i iam using crystalreports 4.6 sir but my problam is reports not gentate sir how gentate reports run time sir reply Sun, 11/02/2008 - 10:20 jrex (not verified)

Anyone has a Crystal Report


anyone can help me please... I have a VISUAL STUDIO Installer but i didnt find the Crystal Report 4.6 some programmer saying that it is located COMMON\TOOLS\VB\CRYSREP but when i check that path in my installer it is not exist, so i need some help if anyones has a installer for any version of Crystal Report that applicable for VB6 please can you give me, i need to make a report for my project so any response is highly appreciated. Thank you in Advance. This is my email jrex232004@yahoo.com reply Sun, 11/02/2008 - 10:15 jrex (not verified)

ANYONE HAS A CRYSTAL REPORT INSTALLER


anyone can help me please... I have a VISUAL STUDIO Installer but i didnt find the Crystal Report 4.6 some programmer saying that it is located COMMON\TOOLS\VB\CRYSREP but when i check that path in my installer it is not exist, so i need some help if anyones has a installer for any version of Crystal Report that applicable for VB6 please can you give me, i need to make a report for my project so any response is highly appreciated. Thank you in Advance. reply Fri, 12/24/2010 - 00:33 curtis

CRYSTAL REPORT INSTALLER


well i suppose the visual studio you have with all the three CD's. If not then look for the third vb6 CD. That's where the crystal reports installer is. reply Fri, 10/10/2008 - 00:57 tatz (not verified)

vb6
thanks for the information it helps alot! reply Wed, 09/24/2008 - 21:54 brijesh (not verified)

vb
thisis the good tutorials reply

Thu, 07/24/2008 - 07:29 mwamba (not verified)

crystal designer and vb6


hai, did not know that vb6 had crystal. thanks for this, i will try it. now, i have a problem, crystal reports 8.5 designer with vb6 has been okay on windows xp, i moved to windows vista and vb6 closes each time i try to design a report with crystal reports 8.5 within vb6. please help! reply Tue, 05/04/2010 - 03:49 PJP (not verified)

Vista
Have you found a solution to prevente VB6 to close when adding a CR8.5 report ? reply Mon, 06/01/2009 - 07:05 Anonymous (not verified)

VB6 Crystal 8.5 Desinger Problems in Vista


I am also having the same problem ? Did you find a solution ?Plshelp !! Rgards, Sailesh 1234_sdkhetia@hotmail.com (please remove the '1234_' when replying) reply Tue, 07/08/2008 - 08:10 SkyAce (not verified)

Thnx for sharing


good day! thanks for sharing this tutorial it helps me a lot thanks.... keep up the good work for sharing your ideas..... reply Thu, 06/26/2008 - 00:06 Anonymous (not verified)

VB
Can anyone help me I need to store all types of images (photos, .doc fils, .pdf files, images, scanned pictures etc.)and display into a frame in the VB 6 forms. I am using MS Access database (ADODB connectivity) to store information, Now i want to write a sqlqurey to display any picture saved in my computer into the form (using command button). I donot want to give the path name in the access database, i want a query to read the bytes of picture and display it in the frame of VB 6 forms. Pl. i need it ASAP. reply Wed, 06/18/2008 - 00:30 ashish

Nice material and very help full

It us really very helpfull for us but could some one add how to work with latest version of crystal report?? reply 1 2 next last

Post new comment


Top of Form

Anonymous

Your name: E-mail:

The content of this field is kept private and will not be shown publicly.

Homepage: Subject: Comment: *

Allowed HTML tags: <a><em><strong><cite><code><ul><ol><li><dl><dt><dd> Lines and paragraphs break automatically.


comment_form

More information about formatting options


form-89c3ba2bb

Preview
Bottom of Form

Unless otherwise noted, all content on this site and in the source samples is Copyrighted 2011 by the owner of vb6.us. All rights reserved - Contact Information

You might also like