Wednesday, March 28, 2012
opening reports with toggleitems set according to user defaults
report has drill down capability up to 4 levels. i would like to know if it
is possible to open the report and have the toggleitems collapsed or expanded
(showing the next level if expanded) based on pre-defined choices. some
users might want drill-down expanded all the way to level 4 for some
groupings while only to level 2 on other groupings. for example, we create
financial reports that show monthly balances for staff salaries, fringe
costs, supplies, etc. a manager might want to see much detail on the staff
salaries and drill down another 2 levels to actually see staff names while
only want to see the highest level for fringe and not be concerned about how
much was paid for social security, retirement, etc..
rather than require the user each time to expand or collapse as they want
each time they run report, is there some way to save their choices to a table
and then through a query obtain their choices and set the toggleitem property
for each row based on its value.
i have found many examples of setting properties based on "value" property
but not other properties. i suspect that if it can be done, the "inscope"
function would be used. hope this makes sense!
any help you can give would be appreciated. thanksi think i found the answer to my question. RS doesn't appear to support
events and only exposes one reportitems property and that is "value". so i'm
guessing that what i'm asking is probably not possible within RS itself.
"dalem" wrote:
> i'm new to RS and have created reports with jump to url capability. the main
> report has drill down capability up to 4 levels. i would like to know if it
> is possible to open the report and have the toggleitems collapsed or expanded
> (showing the next level if expanded) based on pre-defined choices. some
> users might want drill-down expanded all the way to level 4 for some
> groupings while only to level 2 on other groupings. for example, we create
> financial reports that show monthly balances for staff salaries, fringe
> costs, supplies, etc. a manager might want to see much detail on the staff
> salaries and drill down another 2 levels to actually see staff names while
> only want to see the highest level for fringe and not be concerned about how
> much was paid for social security, retirement, etc..
> rather than require the user each time to expand or collapse as they want
> each time they run report, is there some way to save their choices to a table
> and then through a query obtain their choices and set the toggleitem property
> for each row based on its value.
> i have found many examples of setting properties based on "value" property
> but not other properties. i suspect that if it can be done, the "inscope"
> function would be used. hope this makes sense!
> any help you can give would be appreciated. thanks
Monday, March 26, 2012
Opening hyperlink Url in new window
Hello,
I have areport with a text box. The text box is hyperlinked to another report url. The report opens in a new page when previewed with RS 2005 but when deployed the report opens in teh same page from where it is referenced.
How can I set a property with the texbox to always open in a new page the hyperlinked report.
Thanks in advance
'Kiran.
I'm not going to be any help... I have the same question. The report itself uses XML to generate not html so it is not a matter of setting target = '_blank'. That's about as far as I've gotten. Any help with this would be appreciated by me as well.
Thanks
Opening a URL in reporting services 2005 opens whatever IE window
One thing that might work is unchecking the "Reuse windows for launching shortcuts" option under "Browsing" section located on the "Advanced" tab of IE's Internet Options. The down-side to this fix is that it only affects your user profile. This fix would have to be performed for each user's profile. I'll play around with RS and see if I can't trick it to force a new window.
Sincerely,
Micheal
Friday, March 23, 2012
Open URL in new page from a frame
- I need to open a report in a new page, from a report contained in a
iFrame of a aspx page
I tried a javascript window.open command in the "jump to URL" property.
But:
- If i run the report in Explorer, i click and the report is correctly
open in a new page
- If i run the report in the iFrame of the aspx page, i click but the
report is wrongly open in the same page
I tried a lot but i can't see the right way. I really need help.
P.S. Sorry for my bad English LanguageHere is an example of a Jump to URL link I use. This causes Excel to come up
with the data in a separate window:
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
If you don't want to have it appear in a new window then do this in jump to
URL:
=Globals!ReportServerUrl & "?/SomeFolder/SomeReport&ParamName=" &
Parameters!ParamName.Value & "&rs:Format=CSV&rc:Encoding=ASCII"
This capability was introduced with RS2000 SP1
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Boa" <mugnaboa@.gmail.com> wrote in message
news:1156498995.499936.169520@.h48g2000cwc.googlegroups.com...
> Hi, i have a problem:
> - I need to open a report in a new page, from a report contained in a
> iFrame of a aspx page
> I tried a javascript window.open command in the "jump to URL" property.
> But:
> - If i run the report in Explorer, i click and the report is correctly
> open in a new page
> - If i run the report in the iFrame of the aspx page, i click but the
> report is wrongly open in the same page
> I tried a lot but i can't see the right way. I really need help.
> P.S. Sorry for my bad English Language
>|||I tried a lot of solutions, serious end crazy solutions, but i'm always
in the same situation: i can't open a link in a new page if ny report
is in a iFrame.
[URL=http://img177.imageshack.us/my.php?image=tabellatentativinf4.jpg][IMG]http://img177.imageshack.us/img177/4769/tabellatentativinf4.th.jpg[/IMG][/URL]
In the image u can see my attempts, in the Explorer Column i explain
the result if i run the report directly in the explorer's page, in the
iFrame Column i explain the result if i run the report in my
application. I need to find a "new page" in the iFrame column.
Any idea?|||Bruce ... i need your help!|||Sorry, I don't know why it isn't working. I haven't done what you are trying
to do.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Boa" <mugnaboa@.gmail.com> wrote in message
news:1157640447.600521.206140@.b28g2000cwb.googlegroups.com...
> Bruce ... i need your help!
>
Open URL in New Browser
it in the same browser window. How to open the URL in a new browser instead
of current browser window?
Thanks.You didn't ask about Excel but this response of mine to another post will
answer you question:
Depending on how you design your reports you can do the following to export
to Excel. Or, what I do sometimes is make a copy of the report and clean it
up for data export and then hide it in list view. If you export from Report
Manager it puts CSV data in unicode which Excel puts all in one column. If
you export in ASCII then Excel does just as you want. To prevent a problem
with cells (Excel will object to sorting the data) you need to remove any
textboxes you have (for instance with a title, showing the parameters run
etc) and instead add additional header rows, merge the cells and put your
text in there instead. I add a link at the top of the report that says
Export Data. With RS 2005 you will be able to configure it to use ASCII
instead of Unicode.
Here is an example of a Jump to URL link I use. This causes Excel to come up
with the data in a separate window:
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"ME" <ME@.mail.com> wrote in message
news:OPWXUKT%23GHA.2408@.TK2MSFTNGP05.phx.gbl...
> My report has a table that when I click on a cell it jumps to URL and open
> it in the same browser window. How to open the URL in a new browser
> instead of current browser window?
> Thanks.
>|||Bruce,
The report I am viewing is in SQL 2000. I replaced your example with my
server name and parameter, it didn't work.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:e38AxLT%23GHA.4268@.TK2MSFTNGP02.phx.gbl...
> You didn't ask about Excel but this response of mine to another post will
> answer you question:
> Depending on how you design your reports you can do the following to
> export to Excel. Or, what I do sometimes is make a copy of the report and
> clean it up for data export and then hide it in list view. If you export
> from Report Manager it puts CSV data in unicode which Excel puts all in
> one column. If you export in ASCII then Excel does just as you want. To
> prevent a problem with cells (Excel will object to sorting the data) you
> need to remove any textboxes you have (for instance with a title, showing
> the parameters run etc) and instead add additional header rows, merge the
> cells and put your text in there instead. I add a link at the top of the
> report that says Export Data. With RS 2005 you will be able to configure
> it to use ASCII instead of Unicode.
> Here is an example of a Jump to URL link I use. This causes Excel to come
> up with the data in a separate window:
>
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "ME" <ME@.mail.com> wrote in message
> news:OPWXUKT%23GHA.2408@.TK2MSFTNGP05.phx.gbl...
>> My report has a table that when I click on a cell it jumps to URL and
>> open it in the same browser window. How to open the URL in a new browser
>> instead of current browser window?
>> Thanks.
>|||Use exactly what I have. Do not put in your server name. Replace just the
folder, report and parameters.
Even better, do a test with a report that is without parameters so you know
that is not a problem.
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" &
Parameters!ParamName.Value','_blank'))"
One last point, you cannot test this in the development environment, you
have to deploy it.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"ME" <ME@.mail.com> wrote in message
news:O66gRCU%23GHA.3860@.TK2MSFTNGP02.phx.gbl...
> Bruce,
> The report I am viewing is in SQL 2000. I replaced your example with my
> server name and parameter, it didn't work.
>
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:e38AxLT%23GHA.4268@.TK2MSFTNGP02.phx.gbl...
>> You didn't ask about Excel but this response of mine to another post will
>> answer you question:
>> Depending on how you design your reports you can do the following to
>> export to Excel. Or, what I do sometimes is make a copy of the report and
>> clean it up for data export and then hide it in list view. If you export
>> from Report Manager it puts CSV data in unicode which Excel puts all in
>> one column. If you export in ASCII then Excel does just as you want. To
>> prevent a problem with cells (Excel will object to sorting the data) you
>> need to remove any textboxes you have (for instance with a title, showing
>> the parameters run etc) and instead add additional header rows, merge the
>> cells and put your text in there instead. I add a link at the top of the
>> report that says Export Data. With RS 2005 you will be able to configure
>> it to use ASCII instead of Unicode.
>> Here is an example of a Jump to URL link I use. This causes Excel to come
>> up with the data in a separate window:
>>
>> ="javascript:void(window.open('" & Globals!ReportServerUrl &
>> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
>> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "ME" <ME@.mail.com> wrote in message
>> news:OPWXUKT%23GHA.2408@.TK2MSFTNGP05.phx.gbl...
>> My report has a table that when I click on a cell it jumps to URL and
>> open it in the same browser window. How to open the URL in a new
>> browser instead of current browser window?
>> Thanks.
>>
>|||It worked finally. Thanks
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:eXGqvGU%23GHA.3456@.TK2MSFTNGP02.phx.gbl...
> Use exactly what I have. Do not put in your server name. Replace just the
> folder, report and parameters.
> Even better, do a test with a report that is without parameters so you
> know that is not a problem.
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" &
> Parameters!ParamName.Value','_blank'))"
> One last point, you cannot test this in the development environment, you
> have to deploy it.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "ME" <ME@.mail.com> wrote in message
> news:O66gRCU%23GHA.3860@.TK2MSFTNGP02.phx.gbl...
>> Bruce,
>> The report I am viewing is in SQL 2000. I replaced your example with my
>> server name and parameter, it didn't work.
>>
>> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
>> news:e38AxLT%23GHA.4268@.TK2MSFTNGP02.phx.gbl...
>> You didn't ask about Excel but this response of mine to another post
>> will answer you question:
>> Depending on how you design your reports you can do the following to
>> export to Excel. Or, what I do sometimes is make a copy of the report
>> and clean it up for data export and then hide it in list view. If you
>> export from Report Manager it puts CSV data in unicode which Excel puts
>> all in one column. If you export in ASCII then Excel does just as you
>> want. To prevent a problem with cells (Excel will object to sorting the
>> data) you need to remove any textboxes you have (for instance with a
>> title, showing the parameters run etc) and instead add additional header
>> rows, merge the cells and put your text in there instead. I add a link
>> at the top of the report that says Export Data. With RS 2005 you will be
>> able to configure it to use ASCII instead of Unicode.
>> Here is an example of a Jump to URL link I use. This causes Excel to
>> come up with the data in a separate window:
>>
>> ="javascript:void(window.open('" & Globals!ReportServerUrl &
>> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
>> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "ME" <ME@.mail.com> wrote in message
>> news:OPWXUKT%23GHA.2408@.TK2MSFTNGP05.phx.gbl...
>> My report has a table that when I click on a cell it jumps to URL and
>> open it in the same browser window. How to open the URL in a new
>> browser instead of current browser window?
>> Thanks.
>>
>>
>
Open url in a new window
hi, I got a problem with reporting services 2005.
I have to create a link activated by clicking on an image.
In the image navigation properties I inserted the link in "jump to url" but the problem is that no new window is opened, the url is opened in the initial report page.
I tried to use jscript this way:
javascript:window.open("myurl","", "scrollbars=yes,width=800,height=600,left=0,top=0");
but in this case the url opens in a new window but a blank page is shown in the report page.
How can I solve this problem and open the url in a new window without changing the report page?
Thanks in advance and sorry for my english
="javascript:void window.open('http://yoururl&rs:Command=Render.....and whatever else you need "')"
|||ok it works!
Thanks a lot for your help
I made the Jump to URL expression as:
=void window.open('http://barn/apx/PortfolioDetail.aspx?linkfield=" & Fields!APX_PortfolioID.Value & "', '_blank')"
The above expression opens a new window correctly when the source report is run from the SSRS ReportServer or Reports (ReportsManager) pages. So far so good. But if the source report is first opened in an HTML frame via the following link, then clicking on the above link (on the source report) does nothing at all (just gives a click sound from IE):
<a href="http://brat/ReportServer/Pages/ReportViewer.aspx?%2fAccount+Profile&rs:Command=Render&rc:Zoom=100" target=apcontent><u>Accounts</u></a>
Very perplexing (at least to me). Any ideas on why this could be happening would be greatly appreciated. TIA.
|||Adding more info to above. On my development machine (XP/SP2), the link is working from a frame also.
So, the link is not working on the production intranet site for some reason. The dev platform is 2005 Reporting Services with the reporting server databases on sql server 2005 on XP/SP2. The production platform is 2005 Reporting Services but the reporting server databases are on sql server 2000 on windows 2003 server.
The data source for the report is identical for both the platform (stored proc on sql 2000). Any ideas? TIA.
|||MaryAnn80 wrote:
ok it works!
Thanks a lot for your help
Hi, mate, how did you make it work? I used the same code but the link disappeared when I use '=javascript'. I am using SQL 2005 reporting services. I just want make UserID as an URL and when I click it, it open a new window, it just doesn't work.
|||Yeahhh!I got it working now.Thanks folks!|||I have a piece of JavaScript for Jump to URL like the following:
=void window.open('MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The SSRS report is hosted by a Report Viewer control in a Web page (like MyPage.aspx).
The Web page is under a sub-folder of the application root (like http://MyApp/Module1).
The link works fine when the page shows up for the first time (http://MyApp/Module1/MyPage.aspx and the report shows up as expected).
However, if the Refresh button of the Report Viewer is pressed, the access path between the application root and page is chopped off (and I will have an error 404 message says Requested URL: /MyApp/MyPage.aspx resource can not be found.
Everything works fine if I change the JavaScript to:
=void window.open('http://MyServer/MyApp/Module1/MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The problem with hard coding the full access path is that I have to modify the JavaScript every time when I roll a report from development to production.
I’ve tried a variety of access path strings to make the JavaScript server independent (such as ../Module1/MyPage.aspx, and so on) and have no luck so far.
Can anyone help?
Thanks
Open url in a new window
hi, I got a problem with reporting services 2005.
I have to create a link activated by clicking on an image.
In the image navigation properties I inserted the link in "jump to url" but the problem is that no new window is opened, the url is opened in the initial report page.
I tried to use jscript this way:
javascript:window.open("myurl","", "scrollbars=yes,width=800,height=600,left=0,top=0");
but in this case the url opens in a new window but a blank page is shown in the report page.
How can I solve this problem and open the url in a new window without changing the report page?
Thanks in advance and sorry for my english
="javascript:void window.open('http://yoururl&rs:Command=Render.....and whatever else you need "')"
|||ok it works!
Thanks a lot for your help
I made the Jump to URL expression as:
=void window.open('http://barn/apx/PortfolioDetail.aspx?linkfield=" & Fields!APX_PortfolioID.Value & "', '_blank')"
The above expression opens a new window correctly when the source report is run from the SSRS ReportServer or Reports (ReportsManager) pages. So far so good. But if the source report is first opened in an HTML frame via the following link, then clicking on the above link (on the source report) does nothing at all (just gives a click sound from IE):
<a href="http://brat/ReportServer/Pages/ReportViewer.aspx?%2fAccount+Profile&rs:Command=Render&rc:Zoom=100" target=apcontent><u>Accounts</u></a>
Very perplexing (at least to me). Any ideas on why this could be happening would be greatly appreciated. TIA.
|||Adding more info to above. On my development machine (XP/SP2), the link is working from a frame also.
So, the link is not working on the production intranet site for some reason. The dev platform is 2005 Reporting Services with the reporting server databases on sql server 2005 on XP/SP2. The production platform is 2005 Reporting Services but the reporting server databases are on sql server 2000 on windows 2003 server.
The data source for the report is identical for both the platform (stored proc on sql 2000). Any ideas? TIA.
|||MaryAnn80 wrote:
ok it works!
Thanks a lot for your help
Hi, mate, how did you make it work? I used the same code but the link disappeared when I use '=javascript'. I am using SQL 2005 reporting services. I just want make UserID as an URL and when I click it, it open a new window, it just doesn't work.
|||Yeahhh!I got it working now.Thanks folks!|||I have a piece of JavaScript for Jump to URL like the following:
=void window.open('MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The SSRS report is hosted by a Report Viewer control in a Web page (like MyPage.aspx).
The Web page is under a sub-folder of the application root (like http://MyApp/Module1).
The link works fine when the page shows up for the first time (http://MyApp/Module1/MyPage.aspx and the report shows up as expected).
However, if the Refresh button of the Report Viewer is pressed, the access path between the application root and page is chopped off (and I will have an error 404 message says Requested URL: /MyApp/MyPage.aspx resource can not be found.
Everything works fine if I change the JavaScript to:
=void window.open('http://MyServer/MyApp/Module1/MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The problem with hard coding the full access path is that I have to modify the JavaScript every time when I roll a report from development to production.
I’ve tried a variety of access path strings to make the JavaScript server independent (such as ../Module1/MyPage.aspx, and so on) and have no luck so far.
Can anyone help?
Thanks
sqlOpen url in a new window
hi, I got a problem with reporting services 2005.
I have to create a link activated by clicking on an image.
In the image navigation properties I inserted the link in "jump to url" but the problem is that no new window is opened, the url is opened in the initial report page.
I tried to use jscript this way:
javascript:window.open("myurl","", "scrollbars=yes,width=800,height=600,left=0,top=0");
but in this case the url opens in a new window but a blank page is shown in the report page.
How can I solve this problem and open the url in a new window without changing the report page?
Thanks in advance and sorry for my english
="javascript:void window.open('http://yoururl&rs:Command=Render.....and whatever else you need "')"
|||ok it works!
Thanks a lot for your help
I made the Jump to URL expression as:
=void window.open('http://barn/apx/PortfolioDetail.aspx?linkfield=" & Fields!APX_PortfolioID.Value & "', '_blank')"
The above expression opens a new window correctly when the source report is run from the SSRS ReportServer or Reports (ReportsManager) pages. So far so good. But if the source report is first opened in an HTML frame via the following link, then clicking on the above link (on the source report) does nothing at all (just gives a click sound from IE):
<a href="http://brat/ReportServer/Pages/ReportViewer.aspx?%2fAccount+Profile&rs:Command=Render&rc:Zoom=100" target=apcontent><u>Accounts</u></a>
Very perplexing (at least to me). Any ideas on why this could be happening would be greatly appreciated. TIA.
|||Adding more info to above. On my development machine (XP/SP2), the link is working from a frame also.
So, the link is not working on the production intranet site for some reason. The dev platform is 2005 Reporting Services with the reporting server databases on sql server 2005 on XP/SP2. The production platform is 2005 Reporting Services but the reporting server databases are on sql server 2000 on windows 2003 server.
The data source for the report is identical for both the platform (stored proc on sql 2000). Any ideas? TIA.
|||MaryAnn80 wrote:
ok it works!
Thanks a lot for your help
Hi, mate, how did you make it work? I used the same code but the link disappeared when I use '=javascript'. I am using SQL 2005 reporting services. I just want make UserID as an URL and when I click it, it open a new window, it just doesn't work.
|||Yeahhh!I got it working now.Thanks folks!|||I have a piece of JavaScript for Jump to URL like the following:
=void window.open('MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The SSRS report is hosted by a Report Viewer control in a Web page (like MyPage.aspx).
The Web page is under a sub-folder of the application root (like http://MyApp/Module1).
The link works fine when the page shows up for the first time (http://MyApp/Module1/MyPage.aspx and the report shows up as expected).
However, if the Refresh button of the Report Viewer is pressed, the access path between the application root and page is chopped off (and I will have an error 404 message says Requested URL: /MyApp/MyPage.aspx resource can not be found.
Everything works fine if I change the JavaScript to:
=void window.open('http://MyServer/MyApp/Module1/MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The problem with hard coding the full access path is that I have to modify the JavaScript every time when I roll a report from development to production.
I’ve tried a variety of access path strings to make the JavaScript server independent (such as ../Module1/MyPage.aspx, and so on) and have no luck so far.
Can anyone help?
Thanks
Wednesday, March 21, 2012
Open url in a new window
hi, I got a problem with reporting services 2005.
I have to create a link activated by clicking on an image.
In the image navigation properties I inserted the link in "jump to url" but the problem is that no new window is opened, the url is opened in the initial report page.
I tried to use jscript this way:
javascript:window.open("myurl","", "scrollbars=yes,width=800,height=600,left=0,top=0");
but in this case the url opens in a new window but a blank page is shown in the report page.
How can I solve this problem and open the url in a new window without changing the report page?
Thanks in advance and sorry for my english
="javascript:void window.open('http://yoururl&rs:Command=Render.....and whatever else you need "')"
|||ok it works!
Thanks a lot for your help
I made the Jump to URL expression as:
=void window.open('http://barn/apx/PortfolioDetail.aspx?linkfield=" & Fields!APX_PortfolioID.Value & "', '_blank')"
The above expression opens a new window correctly when the source report is run from the SSRS ReportServer or Reports (ReportsManager) pages. So far so good. But if the source report is first opened in an HTML frame via the following link, then clicking on the above link (on the source report) does nothing at all (just gives a click sound from IE):
<a href="http://brat/ReportServer/Pages/ReportViewer.aspx?%2fAccount+Profile&rs:Command=Render&rc:Zoom=100" target=apcontent><u>Accounts</u></a>
Very perplexing (at least to me). Any ideas on why this could be happening would be greatly appreciated. TIA.
|||Adding more info to above. On my development machine (XP/SP2), the link is working from a frame also.
So, the link is not working on the production intranet site for some reason. The dev platform is 2005 Reporting Services with the reporting server databases on sql server 2005 on XP/SP2. The production platform is 2005 Reporting Services but the reporting server databases are on sql server 2000 on windows 2003 server.
The data source for the report is identical for both the platform (stored proc on sql 2000). Any ideas? TIA.
|||MaryAnn80 wrote:
ok it works!
Thanks a lot for your help
Hi, mate, how did you make it work? I used the same code but the link disappeared when I use '=javascript'. I am using SQL 2005 reporting services. I just want make UserID as an URL and when I click it, it open a new window, it just doesn't work.
|||Yeahhh!I got it working now.Thanks folks!|||I have a piece of JavaScript for Jump to URL like the following:
=void window.open('MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The SSRS report is hosted by a Report Viewer control in a Web page (like MyPage.aspx).
The Web page is under a sub-folder of the application root (like http://MyApp/Module1).
The link works fine when the page shows up for the first time (http://MyApp/Module1/MyPage.aspx and the report shows up as expected).
However, if the Refresh button of the Report Viewer is pressed, the access path between the application root and page is chopped off (and I will have an error 404 message says Requested URL: /MyApp/MyPage.aspx resource can not be found.
Everything works fine if I change the JavaScript to:
=void window.open('http://MyServer/MyApp/Module1/MyPage.aspx?ContactId=" + CStr(Fields!ContactId.Value) + "','_blank','location=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=100,top=100,height=600,width=1000')"
The problem with hard coding the full access path is that I have to modify the JavaScript every time when I roll a report from development to production.
I’ve tried a variety of access path strings to make the JavaScript server independent (such as ../Module1/MyPage.aspx, and so on) and have no luck so far.
Can anyone help?
Thanks
|||I know it's a while late - but I thought it worth posting something here which I have struggled with for some time in RS.
I have a site with 2 frames - left (named "Menu") for the... you guessed it... Menu. and the right frame called "Body".
I was using several dynamic menu items to open up RS reports.
I went to use this, as per many examples, and it did not work. It just clicked with no action (or with Friendly Error Messages turned on it came up with an error screen with the java<removethis>script in the address bar.
="java<removethis>script:void(window.open('" + Trim(Fields!MY_URL.Value) + "','_blank', 'location=no,toolbar=no,left=100,top=100,height=600,width=800'))"
I figured out after much trial and error that because everything in RS has a target of _top it was causing problems in a frameset. So, the solution which I came up with, and have implemented is as follows:
In the left menu I have added &rc:LinkTarget=Body to the end of all the calls to the report (they populate in the Body frame). Then I use the above javascript for all URL's, and it opens them in a blank window as required.
Hope this may help someone else who struggles with this one.
Cheers,
AndyCJ
Open up new window for external URL
However, I find that there's no way to open up a new window. It seems
inconvenient for user to close the report whenever external link is clicked.
Does anyone have idea to resolve this?use target=_blank
"Edmond Lee" wrote:
> I'm trying to use "Jump to URL" to link the report to external web site.
> However, I find that there's no way to open up a new window. It seems
> inconvenient for user to close the report whenever external link is clicked.
> Does anyone have idea to resolve this?
>|||yuanxm, Thank you for your reply.
However, I had tried several time to type "target=_blank" together with URL
for "Jump to URL" insides Navigation tab and error was resulted.
Is there any trick required?
"yuanxm" wrote:
> use target=_blank
> "Edmond Lee" wrote:
> > I'm trying to use "Jump to URL" to link the report to external web site.
> > However, I find that there's no way to open up a new window. It seems
> > inconvenient for user to close the report whenever external link is clicked.
> >
> > Does anyone have idea to resolve this?
> >|||I have not personally needed to do this so I don't know from experience but
my feeling is that the solution here is where you are in another webpage
(not Reporting Services) and want to have this happen. Not when it is using
the jump to url. What you can do (and this is something I just learned this
week) is to use the ability with SP1 to use javascript. For you jump to URL
put in the following expression:
="javascript:void(window.open('http://www.google.com'))"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Edmond Lee" <EdmondLee@.discussions.microsoft.com> wrote in message
news:2ED75DC0-C379-4E9A-A0E1-565B3D9DC746@.microsoft.com...
> yuanxm, Thank you for your reply.
> However, I had tried several time to type "target=_blank" together with
> URL
> for "Jump to URL" insides Navigation tab and error was resulted.
> Is there any trick required?
> "yuanxm" wrote:
>> use target=_blank
>> "Edmond Lee" wrote:
>> > I'm trying to use "Jump to URL" to link the report to external web
>> > site.
>> > However, I find that there's no way to open up a new window. It seems
>> > inconvenient for user to close the report whenever external link is
>> > clicked.
>> >
>> > Does anyone have idea to resolve this?
>> >|||This works only on the reportserver, i.e. when i view reports
http://servername/reportserver/... but the java scrip doesnt work when i view
reports on the report manager like this http://servername/reports/..
Plz suggest somethng
"Bruce L-C [MVP]" wrote:
> I have not personally needed to do this so I don't know from experience but
> my feeling is that the solution here is where you are in another webpage
> (not Reporting Services) and want to have this happen. Not when it is using
> the jump to url. What you can do (and this is something I just learned this
> week) is to use the ability with SP1 to use javascript. For you jump to URL
> put in the following expression:
> ="javascript:void(window.open('http://www.google.com'))"
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Edmond Lee" <EdmondLee@.discussions.microsoft.com> wrote in message
> news:2ED75DC0-C379-4E9A-A0E1-565B3D9DC746@.microsoft.com...
> > yuanxm, Thank you for your reply.
> >
> > However, I had tried several time to type "target=_blank" together with
> > URL
> > for "Jump to URL" insides Navigation tab and error was resulted.
> > Is there any trick required?
> >
> > "yuanxm" wrote:
> >
> >> use target=_blank
> >>
> >> "Edmond Lee" wrote:
> >>
> >> > I'm trying to use "Jump to URL" to link the report to external web
> >> > site.
> >> > However, I find that there's no way to open up a new window. It seems
> >> > inconvenient for user to close the report whenever external link is
> >> > clicked.
> >> >
> >> > Does anyone have idea to resolve this?
> >> >
>
>|||When I tried opening it on report manager, it opened 2 windows. One was
google and the other one had the
javascript:void(window.open('http://www.google.com')) on the address bar. It
was interesting!!
"NI" wrote:
> This works only on the reportserver, i.e. when i view reports
> http://servername/reportserver/... but the java scrip doesnt work when i view
> reports on the report manager like this http://servername/reports/..
> Plz suggest somethng
>
> "Bruce L-C [MVP]" wrote:
> > I have not personally needed to do this so I don't know from experience but
> > my feeling is that the solution here is where you are in another webpage
> > (not Reporting Services) and want to have this happen. Not when it is using
> > the jump to url. What you can do (and this is something I just learned this
> > week) is to use the ability with SP1 to use javascript. For you jump to URL
> > put in the following expression:
> >
> > ="javascript:void(window.open('http://www.google.com'))"
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Edmond Lee" <EdmondLee@.discussions.microsoft.com> wrote in message
> > news:2ED75DC0-C379-4E9A-A0E1-565B3D9DC746@.microsoft.com...
> > > yuanxm, Thank you for your reply.
> > >
> > > However, I had tried several time to type "target=_blank" together with
> > > URL
> > > for "Jump to URL" insides Navigation tab and error was resulted.
> > > Is there any trick required?
> > >
> > > "yuanxm" wrote:
> > >
> > >> use target=_blank
> > >>
> > >> "Edmond Lee" wrote:
> > >>
> > >> > I'm trying to use "Jump to URL" to link the report to external web
> > >> > site.
> > >> > However, I find that there's no way to open up a new window. It seems
> > >> > inconvenient for user to close the report whenever external link is
> > >> > clicked.
> > >> >
> > >> > Does anyone have idea to resolve this?
> > >> >
> >
> >
> >
Open the link in new window
When i giving a url passing some parameter..in Jump to Url of cell navigation properties..
In VS Studio its opening in new window ..but when deployed in server and its opening same browser while my requirement is to open in new window..
You need to set the LinkTarget deviceinfo to "_blank". This can be set using a url parameter or in the rsreportserver.config file.
See this link for more information on setting the device info:
http://msdn2.microsoft.com/en-us/library/ms155397.aspx
This link has information on the device info settings for the html renderer.
http://msdn2.microsoft.com/en-us/library/ms155395.aspx
|||I have Used this code in jump to url of navigation text box void(window.open(url))" its working and had satisfied mine requirement..
sqlOpen the link in new window
When i giving a url passing some parameter..in Jump to Url of cell navigation properties..
In VS Studio its opening in new window ..but when deployed in server and its opening same browser while my requirement is to open in new window..
You need to set the LinkTarget deviceinfo to "_blank". This can be set using a url parameter or in the rsreportserver.config file.
See this link for more information on setting the device info:
http://msdn2.microsoft.com/en-us/library/ms155397.aspx
This link has information on the device info settings for the html renderer.
http://msdn2.microsoft.com/en-us/library/ms155395.aspx
|||I have Used this code in jump to url of navigation text box void(window.open(url))" its working and had satisfied mine requirement..
Tuesday, March 20, 2012
Open Report with Parameter over URL
i want to open a report with one parameter over hyperlink.
The URL from the report is:
http://wh-report/Pages/Report.aspx?ItemPath=%2fVertrieb%2fKundeninfo
Can somebody tell me the solution.
The parameter is a customer number like: 123431
Thanks for your help,
HorstThis sample I picked up from online help.. Please go through for more details.
http://server/reportserver?/Sales/Northwest/Employee Sales
Report&rs:Command=Render&EmployeeID=1234
Here "Employee Sales Summary" is the name of the report and "EmployeeID =1234" is the parameter. be careful of ambersand and the syntax.
Amarnath
"Horst Wutscher" wrote:
> Hello,
> i want to open a report with one parameter over hyperlink.
> The URL from the report is:
> http://wh-report/Pages/Report.aspx?ItemPath=%2fVertrieb%2fKundeninfo
> Can somebody tell me the solution.
> The parameter is a customer number like: 123431
> Thanks for your help,
> Horst
>
>
Open PDF in Web Browser
I've got a report that I invoke from within Javascript using a direct
URL hit to the report. When the report generates it asks to either
"Open" or "Save" the PDF file. When I click on Open it opens Acrobat
Reader to view the file.
I need the report to open within the same browser as the javascript
that kicked it off without any prompts.
Is this possible in Reporting Services?
Regards,
Graham Richter.Hi
Are you wanting it still to be pdf and just open with the plugin? Or
otherwise render it as html.
Monday, March 19, 2012
Open New Window from Iframe
the standard way of opening a new window using the Jump To URL
navigation feature - ie using the
="javascript:void(window.open('someURL'))" works great as long as the
report containing these links is NOT in an IFRAME. If it is, it's
treating the Javascript as the URL.
Anyone getting same results? Anyone know of a workaround?This is one I use. But, this opens it up in a new window.
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
I worked with someone about a week ago who wanted to do what you do. This is
what I believed worked for him. Let's say your iframe is called main. Then
do this:
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','main'))"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Raz" <Raz@.discussions.microsoft.com> wrote in message
news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
>I am having this problem. Any thoughts?
> the standard way of opening a new window using the Jump To URL
> navigation feature - ie using the
> ="javascript:void(window.open('someURL'))" works great as long as the
> report containing these links is NOT in an IFRAME. If it is, it's
> treating the Javascript as the URL.
> Anyone getting same results? Anyone know of a workaround?
>|||Thanks for the Reply Bruce. I have read many of your posts and have already
tried opening a window using your technique. Actually the technique works
fine except for when you are opening a window from an Iframe the address bar
in the new window shows
"javascript:void(window.open('http://www.google.com','_blank'))" instead of
the url "http://www.google.com" of course the result of this is "Page cannot
be displayed"
Any thoughts?
"Bruce L-C [MVP]" wrote:
> This is one I use. But, this opens it up in a new window.
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> I worked with someone about a week ago who wanted to do what you do. This is
> what I believed worked for him. Let's say your iframe is called main. Then
> do this:
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','main'))"
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Raz" <Raz@.discussions.microsoft.com> wrote in message
> news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
> >I am having this problem. Any thoughts?
> >
> > the standard way of opening a new window using the Jump To URL
> > navigation feature - ie using the
> > ="javascript:void(window.open('someURL'))" works great as long as the
> > report containing these links is NOT in an IFRAME. If it is, it's
> > treating the Javascript as the URL.
> >
> > Anyone getting same results? Anyone know of a workaround?
> >
>
>|||Just to let everyone know I go this working by including &rc:linktarget=_self
in the url to the report server.
"Raz" wrote:
> Thanks for the Reply Bruce. I have read many of your posts and have already
> tried opening a window using your technique. Actually the technique works
> fine except for when you are opening a window from an Iframe the address bar
> in the new window shows
> "javascript:void(window.open('http://www.google.com','_blank'))" instead of
> the url "http://www.google.com" of course the result of this is "Page cannot
> be displayed"
> Any thoughts?
> "Bruce L-C [MVP]" wrote:
> > This is one I use. But, this opens it up in a new window.
> >
> > ="javascript:void(window.open('" & Globals!ReportServerUrl &
> > "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> > "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> >
> > I worked with someone about a week ago who wanted to do what you do. This is
> > what I believed worked for him. Let's say your iframe is called main. Then
> > do this:
> >
> > ="javascript:void(window.open('" & Globals!ReportServerUrl &
> > "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> > "&rs:Format=CSV&rc:Encoding=ASCII','main'))"
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> >
> > "Raz" <Raz@.discussions.microsoft.com> wrote in message
> > news:184220F9-B42F-42B9-80F1-ED8946C29EB6@.microsoft.com...
> > >I am having this problem. Any thoughts?
> > >
> > > the standard way of opening a new window using the Jump To URL
> > > navigation feature - ie using the
> > > ="javascript:void(window.open('someURL'))" works great as long as the
> > > report containing these links is NOT in an IFRAME. If it is, it's
> > > treating the Javascript as the URL.
> > >
> > > Anyone getting same results? Anyone know of a workaround?
> > >
> >
> >
> >
Open new window (URL)
Hi All
I tried to use the "="java script:void(window.open('http://www.microsoft.com','_blank'))"
in the URL (Action option), when I click on it, nothing happen (The cursor show that there is a link, changes into a hand).
Thank you
http://www.codeprof.com/dev-archive/10/19-82-107438.shtm
You almost had it!
Friday, March 9, 2012
Open a url in a new window
I try to pass some field values to a url and render it to a web application.
I tried to do it with a javascript function
javascript:if(window.open('http://server?id=' &
Fields!ID.Value,'Popups','width=400,height=500,location=0,menubar=0,status=0,toolbar=0,scrollbars=1',true)){}
But I had no luck with it. Could someone assist me on this? Thanks!another option would be to use the "Target=_New" in the URL properties.
<a target="_blank" href="http://links.10026.com/?link=the/">http://www.URL.com">The Bible</a>
"fru" wrote:
> I'm trying to do something as follows:
> I try to pass some field values to a url and render it to a web application.
> I tried to do it with a javascript function
> javascript:if(window.open('http://server?id=' &
> Fields!ID.Value,'Popups','width=400,height=500,location=0,menubar=0,status=0,toolbar=0,scrollbars=1',true)){}
> But I had no luck with it. Could someone assist me on this? Thanks!|||I'm trying to address the url to a web application from a report server not
vice versa.
"mresanchez" wrote:
> another option would be to use the "Target=_New" in the URL properties.
> <a target="_blank" href="http://links.10026.com/?link=the/">http://www.URL.com">The Bible</a>
> "fru" wrote:
> > I'm trying to do something as follows:
> >
> > I try to pass some field values to a url and render it to a web application.
> > I tried to do it with a javascript function
> > javascript:if(window.open('http://server?id=' &
> > Fields!ID.Value,'Popups','width=400,height=500,location=0,menubar=0,status=0,toolbar=0,scrollbars=1',true)){}
> >
> > But I had no luck with it. Could someone assist me on this? Thanks!
Open a url from report in new window
Hello,
I have areport with a text box. The text box is hyperlinked to another report url. The report opens in a new page when previewed with RS 2005 but when deployed the report opens in teh same page from where it is referenced.
How can I set a property with the texbox to always open in a new page the hyperlinked report.
Thanks in advance
'Kiran.
You can set the &rc:LinkTarget= URL parameter to use &rc:LinkTarget="_blank"
http://msdn2.microsoft.com/en-us/library/aa179583(SQL.80).aspx
Not sure if you can set the property directly from the report itself.
cheers,
Andrew
Open .RDL in ASP.NET without ReportServer
report dynamically without any report url or anything.
I just want to pass the database authentication to the .RDL [reportViewer?]
and a few parameters, and run the report. But I do not want the report to
exist in a subweb or http://reportServer etc. I just want to drop it right
into my project, and go.
Thanks for any links or advice.This is totally possible with the new controls that ship with VS 2005. You
can develop the report and then view it in your app using the controls. Note
that this is more work. You have to handle subreports, drill through etc.
Also, I found the design environment in VS 2005 that comes with VS to design
reports nowhere as near as nice as the report designer that comes with SQL
Server. Note that if you have SQL Server, the designer comes with it. You
can develop and preview the reports without deploying them, then just change
the extension and bring them into your project.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Chris" <cmill575@.hotmail.com> wrote in message
news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
> Is it possible to simply add an .RDL to an asp.net project, and access the
> report dynamically without any report url or anything.
> I just want to pass the database authentication to the .RDL
> [reportViewer?] and a few parameters, and run the report. But I do not
> want the report to exist in a subweb or http://reportServer etc. I just
> want to drop it right into my project, and go.
> Thanks for any links or advice.
>|||Thanks for your response. That's good news. I hope MS improves the designer
in VS.
Cant you just design the report using the SQL Server report designer and
then drop the rdl into your web project?
Anyway, thanks again.
BTW: Does anyone have any walkthrough's using this new functionality? I
havent used RS since it first came out.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:u1R684jBGHA.3292@.TK2MSFTNGP09.phx.gbl...
> This is totally possible with the new controls that ship with VS 2005. You
> can develop the report and then view it in your app using the controls.
> Note that this is more work. You have to handle subreports, drill through
> etc. Also, I found the design environment in VS 2005 that comes with VS to
> design reports nowhere as near as nice as the report designer that comes
> with SQL Server. Note that if you have SQL Server, the designer comes with
> it. You can develop and preview the reports without deploying them, then
> just change the extension and bring them into your project.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Chris" <cmill575@.hotmail.com> wrote in message
> news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
>> Is it possible to simply add an .RDL to an asp.net project, and access
>> the report dynamically without any report url or anything.
>> I just want to pass the database authentication to the .RDL
>> [reportViewer?] and a few parameters, and run the report. But I do not
>> want the report to exist in a subweb or http://reportServer etc. I just
>> want to drop it right into my project, and go.
>> Thanks for any links or advice.
>|||You can use the SQL Server report designer and then rename the extension and
then use that. That is really the easiest. The issue with VS is that there
is no preview. You have to deploy and use either your web page or your
winform to view the report.
Just dropping the rdl into your web project makes no sense unless there is
something to render the report. That is where the new controls come in.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Chris" <cmill575@.hotmail.com> wrote in message
news:%23Xt1UVpBGHA.2300@.TK2MSFTNGP15.phx.gbl...
> Thanks for your response. That's good news. I hope MS improves the
> designer in VS.
> Cant you just design the report using the SQL Server report designer and
> then drop the rdl into your web project?
> Anyway, thanks again.
> BTW: Does anyone have any walkthrough's using this new functionality? I
> havent used RS since it first came out.
>
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:u1R684jBGHA.3292@.TK2MSFTNGP09.phx.gbl...
>> This is totally possible with the new controls that ship with VS 2005.
>> You can develop the report and then view it in your app using the
>> controls. Note that this is more work. You have to handle subreports,
>> drill through etc. Also, I found the design environment in VS 2005 that
>> comes with VS to design reports nowhere as near as nice as the report
>> designer that comes with SQL Server. Note that if you have SQL Server,
>> the designer comes with it. You can develop and preview the reports
>> without deploying them, then just change the extension and bring them
>> into your project.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Chris" <cmill575@.hotmail.com> wrote in message
>> news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
>> Is it possible to simply add an .RDL to an asp.net project, and access
>> the report dynamically without any report url or anything.
>> I just want to pass the database authentication to the .RDL
>> [reportViewer?] and a few parameters, and run the report. But I do not
>> want the report to exist in a subweb or http://reportServer etc. I just
>> want to drop it right into my project, and go.
>> Thanks for any links or advice.
>>
>
OOpening report in new page without using url.
Sounds simple but here is what I need. I have an aspx webform that asks the user for 19 parameters that my report requires. I need to validate the form and have a button that the user can click and have the report open in a new window. Like I said the report has 19 parameters and we would like to avoid passing the parameters in the url. Here is what I’ve tried:
Using cross-page postback I can pass the parameters captured in the Getparameters webform to the viewreport webpage but it opens on the same window. I can use a regular button or a linkbutton and added “onclick” attributes to run clientside validation before submitting a form. The viewreport webpage has a reportviewer control. I just need to open the report in a new window.
Tried javascript window.open in several places (btnView “onclick”, linkbutton “onclick”, registerclientscriptblock (runs after the form is posted) all giving me the error “object null reference exception” on the report parameters.
Lastly I’m trying to use SOAP and running render method for button on_click but I keep getting the error report path not valid report path needs to be less than 260 characters and must start with slash. Here is the code that I’m using for render method:
Dim rsAsNew RSWebReference.ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
'Render Arguments
Dim resultAsByte =Nothing
Dim reportPathAsString ="/Sales/MonthlySales"
Dim formatAsString ="PDF"
Dim historyIDAsString =Nothing
Dim devInfoAsString = “<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
'Prepare report Parameters
Dim parameters(0)As RSWebReference.ParameterValue
parameters(0) =New RSWebReference.ParameterValue
parameters(0).Name ="Date"
parameters(0).Value ="09/10/2006"
Dim credentials()As RSWebReference.DataSourceCredentials =Nothing
Dim showhidetoggleAsString =Nothing
Dim encodingAsString =""
Dim mimeTypeAsString =""
Dim warnings()As RSWebReference.Warning =Nothing
Dim reportHistoryParametersAs RSWebReference.ParameterValue() =Nothing
Dim streamIDAsString() =Nothing
rs.Render("MonthlySales","PDF", historyID, devInfo, parameters, credentials, showhidetoggle, encoding, mimeType, reportHistoryParameters, warnings, streamID)
I just want to know if what I want to accomplish is even posible because I’ve been at this for over a week, going Crazy!
I thought maybe the report needed credentials set instead of nothing, but don’t know how to do that. Using VS 2005, SQL 2005
Any help is immensely appreciated!
I've tried a bunch of different things myself and can't seem to get it. It would be nice that after you call rs.Render(), rs would have a property set to the url of what you just ran. There is a method rs.GetReportLink(ReportName as String) but it just returns the url to the report with none of the query string. My guess is you'll be writing a URL Generator and using a RegisterStartUp script to call a javascript:window.open(). Works well for me.|||
I finally figured it out. Seems that I had the incorrect webreference and was sending the wrong parameters, but here is my solution.
I added a web reference to ReportExecution2005 and used the following code:
Response.BufferOutput = True
Response.ClearContent()
Response.ClearHeaders()
Response.AddHeader("content-type", ContentType)
Response.AddHeader("Content-Length", result.Length.ToString)
Response.AddHeader("content-disposition", "attachement;filename='" & FileName & "'")
Response.BinaryWrite(result)
Response.Flush()
Response.Clear()
'End the response
Response.End()
By using content-disposition "attachement" I have the browser ask the user to open or save the report. To have this open in a new window I had to go with the form target=_blank. I did find that different MIME types yield different results. For example using "application/pdf" will open the pdf document in a the recently opened new browser window. Using "application/x-pdf" will open the pdf document in acrobat session leaving a blank page behind. I also tried exporting the report to excel, but the onlyl issue with excel is that it renders the report formated so some columns do not match the cells. I haven't figured out how to render that correctly.