CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 1999
    Posts
    2

    VB 6.0 and data report writer



    I have created everything I need to print a report. I have based my report on a data source called datainvoice and a datamember called currentinvoice.


    Currentinvoice is defined on a SQL statement (select invoice.* from invoice where invoiceno = ?)


    I have defined a parameter in the parameter tab and now need a way to pass an invoiceno to the report before it prints (to print just one invoice that the user selects to print)


    How do I pass this parameter to the data report writer so that the sql statement will read (select invoice.* from invoice where invoiceno = 3001) (the invoice that I currently want to print) If I fill in the Value prompt in the Parameter tab all works fine but the report will only print that invoice.


    All help docs seem to relate to creating a new query but I want to use my nice report that I created.


    Can anyone please help?

  2. #2
    Join Date
    Apr 1999
    Posts
    21

    Re: VB 6.0 and data report writer



    The way that I do it is to send the invoiceid to a temp table and have the data source equal a query that matches the invoice.invoiceid to report.invoiceid


    Hope that helps

    Jason

  3. #3
    Guest

    Re: VB 6.0 and data report writer

    I had a similar issue with a command object within a data environment. I set up two parameters using SQL and the ?. I then called it through code with something like: dataenvironment1.command1 text1.text, text2.text

    I hope this helps...


  4. #4
    Join Date
    Apr 1999
    Posts
    14

    Re: VB 6.0 and data report writer

    <vbcode>
    'Asset_view is the dataenvironment
    'rs command is the command object created for the 'data environment

    If ASSET_VIEW.rsCommand4.State = adStateOpen Then
    ASSET_VIEW.rsCommand4.Close
    End If
    'The command accepts a parameter which i am 'passing from the input box.
    Test = InputBox("Please enter the Clock Speed")
    ASSET_VIEW.Command4 (test)'query with parameter

    CPU_Report1.Show
    <vbcode1>


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

Featured