Results 1 to 17 of 17

Thread: [RESOLVED] Visual Basic 6 and Report Generation Help Needed

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    Resolved [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

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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..

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Visual Basic 6 and Report Generation Help Needed

    you can read the crystal report tutorial at my signature.

  4. #4
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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
    Last edited by khandu; Jan 23rd, 2007 at 02:44 PM. Reason: link removed

  6. #6
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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.

  7. #7
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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?

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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

  9. #9
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.

  10. #10
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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:
    1. Private Sub RunReport()
    2. Dim crxApp As New CRAXDDRT.Application
    3. Dim crxReport As CRAXDDRT.Report
    4. Dim crxDatabaseTables As CRAXDDRT.DatabaseTables
    5. Dim crxDatabaseTable  As CRAXDDRT.DatabaseTable
    6. Dim crxDatabase As CRAXDDRT.Database
    7. Dim crxParm As CRAXDDRT.ParameterValues
    8. Dim crxSubReport As CRAXDDRT.Report
    9.  
    10. Dim ReportName As String
    11.  
    12. ReportName = "\\SERVER\Other\Reports\PL.rpt" 'Report Path
    13.  
    14. Set crxReport = crxApp.OpenReport(ReportName)
    15. crxReport.ParameterFields.GetItemByName("Invoice").AddCurrentValue lInvoiceNo '<-- Variable holding the value of your combo box being assigned to your parameter field called "Invoice"
    16.  
    17. crxReport.PrintOut False, 1
    18.  
    19. With crView '<-- crView is the name of the CR control on the form
    20.     .ReportSource = crxReport
    21.     .ViewReport
    22.     While .IsBusy
    23.         DoEvents
    24.     Wend
    25.     .Zoom "75"
    26.     .Visible = False
    27. End With
    28.  
    29.  
    30. End Sub

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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

  12. #12
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.
    Last edited by Besoup; Jan 23rd, 2007 at 05:24 PM.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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??

  14. #14
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    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 ..

  16. #16
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.

  17. #17
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.
    Last edited by Besoup; Jan 23rd, 2007 at 05:24 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width