Help with choosing Grid to expert

Posted by: Victor.m.charles.civ on 27 January 2021, 8:37 pm EST

    • Post Options:
    • Link

    Posted 27 January 2021, 8:37 pm EST

    Hi,

    How do I modify the code below to only export Grids selected from a MultiSelect control?

    For example when I only select Grid1 (Grid1). I only want to include C1Grid1 in doc and If I select both Grid1 and Grid2 (Grid1,Grid2) I want to include both Grids in doc.body. I have about 6 Grids but just mentioning two to simplify my example.

    Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click

    xyz = “”

    For iCol = 0 To C1MultiSelect1.SelectedItems.Count - 1

    xyz = xyz + C1MultiSelect1.SelectedItems(iCol).Value + “,”

    Next

    Dim doc As New C1.C1Preview.C1PrintDocument()

    doc.PageLayout.PageSettings.Landscape = True

            doc.Body.Children.Add(New C1.C1Preview.RenderText(vbLf & vbLf & "AOP-6"))
            doc.Body.Children.Add(New C1.C1Preview.RenderC1Printable(C1Grid1))
    
            doc.Body.Children.Add(New C1.C1Preview.RenderText(vbLf & vbLf & "AOP-8"))
            doc.Body.Children.Add(New C1.C1Preview.RenderC1Printable(C1Grid2))
                doc.PageLayout.PageSettings.Landscape = True
                doc.Export("AMIS_Excel_Fle.PDF", True)
                System.Diagnostics.Process.Start("OutputFile.PDF")
    

    End Sub

    Thanks,

    Victor

  • Posted 28 January 2021, 1:20 am EST

    Hi,

    You can associate each item of multi-select to a grid and then when you render you can use the items to get the specific grid and render it. We have attached a sample in which we get the specific grid depending upon the selected item using SELECT CASE in VB.NET and then render it. You can modify the sample accordingly to accommodate more grids. If you have any questions, please let us know.

    Regards,

    Prabhat Sharma.

    TDBExport.zip

  • Posted 28 January 2021, 8:03 pm EST

    Hi,

    When trying to use your code, the following code:

    Dim grid = GetGrid(item.DisplayText)

    Creates error message"

    “Displaytext is not a member of C1CheckListItem”

    How do I prevent this error?

    Thanks,

    Victor

  • Posted 29 January 2021, 1:19 am EST

    Hi Victor,

    The DisplayText property was added in the latest version, you might be using an older version. You can use the Value property of C1CheckListItem instead. Please refer to the modified sample attached.

    Regards,

    Prabhat Sharma.

    TDBExport_mod.zip

Need extra support?

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

Learn More

Forum Channels