Friday, March 30, 2012

Jump to URL

Hi,

I want to navigate to a webpage from my report. On clicking a report field that web page should be opened. I have written the following code,

Function OpenWindow (ByVal DealerId as Integer,ByVal CustomerNo as string,ByVal InvoiceNo as string, ByVal CustomerType as string,ByVal CustomerStatus as string,ByVal AppilcationName as string,ByVal UserId as string,ByVal CallStatus as string)as String

Dim strURL as String
Dim strTargetURL as String
Dim strFeatures as String

If CustomerType = "EXTERNAL" and CustomerStatus <> "Completed"
strURL = AppilcationName & "?" & "DealerId="& DealerId &"&CustomerNo="&CustomerNo &"&InvoiceNo="&InvoiceNo & "&UserId=" & UserId & "&CallStatus=" &CallStatus

strTargetURL = "javascript:void(window.open('"
strTargetURL = strTargetURL & strURL & "'"
strTargetURL = strTargetURL & ",'',"

strFeatures = "' width=1000,height=720,scrollbars=yes, status=no, toolbar=no, resizable=no, left=0, top=0'"

strTargetURL = strTargetURL & strFeatures
strTargetURL = strTargetURL & ",'_blank'));"

End If
Return strTargetURL

End Function

Now If I click the report field my web page is opening in a new page. But if I select the option "Open in New Window" an empty page as well as my web page is being opened. How to avoid the opening of empty page.

Help of any kind to this problem is welcome

Thanks in Advance,

Sivaatzenith

It seems that you should maybe just assign the href of the url, and not use the javascript. Personally, I don't like it when a site wants to size and/or position a window with/without various options... I guess I kookie like that :)

|||

Hi Ben,

Thanks for your reply

Can you pls give a sample containing the href in jump to url code

Regards

Sivaatzenith

|||

Sivaatzenith,

My thought was that in your OpenWindow code, you omit the javascript code...

So perhaps:
strTargetURL = "javascript:void(window.open('"
strTargetURL = strTargetURL & strURL & "'"
strTargetURL = strTargetURL & ",'',"

strFeatures = "' width=1000,height=720,scrollbars=yes, status=no, toolbar=no, resizable=no, left=0, top=0'"

strTargetURL = strTargetURL & strFeatures
strTargetURL = strTargetURL & ",'_blank'));"

becomes:
strTargetURL = strURL

I am not really sure if this will work in Sql Reporting Services or not...

Good Luck

|||

hi,

Thanks for ur reply... First I had given the following code in jump to URL

STRURL ="http:mail.yahoo.com"

Mine is a web application. The reports will be launched by web application which is in .net.These reports will be shown in report viewer ctrl. This report will also contain subreport, which will be displayed on clicking of a textbox. When I click this textbox to view the sub report and after that press the link (jump to url) I am getting a java script error... Actually thats a problem with report viewer after googling I found out that microsoft has provided a hot fix for this which is extra money. So I tried this.

Any other solution is welcome.. I tired using <a href also. but of no use... I am getting a run time error.

Thanks in advance

Sivaatzenith

|||

I apologize that I am not more familiar with reporting services, what is your specific javascript error?

|||

hi Ben,

If I click the link, my desired web page is opened in a new browser. But If I select the option "Open in a new page" an empty browser as well as my page is opened. I need to avoid this empty page.

Thanks in Advance,

Sivaatzenith.

No comments:

Post a Comment