Results 1 to 4 of 4

Thread: TopN using Crystal Reports

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303
    Please please does anyone know how this is done?
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  2. #2
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457

    Question

    Well, if you reply here explaining what is a Crystal report, maybe I can help...

    Bye,

    -Jotaf98

    [email protected] - ICQ#60784495 - http://jotaf98.cjb.net

  3. #3

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303
    Its a report created using 'Crystal Reports 7'
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  4. #4
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457

    Cool Here it is!

    Here's and example directly taken (and slightly modified) from MSDN Library (look for the keywords "Shell", "AppActivate" and "SendKeys" for more info).

    This one will run the Calculator, type some numbers and exit it.

    So you can use this to run Crystal and edit the report or something like that!

    Code:
    Dim ReturnValue, I
    
    'This will open the calculator
    ReturnValue = Shell("calc.exe", 1)
    
    'Activate it (give focus to it so it can receive keys
    'from the SendKeys command)
    AppActivate ReturnValue
    
    'Loop from 1 to 100
    For I = 1 To 100
       'Type the number I and press the plus sign key (+)
       'Some keys must be sent in a different way, like
       'this one (the plus sign between brackets)
       SendKeys I & "{+}", True
    Next I
    
    'Send the equal key (to get the result)
    SendKeys "=", True
    
    'Copy the result to the clipboard (by pressing Ctrl + C)
    SendKeys "^{C}", True
    
    'Send Alt + F4 (to close it)
    SendKeys "%{F4}", True
    Try creating a new project, and pasting this to the Form_Click event. It will do exactly what you told it to do when you click the form - and you can even paste the result as a proof (remember that we told it to copy the result!).

    Hope that helps! Make sure you check the VB help files for more info.

    Bye,

    -Jotaf98

    [email protected] - ICQ#60784495 - http://jotaf98.cjb.net

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