Showing posts with label sub. Show all posts
Showing posts with label sub. Show all posts

Monday, March 26, 2012

Passing log on info to sub reports

I am trying to access a Crystal report from ASP. This report has a linked sub report. I am able to view the main report from the ASP page. but when i access the sub report i get the error--> Server has not been started. which means that my sub report is not getting the database log on info. i tried passin the info with the code available on net. but the first line itself fails saying Object does not suppot this method. My code is

set crSections=session("oRpt").sections
'if i print the error message here it says object does not support this method.

For Each crSection In crSections
crReportObjects = crSection.ReportObjects

'loop through all the report objects to find all the subreports
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then

'you will need to typecast the reportobject to a subreport()
'object once you find it

crSubreportObject = CType(crReportObject, SubreportObject)
'open the subreport object
crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)

'set the database and tables objects to work with the subreport()
crDatabase = crSubreportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables in the subreport and
'set up the connection info and apply it to the tables
For Each crTable In crTables
crTable.SetLogOnInfo "test" , "","test","test"
if crTable.TestConnectivity then
Response.Write "Connecting to sub" ' I am getting this message

end if

Next

End If
Next
Next

please point out what i am doin wrong. Greatly appreciate the help!The culprit is
crSubreportObject = CType(crReportObject, SubreportObject)
i commented this line and it works! :)

Friday, March 9, 2012

pass value to sub report

hi ,
I need to pass multi selectes value to my sub report. to do so , i have done like the following,
=Parameters!ReportServer.Value & "/ResourceCost&rcStick out tonguearameters=false&rc:zoom=100&rc:Toolbar=true&BU=" & JOIN(parameter!BU.label)

Bu is the multi select value and need to pass ot to the sub report dataset mdx query.

sub report mdx:
SET [FilteredBUSet] AS descendants({strtoset(@.BU)},[Account—BillingCodeDsc].[Billing Code Description],leaves) .
How can i achieve this task. cant find a way. pls help me.
The problem is like this guys. once we click the link in the main report , it should go to the another report. multi selected values in the main report should pass to another report. need to access those coming params to access in the mdx query in the navigated report. can use like following in the navigation tab -> jump to url and can use the following.

=Parameters!ReportServer.Value & "/ResourceCost&rcStick out tonguearameters=false&rc:zoom=100&rc:Toolbar=true&Year="
& Fields!Year.Value & "&Quarter="
& Fields!Quarter.Value & "&InScope="
& InScope("Months") & "&Month=" & Fields!Month.Value & "&Sample=" & (Fields!Business_Unit.Value)

this business value is the multivalue. it may contain lot params like that. this also have some problem. and also if we have lot of params to pass to other report then cant use query string coz of the limitation of the query string. so can some one say how to pass param values to another report in good manner?
|||

I used this to pass multivalue parameters to a subreport

example

=Split(Join(Parameters!GDC1.Value,", "),", ")

=Join(Parameters! <ParameterName> .Value,", ")

An expression that concatenates all the values in the array of a multivalued parameter of type String into one string.

=Split("Value1, Value2, Value3",",")

Takes a string and creates an array of objects that can be used to pass to a subreport or drillthrough report expecting a multivalue parameter.

http://msdn2.microsoft.com/en-us/library/aa337292.aspx

hope this helps

pass value to sub report

hi ,
I need to pass multi selectes value to my sub report. to do so , i have done like the following,
=Parameters!ReportServer.Value & "/ResourceCost&rcStick out tonguearameters=false&rc:zoom=100&rc:Toolbar=true&BU=" & JOIN(parameter!BU.label)

Bu is the multi select value and need to pass ot to the sub report dataset mdx query.

sub report mdx:
SET [FilteredBUSet] AS descendants({strtoset(@.BU)},[Account—BillingCodeDsc].[Billing Code Description],leaves) .
How can i achieve this task. cant find a way. pls help me.
The problem is like this guys. once we click the link in the main report , it should go to the another report. multi selected values in the main report should pass to another report. need to access those coming params to access in the mdx query in the navigated report. can use like following in the navigation tab -> jump to url and can use the following.

=Parameters!ReportServer.Value & "/ResourceCost&rcStick out tonguearameters=false&rc:zoom=100&rc:Toolbar=true&Year="
& Fields!Year.Value & "&Quarter="
& Fields!Quarter.Value & "&InScope="
& InScope("Months") & "&Month=" & Fields!Month.Value & "&Sample=" & (Fields!Business_Unit.Value)

this business value is the multivalue. it may contain lot params like that. this also have some problem. and also if we have lot of params to pass to other report then cant use query string coz of the limitation of the query string. so can some one say how to pass param values to another report in good manner?
|||

I used this to pass multivalue parameters to a subreport

example

=Split(Join(Parameters!GDC1.Value,", "),", ")

=Join(Parameters! <ParameterName> .Value,", ")

An expression that concatenates all the values in the array of a multivalued parameter of type String into one string.

=Split("Value1, Value2, Value3",",")

Takes a string and creates an array of objects that can be used to pass to a subreport or drillthrough report expecting a multivalue parameter.

http://msdn2.microsoft.com/en-us/library/aa337292.aspx

hope this helps