Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
How to export ultragrid & ultrachart together to excel using vb.net
posted

I am Working on a report,where i have an ultragrid & ultrachart.I want to export these two together in excel.Currently i am able to export my ulragrid and ultra chart but both of are getting exported in two different excel files. I have searched a lot but couldn't get any proper answer.Can anyone plz help me out

 Case "Export"

                    btnExport_Click()

                    objGrid.fn_UGrid_ExportFullGridPopup(ugridAuction, True, True, False, Me.Text)

this fuction exports grid to excel.And the below code is for exporting ultrachart to grid.Now i Want to export both  ultrachart and ultragrid to excel

 

 Private Sub btnExport_Click()

 

        Dim w As New Infragistics.Excel.Workbook()

 

        Dim s As Infragistics.Excel.Worksheet = w.Worksheets.Add("Chart")

 

        Dim ms As New System.IO.MemoryStream()

 

        Me.UltraChartAuction.SaveTo(ms, Infragistics.UltraChart.Shared.Styles.RenderingType.Image)

 

        Dim i As New Infragistics.Excel.WorksheetImage(Image.FromStream(ms))

 

        i.TopLeftCornerCell = s.Rows(0).Cells(0)

        i.TopLeftCornerPosition = New PointF(0.0F, 0.0F)

 

        i.BottomRightCornerCell = s.Rows(20).Cells(6)

        i.BottomRightCornerPosition = New PointF(0.0F, 0.0F)

 

        s.Shapes.Add(i)

 

        Dim theFile As String = Application.StartupPath + "\" & DateTime.Now.Ticks.ToString() & ".xls"

 

        w.Save(theFile)

 

        ms.Dispose()

 

        Process.Start(theFile)

    End Sub

Parents
  • 48586
    Suggested Answer
    posted

    Hello ,

     

    I have created a small sample in order to demonstrate how you could export UltraGrid and UltraChart in same workbook. Please run the sample and let me know if this is what you are looking for.

     

    Please let me know if you have any further questions.

    82443.zip
Reply
  • 695
    posted in reply to Hristo Goshev

     

     

    We are using infragistics v10.3

    so i am getting error for the below line

    Infragistics.Win.UltraWinGrid.ExcelExport.

     

    UltraGridExcelExporter.Export(ugridAuction, book)

     

    after UltraGridExcelExporter i am getting only 3 option

    UltraGridExcelExporter.Equals

    UltraGridExcelExporter.ExcelRelevantPropFlags

    UltraGridExcelExporter.ReferenceEquals

     

    Also i am not getting SaveTo for the below line

    ugridAuction.SaveTo(ms, Infragistics.UltraChart.Shared.Styles.

     

     

    RenderingType

    .Image)

     

     

     

     

Children