Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi, I'm sure this is really easy to do but I can't work out how to do it.

                                    I am trying to determine the value of a column in my data source to set the html property of a label. I don't seem to be able to retrieve the data.

                                    The label is located in the first detail section, here's the code I'm using:

                                    Private Sub DetailAnker_HtmlItemCreated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.HtmlEventArgs) Handles DetailAnker.HtmlItemCreated
                                            Dim sMonica As String
                                            sMonica = GetCurrentRow().Row("Monica").ToString() '<-- this returns the value for the first row for all records
                                            sMonica = DetailReport.GetCurrentColumnValue("Monica") '<-- this returns null
                                            e.ContentCell.InnerHtml = "<p><a name=" + sMonica + "></a></p>"
                                        End Sub

                                    Any help would be very gratefully received (I've spent a day on this already!)

                                    Thanks,
                                    Richard

                                0

                                Hi Richard,

                                To accomplish this task, please handle the BeforePrint event of the corresponding control and set the CTYPE(sender,XRLabel).Tag property with required value, and retrieve it afterwards.
                                Please feel free to contact us if you need any additional assistance. We will be happy to help you.

                                Thanks,
                                Andrew

                                0

                                Thanks for the reply Andrew.

                                I've done as you suggest and changed the code thus;

                                    Private Sub DetailAnker_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles DetailAnker.BeforePrint
                                        CType(sender, XRLabel).Tag = GetCurrentRow().Row("Monica").ToString()
                                    End Sub

                                    Private Sub DetailAnker_HtmlItemCreated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.HtmlEventArgs) Handles DetailAnker.HtmlItemCreated
                                        e.ContentCell.InnerHtml = "<p><a name=" + CType(sender, XRLabel).Tag + "></a></p>"
                                    End Sub

                                But now ALL of the DetailAnker instances have the same tag as the last record in the datasource, is that what you would expect?

                                I then tried changing the .tag property to be bound to the datasource, and when stepping through the before print event the tag was as expected, but when the HtmlItemCreated event fires the CType(sender, XRLabel).Tag property for all instances is blank?

                                Any ideas?

                                Thanks again,
                                Richard

                                0

                                Hi Richard,

                                Please use the e.Brick.Value property to accomplish this task.
                                For example :
                                Private Sub DetailAnker_HtmlItemCreated(ByVal sender As Object, ByVal e As DevExpress.XtraReports.UI.HtmlEventArgs) Handles DetailAnker.HtmlItemCreated
                                e.ContentCell.InnerHtml = ""
                                End Sub
                                Please try this solution, and let us know the results.

                                Thanks,
                                Andrew

                                0

                                Thanks for the suggestion Andrew, it has done the trick.

                                I now have dynamically created <a href='#{id}' /> tags and <a name='{id}'> tags in the report output which function correctly on the web page, but when I export this to pdf the hyperlinks are removed.

                                How can I preserve these hyperlinks in a pdf?

                                Thanks,
                                Richard

                                0

                                Richard,

                                To accomplish this task you need to specify the NavigateURL property.
                                For example :
                                          Private Sub xrTableCell5_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
                                               CType(sender, XRTableCell).NavigateUrl = "www.devexpress.com"
                                          End Sub
                                Please feel free to contact us if you need any additional assistance. We will be happy to help you.

                                Thanks,
                                Andrew

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners