Results 1 to 3 of 3

Thread: VBNET 2005 and Crystal Reports

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Posts
    419

    VBNET 2005 and Crystal Reports

    Hello, I have the Crystal Reports that was installed with my trial of VS2005 .NET. I also have an access backend with a table containing the following columns:

    ID
    Year
    Month
    CustomerName
    Amount

    What I want to do, is make a chart in CR that has the months on the bottom:

    Jan...Feb...March...April.................Jan...Feb...March...April....Jan...Feb...March...April

    Along the left side of the graph, will be the amount increments. And in the chart itself (the data being graphed) will be the amounts for each customername. Attached is a screenshot of a graph of what I need made in excel.

    How can I do this in CR?
    Attached Images Attached Images  
    Code:
    If LostAngel.Tag = "Programming" then
       LostAngel.Caption = "Awake"
    Else
       LostAngel.Caption = "Dreaming of Code"
    End If

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Posts
    419

    Re: VBNET 2005 and Crystal Reports

    Alright, I was able to mimic the above chart...but I noticed that the graphed lines are VERY thin and light when I print them. Also, the bottom axis jumbles everything together as shown in the attached image. How do I fix these?
    Attached Images Attached Images  
    Code:
    If LostAngel.Tag = "Programming" then
       LostAngel.Caption = "Awake"
    Else
       LostAngel.Caption = "Dreaming of Code"
    End If

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Posts
    419

    Re: VBNET 2005 and Crystal Reports

    Does anyone know of any good tutorials with using Crystal Reports and VB.NET 2005? The biggest thing im looking for is the ability to set recordsets (and SQL statements) via code...instead of binding everything. Below is an example of how it was done in VB6.0's Data Reports..

    VB Code:
    1. Option Explicit
    2. Public X As String
    3. Private Sub DataReport_Initialize()
    4. 'Dimming of variables used.
    5. Dim strSQL As String    'SQL String.
    6. Dim oConn As New ADODB.Connection   'New ADODB Connection.
    7. Dim oRS As New ADODB.Recordset  'New ADODB Recordset
    8. Dim BarCode As String
    9. 'Connection string
    10. oConn.CursorLocation = adUseClient
    11. oConn.ConnectionString = "Provider=MSDASQL.1;Password=tmm;Persist Security Info=True;User ID=sysprogress;Password=PASSWORD;Data Source=tmm_db10"  'Connection String.
    12. oConn.Open
    13.  
    14. 'Below checks to see which criteria was checked,  then runs the SQL query
    15. 'Based on the criteria..
    16.  
    17. 'Changes the title and caption of the report to show the date range.
    18. strSQL = "SELECT DISTINCT pub.fin.""Station"", pub.blq.""Item-code"", pub.blq.""Item-desc-2"", pub.iix.""Item-desc-1"" "
    19. strSQL = strSQL & "FROM pub.fin, pub.iix, pub.bmq, pub.blq, pub.ssd "
    20. strSQL = strSQL & "WHERE pub.fin.""Station"" <> 'TUMBLE' AND "
    21. strSQL = strSQL & "pub.fin.""Station"" <> 'ZZZMPI' AND "
    22. strSQL = strSQL & "pub.fin.""Station"" < 'I' AND "
    23. strSQL = strSQL & "pub.fin.""Job"" = pub.ssd.""Job"" AND "
    24. strSQL = strSQL & "pub.fin.""Item-code-mfgd"" = pub.bmq.""Item-code"" AND "
    25. strSQL = strSQL & "pub.bmq.""Branch"" = 'MPI' AND "
    26. strSQL = strSQL & "pub.bmq.""Quote-type"" = 2 AND "
    27. strSQL = strSQL & "pub.bmq.""Quote-set"" = 1 AND "
    28. strSQL = strSQL & "pub.blq.""Master-item-code"" = pub.bmq.""Item-code"" AND "
    29. strSQL = strSQL & "pub.blq.""Master-branch"" = pub.bmq.""Branch"" AND "
    30. strSQL = strSQL & "pub.blq.""Master-quote-type"" = pub.bmq.""Quote-type"" AND "
    31. strSQL = strSQL & "pub.blq.""Master-quote-set"" = pub.bmq.""Quote-set"" AND "
    32. strSQL = strSQL & "pub.blq.""Element"" = 'FORM' AND "
    33. strSQL = strSQL & "pub.iix.""Item-code"" = pub.blq.""Item-code"" "
    34. strSQL = strSQL & "ORDER BY pub.fin.""Station"", pub.fin.""schedule-order"" "
    35.     'Connecting...
    36.     Debug.Print strSQL
    37. oRS.Open strSQL, oConn, adOpenForwardOnly
    38.  
    39. 'Connection made.
    40. Set rptDataReport.DataSource = oRS
    41. End Sub
    Code:
    If LostAngel.Tag = "Programming" then
       LostAngel.Caption = "Awake"
    Else
       LostAngel.Caption = "Dreaming of Code"
    End If

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