[RESOLVED] Visual Basic 6 and Report Generation Help Needed
I am developing a small accounting software in VB6 as a personal project
Now I want to print Mailing Labels / Bills and Reports / Graph analysis for it
I have both CR 11 Developer Ed and inbuilt Report Environment of VB6
I am totally new to it and i have been reading various books for CR 11 and I have come up to nothing..
Can someone Help me over Chat Yahoo/MSN/Gtalk because Pasting my problems here will not do.. its very long and hard to explain..
In Short, There is a MDB . Containing Order_details table having all data.. Now I will be populating a combo list via Order ID..
1) When A person clicks on an order and click on a button MAILING it makes a report containing the address which i can be printed
2) When A person clicks on PRINT BILL, it displays a report which contains item details and mrp etc.. basic bill generation
3) Another form having report analysis which searches in between order dates and generates all orders in between that OR gives Profit analysis per order graph etc..
and a few more small things...
I know it sounds BIG but an expert in Report Generation can do it easily in 1 day i guess..
So if any expert, Please help me in this regards..
Thanks
Re: Visual Basic 6 and Report Generation Help Needed
some1 please help on this issue..
any expert in CR 11 + VB 6.. or even data reports..
Re: Visual Basic 6 and Report Generation Help Needed
you can read the crystal report tutorial at my signature.
Re: Visual Basic 6 and Report Generation Help Needed
Did you already create the reports or is this a matter of just calling the reports and printing them?
Re: Visual Basic 6 and Report Generation Help Needed
Hi
See the attached as an eg :
link deleted
It has a simple VB6 form and a CR11 bill form..
now what i want is that when some1 chooses an order ID in the dropdown and click on bill report.. then the bill should be generated.. and likewise when mailing label is choosen the mailing label should be printed..
shakti5385 : i did see it but didnt understand.. sorry i m totally new to this
or maybe u can do it from the inbuilt data report also.. i m totally new to this so i cannot understand..
thanks
Re: Visual Basic 6 and Report Generation Help Needed
Open the CR11 and check the maling label report wizard. Other thing is same as making connection and adding the data.
Re: Visual Basic 6 and Report Generation Help Needed
I looked at your download briefly... but I am still unsure of what you are trying to do. It looks like you have your report laid out the way you want it and you are just trying to call it from your program and pass parameters to it?
Re: Visual Basic 6 and Report Generation Help Needed
Look
I have made a form.. and a report.. but i dont know how to code to pass data between them..
as i said.. when a person chooses a order from dropdown.. then that particular order bill is to be printed
how to pass that data and call the report i dont know.
please help
Re: Visual Basic 6 and Report Generation Help Needed
ok first thing you will have to do is set up your parameter fields on the report. This will hold the criteria of the report... so if your combo box is going to hold a list of invoice numbers and you want to display that invoice, you will need to make a parameter field that your report will be looking for everytime it runs. Once you create the fields you will have to use the Select Expert to specify what database fields your parameter field will correspond to.
Re: Visual Basic 6 and Report Generation Help Needed
Once you have your parameter field and select expert set up you can use the following code in VB to view/print the report:
VB Code:
Private Sub RunReport()
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As CRAXDDRT.Report
Dim crxDatabaseTables As CRAXDDRT.DatabaseTables
Dim crxDatabaseTable As CRAXDDRT.DatabaseTable
Dim crxDatabase As CRAXDDRT.Database
Dim crxParm As CRAXDDRT.ParameterValues
Dim crxSubReport As CRAXDDRT.Report
Dim ReportName As String
ReportName = "\\SERVER\Other\Reports\PL.rpt" 'Report Path
Set crxReport = crxApp.OpenReport(ReportName)
crxReport.ParameterFields.GetItemByName("Invoice").AddCurrentValue lInvoiceNo '<-- Variable holding the value of your combo box being assigned to your parameter field called "Invoice"
crxReport.PrintOut False, 1
With crView '<-- crView is the name of the CR control on the form
.ReportSource = crxReport
.ViewReport
While .IsBusy
DoEvents
Wend
.Zoom "75"
.Visible = False
End With
End Sub
Re: Visual Basic 6 and Report Generation Help Needed
Hi
could u complete that form for me and reupload.. i tried on my end but unable to do so.. i m really confused by this cr and/or datareporting..
it will be a lot of help..
thanks
Re: Visual Basic 6 and Report Generation Help Needed
Attached is the modified program. This will print out the report based on the orderid combo box. However data is not showing up on the report because you have a link between the order table's user id and the user info table that doesn't match. Once you populate the data in those tables correctly this should work fine.
Re: Visual Basic 6 and Report Generation Help Needed
so u mean there is some linking problem in my MDB.. ??
and i dont want to print.. i want to display it before some1 prints it.. so what line to change??
Re: Visual Basic 6 and Report Generation Help Needed
ok to just veiw you can comment out this line:
crxReport.PrintOut False, 1
and set the crView.Visible = True
It's not a linking problem really but more of a data problem depending on what you are looking for.
In the report's Database Expert it shows a link between the user_id fields in 2 tables. If you choose an item from the combo box that has a user_id that doesn't match in the other table then no data will appear on your report.
Re: Visual Basic 6 and Report Generation Help Needed
i really think i should give ur CR.. and try some diff kind of reporting.. i m totally messed up in this case... totally screwed
any advice for a beginner like me.. or can some1 help me complete my project?? credits will be given .. :)
Re: Visual Basic 6 and Report Generation Help Needed
Quote:
Originally Posted by khandu
i really think i should give ur CR.. and try some diff kind of reporting.. i m totally messed up in this case... totally screwed
any advice for a beginner like me.. or can some1 help me complete my project?? credits will be given .. :)
The program that I uploaded works. The database is the issue now. You can always use a report in Access but honestly you should be fine once you fix your data.
Re: Visual Basic 6 and Report Generation Help Needed
I am sorry, I made a mistake in the variable name... attached is the working program.