Results 1 to 12 of 12

Thread: [RESOLVED] [2005] Write to Crystal Report

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Resolved [RESOLVED] [2005] Write to Crystal Report

    Hi everybody and i wish u all a happy new year.
    Am working on a project whereby i have to send some informations to a crystal report. Am using Visual Studio 2005. I would like to do some query to the SQL server then do some manipulations with the data and then send some of the data manipulated to report. I can do the query and the manipulation alright but i don't how to send the informations to the text box placed on my report.
    Can someone please help?
    Thank you.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Write to Crystal Report

    Moved to Reporting

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    46

    Re: [2005] Write to Crystal Report

    you can create a parameter in the report then make the textbox in the report equal to the parameter value then sent the parameter value by code

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [2005] Write to Crystal Report

    Hi, MANNO
    That is exactly what am trying to do but i dont know how to do the codings, am very new to Crystal report. Pls help.
    WaZda

  5. #5
    Member
    Join Date
    Aug 2006
    Posts
    46

    Re: [2005] Write to Crystal Report

    ok here is the code:

    the Imports:
    Code:
    Imports Microsoft.Reporting.WinForms
    and here is the code in the Button:
    Code:
    Dim sDate As New ReportParameter("Report_Parameter_1", CType(DateTimePicker1.Value.ToShortDateString, Date))
    Dim eDate As New ReportParameter("Report_Parameter_2", CType(DateTimePicker1.Value.ToShortDateString, Date))
    Dim TName As New ReportParameter("Report_Parameter_3", CType(TextBox1.Text, String))
    
    ReportViewer1.LocalReport.SetParameters(New ReportParameter() {sDate, eDate, TName})
    ReportViewer1.RefreshReport()
    I hope it helps
    Good Luck

    Note:
    This is a visual basic code

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [2005] Write to Crystal Report

    Hi MANNO,
    Am having an error with the "ReportParameter" saying the type is not defined. Can u help me on dat?
    Plus the scenario is dat:
    form1: I will do the data manipulation in the form1 then finally send the information to the form2.
    form2: i have a report viewer to load the report file. Informations should be received from form1 by codes onto the report.

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [2005] Write to Crystal Report

    Hi MANNO,
    Thank you very much for your help. i tried to understand your code but i just couldn't. and it is because i did make myself clear enough. So i'll try explaining better this time, here is the scenario:
    I have 3 files: Form1, Form2 and CrytalReport1.rpt(which is the crystal report file)
    form1: I will do the data manipulation in the form1 then finally send the information to the form2.
    form2: i have a CrystalReportViewer to load the CrystalReport file (CrytalReport1.rpt). Informations should be received from form1 by codes and displayed in the various textbox, placed on the CrytalReport1.rpt .

    I hope this one is much clearer. and once again, thank you for helping me.
    WaZda

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Write to Crystal Report

    Here is a working demo. This should explain everything you need to know, and you SHOULD have no problem applying this to your own project.
    Attached Files Attached Files

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [2005] Write to Crystal Report

    Oh my GOD,
    kleinma dude, u solved my problem. This is great man. your project Rocks. Am so grateful to you buddy. Really.

  10. #10
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [RESOLVED] [2005] Write to Crystal Report

    sometimes a demo is worth a 1000 posts trying to explain something

  11. #11

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [RESOLVED] [2005] Write to Crystal Report

    sure man, you a RIIIIIIIIIIIght. thank u. u saved me on this one.
    Take care.
    WaZda

  12. #12

    Thread Starter
    Member
    Join Date
    Jun 2007
    Location
    Lomé - TOGO
    Posts
    38

    Re: [RESOLVED] [2005] Write to Crystal Report

    Kleinma,
    One more question pls. I have some other print out that should follow the first one. And what am trying to do is,
    1.if possible, get to know the printer the user selected then use that printer for the other printings.
    2. Freeze the app with some progress bar to wait till the end of all the printings before going back to it.
    Thank you for your help. Coz u r really helping me and i appreciate that.

    WaZda

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