Results 1 to 2 of 2

Thread: creating a report programatically (VB.NET 2005)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Location
    New Jersey, USA
    Posts
    119

    creating a report programatically (VB.NET 2005)

    Language = VB.NET 2005

    I have an sql database which is the source of my reporting front-end. the reports are predesigned in visual studio, but when the front end app opens a table or a view, I want to place the data from the table or view into the report, with a default header and footer. My questions are:

    A) how can i dynamically change the source server, database, and table/view/procedure that the report is generated from, and then dynamically add the appropriate text/label/picture objects to the crystalreports.engine.reportdocument object at runtime?

    B) the program has a feature where if one server is down, it can revert to a backup server. to this, i need to change the source server on a reportdocument after it has been loaded. this is probably the same solution as problem A.


    thanks for any help
    Dim person As New Person
    Person.GrowUp(ByVal school as string, ByVal gang as string, Byval family as string)
    Person.Work
    Dim A as Integer
    For A = 1 to 10
    Person.Marry()
    Person.Divorce()
    Next
    Person.GiveUp()
    Person.Die()

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: creating a report programatically (VB.NET 2005)

    how can i dynamically change the source server, database, and table/view/procedure that the report is generated from, and then dynamically add the appropriate text/label/picture objects to the crystalreports.engine.reportdocument object at runtime?

    you can use the parameter for this purpose, so in the parameter you can pass the value and able to change the value run time also.
    If you want to know more detail about this then just click on the link at my signature how to add dynamic column in the crystal report. This article for the VB and CR but it is related to the CR so check it.

    Related to the vb.net
    You can pass parameter values to a crystal report programmatically using ReportDocument.DataDefinition.ParameterFields member, which represents a collection of parameters associated with a report.
    Just check the link at my signature parameter in the crystal report.

    Last edited by shakti5385; Nov 6th, 2006 at 10:06 PM.

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