Print Page | Close Window

Report Hyperlink Behavior

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=19359
Printed Date: 29 July 2024 at 7:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Hyperlink Behavior
Posted By: jpcoffeyXXX
Subject: Report Hyperlink Behavior
Date Posted: 28 December 2011 at 3:12pm
What happened to the default behavior of the report control hyperlinks?  In the past, the report control would show a blue hyperlink that would show a hand cursor when the mouse was hovered over the hyperlink.  Now the report control just shows plain text for the hyperlink with no hand when hovered.  I have tried the  XtremeReportControl%7EReportPaintManager%7EHyperlinkStyle.html - HyperlinkStyle and XtremeReportControl%7EReportPaintManager%7EHyperlinkHoverStyle.html - HyperlinkHoverStyle objects in the Report PaintManager objects with no success.  The links show up as plain text.  Even in the CodeJock sample applications there are no hyperlinks that work as you would expect a hyperlink to look and work, i.e. blue text with a hand cursor when hovered over.  They are altogether gone.

If CJ wants us to use Markup exclusively, it should let us know more directly.  I have received no such instruction.  Can somebody provide some guidance on this?  Thank you.

Sincerely,

John P. Coffey
VB 6 Service Pack 6
WindowsXP Service Pack 3
CodeJock Controls 15.2.1





Replies:
Posted By: SuperMario
Date Posted: 09 January 2012 at 9:58am
Thanks, will be fixed in the next release.


Posted By: jpcoffeyXXX
Date Posted: 10 January 2012 at 10:07am
Oleg, can I request some assistance on the markup to serve as a temporary replacement until the code gets fixed?   I am using the following Markup and it is not working.  The mouse turns into a hand as the cursor hovers over the hyperlink on the report, but the procedure never fires.  Can you tell me what I am doing wrong?  Thank you.

Sincerely,

John
 Private Sub GridLoad()
With rptControl
.EnableMarkup = True
.MarkupContext.SetHandler Me
.MarkupContext.SetMethod Me, "TempReportHyperClick"
End With

Set rptRecord = rptControl.Records.Add()
Set rptItem = rptRecord.AddItem("My Link")
rptItem.Caption = "<TextBlock><Hyperlink Click='TempReportHyperClick'>" & "My Link" & "</Hyperlink></TextBlock>"
Set rtpItem = Nothing: set rptRecord = Nothing
End Sub

Private Sub TempReportHyperClick(oSender As Object, oArgs As Object)
MsgBox "TempReportHyperClick Fires!"
End Sub





Posted By: nicoleta@nexusm
Date Posted: 04 April 2012 at 3:26am
I want to have a link through markup in a ReportRecordItem in a ReportControl and to fire an event when I click that link.
I have the following code in the Load event of the form. 
	public void Hyperlink_Click(object Sender, object Args)
        {
            MessageBox.Show("Clicked");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                axReportControl1.PaintManager.FixedRowHeight = false;
                axReportControl1.EnableMarkup = true;
                axReportControl1.MarkupContext.SetHandler(this);
                axReportControl1.MarkupContext.SetMethod(this, "Hyperlink_Click");
                
                axReportControl1.Columns.Add(0, "ColumnName", 100, true);
                var rec = axReportControl1.Records.Add();
                var item = rec.AddItem("My link");
                item.Caption = "<TextBlock><Hyperlink Click='Hyperlink_Click'>Click this</Hyperlink><LineBreak/> newline link </TextBlock>";
                item.CreateEditOptions();
                item.EditOptions.EditControlStyle = XTPReportEditStyle.xtpEditStyleMultiline;
		axReportControl1.Populate();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
        }

On the line of code "axReportControl1.MarkupContext.SetHandler(this);" the following exception occurs: 
  System.InvalidCastException: Specified cast is not valid.
   at System.Runtime.InteropServices.Marshal.GetIDispatchForObjectNative(Object o, Boolean onlyInContext)
   at System.Runtime.InteropServices.Marshal.GetIDispatchForObject(Object o)
   at System.Runtime.InteropServices.DispatchWrapper..ctor(Object obj)
   at System.RuntimeType.WrapArgsForInvokeCall(Object[] aArgs, Int32[] aWrapperTypes)
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at XtremeReportControl.MarkupContext.SetHandler(Object Handler)
   at WindowsFormsApplication1.Form1.Form1_Load(Object sender, EventArgs e)

Coding details: C# language, Visual Studio 2010, .net framework 4.0, version of Codejock dll: 15.2.0.0.

Thank for your support.







Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net