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