Results 1 to 5 of 5

Thread: [RESOLVED] Record wise printing in vb 6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2014
    Posts
    66

    Resolved [RESOLVED] Record wise printing in vb 6

    Hello All

    I'm Using Crystal Report to printing Records..

    In VB 6 i'm using this codes to retrieve Records from access

    Code:
    With CR
    .ReportFileName = App.Path & "\Report\A4_WN.rpt"
    .ReplaceSelectionFormula "{R_Patient.regno} =" & Text1.Text & ""
    .Connect = "Dsn=GK DATA;Uid=sa;pwd=admin;dsq=database"
    .Destination = crptToWindow
    .WindowState = crptMaximized
    .Action = 1
    End With
    sometimes i want to print specific records.(USING LISTVIEW CONTROL(WITH CHECK BOXES))
    but how can i write code(Selection formula) for this.

    Please Help

    Thanks .....Sorry for my English.....

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,372

    Re: Record wise printing in vb 6

    i have not used .ReplaceSelectionFormula so i cant say much about this. what i know it can be done is: a) set a report parameter to filter for specific records and b) assign an ado recordset as DataSource for the report and thus bypassing all database queries of the report. The latter can be done by using Report.Database.SetDataSource (CR Runtime Lib version 11)

  3. #3
    Hyperactive Member
    Join Date
    Jun 2014
    Location
    Lahore, Pakistan
    Posts
    450

    Re: Record wise printing in vb 6

    Quote Originally Posted by kamalkumar2023 View Post
    Hello All

    I'm Using Crystal Report to printing Records..

    In VB 6 i'm using this codes to retrieve Records from access

    Code:
    With CR
    .ReportFileName = App.Path & "\Report\A4_WN.rpt"
    .ReplaceSelectionFormula "{R_Patient.regno} =" & Text1.Text & ""
    .Connect = "Dsn=GK DATA;Uid=sa;pwd=admin;dsq=database"
    .Destination = crptToWindow
    .WindowState = crptMaximized
    .Action = 1
    End With
    sometimes i want to print specific records.(USING LISTVIEW CONTROL(WITH CHECK BOXES))
    but how can i write code(Selection formula) for this.

    Please Help

    Thanks .....Sorry for my English.....
    I have done this with my own logic, your listview have checkboxes now place a button under the listview.. choose the checkboxes and press the button where as in backend in the database create a temp table which stores that data which is selected in listview ( data will be stores when you press the button so code on the button to store data from the listview to the database ) now set the datasource of the report to that table and print.. after printing use a loop to clear the table.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2014
    Posts
    66

    Re: Record wise printing in vb 6

    Thanks Mr.Hamza.. I Already solved this thread. And same method of your...
    Thanks Again...

  5. #5
    Hyperactive Member
    Join Date
    Jun 2014
    Location
    Lahore, Pakistan
    Posts
    450

    Re: Record wise printing in vb 6

    Quote Originally Posted by kamalkumar2023 View Post
    Thanks Mr.Hamza.. I Already solved this thread. And same method of your...
    Thanks Again...
    welcome bhai

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