C1Report ConnectionString in runtime VS xml data

Posted by: luis_carlosh on 27 July 2022, 7:02 am EST

  • Posted 27 July 2022, 7:02 am EST

    I know that the connectionstring can be modified in run time using the syntax -C1Report1.DataSource.ConnectionString- But, I notice that when a report is generated in the designer, an XML is generated that contains the information of the connectionstring that was originally used during the report. design. Does that affect? Doesn’t the xml data cross with the new mapping at runtime? It runs smoothly?

  • Posted 27 July 2022, 7:34 am EST

    adding to the above

    In a test that I am doing, I change the connection string at run time but it gives me an error because it looks for the one stored in the xml of the C1Report report file.

    If Me.ListBox1.Text = “Data Only” Then

    C1Report1.DataSource.ConnectionString = GlobalVariables.cStringReports

    Me.C1Report1.Load(“C:\ticket\ListChecksSoloDatos.xml”, “LIST_CHECKS”)

    C1Report1.DataSource.RecordSource = “ListOfChecks('” & desde & “‘,’” & hasta & “',” & Me.ComboBox1.SelectedValue & “)”

    C1PrintPreviewControl1.Document = Me.C1Report1

    End If

  • Posted 31 July 2022, 2:10 pm EST

    Hi,

    After loading Report through code, we’ll get object specified with the report definition. Hence, we can access and modify xml data of report at runtime.

    Note: The xml report file’s content will not update while changing any object properties at runtime.

    We didn’t face any issue while changing ConnectionString at runtime. Please refer the attached sample for the same: C1ReportDemo.zip

    Best Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels