Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Managed url reporting in XI 1

Status
Not open for further replies.

Arora007

Programmer
Nov 15, 2005
7
US
Hello All,

Last week I asked a question if someone has implemented managed reporting in XI. I got the following article back from :

synapsevampire (Programmer) 2 Mar 06 19:28
Read this:


I have applied the updates as this above article points out. My question is how do I identify objectid in CMS_InfoObjects4 table intalled in BOE11 database on MSDE. In other words, when I look at the fields of this table I see no report description that will identify what object id to use for managed url reporting. (In version 10 there was a report description field). I can't get past this hurdle to try the


Has anyone successfully implemented this in XI.

Thanks in advance.
Rick
 
Hi,
With Managed reports ( those published) the ID is assigned when published and can be seen in the Properties of that report ( In the CMC, right-click the Report Name while viewing its folder, and, under propeties you will see the ID#)

You cannot directly view that info from a database..you can use the Query Builder to find the ID, but, that is an extra step if used in place of looking in the CMC..





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi Turkbear,

Thanks for the tip. I was able to get to the url through report properties. But I was not able to bring up that report using the same url as it errored saying

"There was an error while retrieving data from the server:Not Authorized".

I am wondering how to pass the login information to the url:


so that I can get authenticated using secEnterprise username and password.

Thanks.
Rick
 
Hi,
Depends on your system, but you can pass the username/password as part of the call:
Code:
[URL unfurl="true"]http://<YourCEServer>/businessobjects/viewrpt.cwr?ID=1545&cmsname=<yourcms>&apsuser=ReadOnly&apspassword=sample123&apsauthtype=secenterprise[/URL]

That runs the Report whose ID# is 1545 using a special account I set up just for running reports - it has View-On-Demand rights..

The database info for that report ( as opposed to the Authentication ) is saved with the published report.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Does the above code snippet works for business objects xi. I thought in xi we are to use infoobject.cwr
I get a blank explorer window when I tried the aboce code.
 
Hi,
That is from an XI setup
You can switch it to:
Code:
[URL unfurl="true"]http://<YourCEServer>/businessobjects/viewrpt.asp?ID=1545&cmsname=<yourcms>&apsuser=ReadOnly&apspassword=sample123&apsauthtype=secenterprise[/URL]
I actually rarely use that form anymore for managed reports, I created a 'generic' report_viewer.asp page that accepts URL parameters and runs the report:
The Page:

Code:
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=charset=UTF-8">
<BODY>
<%
'===================================================================
'Declare the CMS Logon Variables
Dim CMS
Dim Username
Dim Password
Dim Authtype

'Set CMS logon credentials - change these to match your particular CE environment
CMS = "<YOURCMSHERE>"
Username = "ReadOnly"    [COLOR=red] 'special account [/color]
Password = "sample123"
Authtype = "secEnterprise"


'Declare variables for Enterprise Session
Dim oEnterpriseSessionMgr
Dim ceSession
Dim iStore
'Get the values
Rid = Request.QueryString("ReportID")
NbrParams = Request.QueryString("NumParens")
If NbrParams > 0 then
ValStr   = Request.QueryString ("Pvals")
NameStr = Request.QueryString ("Pnames")
arrVals = Split(ValStr,";")
arrNames = Split(NameStr,",")
End If


'Load the Enterprise Session Manager

Set oEnterpriseSessionMgr = Server.CreateObject("CrystalEnterprise.SessionMgr")

'Logon to the CMS and create iStore object
Set ceSession = oEnterpriseSessionMgr.Logon(Username, Password, CMS, Authtype)
Set iStore = ceSession.Service("","InfoStore")

'Declare InfoObject Variable
Dim Reports
Dim Report
'Dim Qry
'Query the CMS for the report you wish to view
Set Reports = iStore.Query("Select * from CI_InfoObjects Where SI_ProgID = 'CrystalEnterprise.Report' and SI_ID='" & Rid & "'")
Report = Reports.Item(1).Properties("SI_ID")
'Qry = Reports.SQLQueryString
'Declare the report parameter variables
Dim reportParameters
Dim fields
Dim tmpParameter
Dim value
Dim NewSpec()
Dim PType()
Dim inx 
Dim pcnt
pcnt = 0
inx = 0

'Get the report parameter(s) using the plugin interface
Set reportParameters = Reports.Item(1).PluginInterface("Report").ReportParameters
If NbrParams > 0 then
                       ' Build an array structure to determine the parameter type
For each parameter in reportParameters
	  pcnt = pcnt + 1
	  Next
	For each parameter in reportParameters
	 ReDim PType(pcnt)
	 PType(inx) = parameter.ValueType
	 inx = inx + 1
	 Next

	'Create a new Fields Collection Object
	Set fields = CreateObject("CrystalReports.Fields")
	
	for n = 0 to (NbrParams - 1)
	' Create a temporary parameter field 
		Set tmpParameter = CreateObject("CrystalReports.ParameterField")
		' Create list of values for this parameter
		arrPvals = Split(arrVals(n),",")
		Max = UBound(arrPvals)
		ReDim NewSpec(Max)
		' Create a parameter value oblect for each value in list 
		for v = 0 to UBound(arrPvals)
		set NewSpec(v)   =  createobject("CrystalReports.ParameterFieldDiscreteValue")  
		Next
		i = 0 ' initialize counter for value list array access
		 for each val in arrPvals  ' assign the value to the parameter
		    if PType(n) = 3 then
		       NewSpec(i).value = cDate(val)
		    else
		         NewSpec(i).value = Trim(val)
		   end if
		        tmpParameter.CurrentValues.Add NewSpec(i)
		              i = i + 1     ' increment counter
		              		 Next
			 
		tmpParameter.name = arrNames(n)
	Fields.Add tmpParameter
 Next ' parameter
  
End If

'Declare the Report App Factory and Report Document Objects
Dim rptAppFactor
Dim reportDocument

'Create the Report App Factory and Report Document Objects
Set rptAppFactory = iStore.EnterpriseSession.Service("","PSReportFactory")
Set reportDocument = rptAppFactory.OpenReportSource(Report)


'Declare the viewer object variable
Dim Viewer
'Create a viewer object and view the report
Set Viewer = CreateObject("CrystalReports.CrystalReportInteractiveViewer")
With Viewer
  .reportSource = reportDocument
  .HasBooleanSearchButton = False
  .HasCrystalLogo = False
  If NbrParams > 0 then
  .ParameterFields = Fields
  End If
  .HasRefreshButton = True
  .IsDisplayGroupTree = False
  .HasPrintButton = true
  .PrintMode = 0 ' disable activeX Printing - set to 1 to enable (may require plug-in if set to 1)
  .IsOwnPage = true
End With
'

Set Session("viewer") = Viewer
Response.Redirect("viewprint.asp")

%>
</BODY>
</HTML>


We use custom coding to eventually produce a URL string like:

Code:
"[URL unfurl="true"]http://<BOEXIServer>/CeViewer/report_viewer.asp?ReportId="[/URL] + rn + "&Pnames=" + str + "&Pvals=" + arr1in + "&NumParens=" + numparams


If rn = 1545 and str = EmpNbr,DeptNbr and arr1in = 2223456,T79234 and numparams = 2 the url would be
Code:
[URL unfurl="true"]http://<BOEXIServer>/CeViewer/report_viewer.asp?ReportId=1545&Pnames=EmpNbr,DeptNbr&Pvals=2223456;T79234&NumParens=2[/URL]
I mispelled NumParens when I wrote it and have not corrected it yet, it should have been NumParams..

The redirect to the viewprint.asp page corrects a printing issue that sometimes crops up, causing printing to be cancelled - it was a workaround provided by support back in V10 .




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thank You so much Turkbear. I will try to understand the code. Where does this code reside. I mean what should be the file extension and in what folder it should reside.

Thanks again.
 
Hi,
The Report_viewer page ( and the pages that call it) are on our IIS 6 Web server which has the XI WCA installed so that it connects to our CMS which is running on a pair of clustered servers elsewhere on the network..

They are all .ASP pages ..
( A side note...due to the fact that the report_viewer.asp page handles the CMS authentication, any published report whose ID# and parameter needs are known can be called from a desktop shortcut with no further User Input needed ( ideal for Manager's desktops [wink]) )

Annoying R2 Note: Trying to use XI R2's Custom installation option and installing ONLY the WCA is an exercise in futility..No matter what you choose, nearly 2GB! of files are installed on the target machine...Maybe they will improve the Installer in an update someday




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top