Showing posts with label driven. Show all posts
Showing posts with label driven. Show all posts

Wednesday, March 28, 2012

Passing Multi-Value parameters to a Data Driven Subscription

Hi,

I've been asked to set up a data driven subscription for a number of reports which use multi value parameters. For example, show me all transactions against the following departments: IT, Building Services, Accounts.

As an interactive report it's simple, the user just selects the relevant departments, but as a data driven subscription I can't seem to find the correct format to pass the selections through.

Has anyone tried this before?

Thanks,

Dan

please search on "Multi-Value parameters to a Data Driven Subscription" in this forum.

Monday, March 12, 2012

Passing a parameter from main report SP to subreport SP

Hi,

I am using crystal reports 8.5

I have a report which has a subreport. The main report and the subreport are driven by two separate sybase SPs. The main report SP accepts 3 input parameters while the subreport SP accepts one.
One of the 3 input parameters of the main report SP is to be passed to the subreport SP as its input parameter.
So ideally when the report is run, it should ask for only 3 input params.

I tried to link the subreport. But somehow in the link box, I can't see the input parameter of the subreport which is what I want to link to the param of the main report.

Can anybody help ?

Thanks a lot,
AparnaYou can make use of Shared variables.
Assign parameter values to them and use them in subreports. Read it in help file

Wednesday, March 7, 2012

pass user name as a parameter in a query

just getting started with my first db driven web project...

I am using a MySql database with membership and roles and got that working fine. I have tables containing details of courses that users are enrolled on etc. and want to display a list of courses for the user that is signed in, so he can continue lessons on the one of his choice.

How do I pass the users name to the database query for a DataList control. So far I have tried lots of variations of the following:

<asp:SqlDataSourceID="dsCourses"runat="server"ConnectionString="<%$ ConnectionStrings:xxx %>"
ProviderName="<%$ ConnectionStrings:xxx.ProviderName %>"
SelectCommand="SELECT c.CourseName FROM courses c, enrolments e
WHERE c.CourseID=e.CourseID AND e.Username='<% =User.Identity.Name %>'">
</asp:SqlDataSource>

<asp:DataListID="DataList1"runat="server"DataSourceID="dsCourses">
<ItemTemplate>
<asp:HyperLinkID="HyperLink1"runat="server"NavigateUrl="Lesson.aspx">'<%# Eval("CourseName") %>'</asp:HyperLink><br/>
</ItemTemplate>
</asp:DataList> </p>

However, the <% =User.Identity.Name %> doesn't work here (but it does elsewhere on the page) - not sure why?? The code works fine if I hard code a user name into the select statement.

Suggestions pleeeeeese!!

You need to use ProfileParameter for the SQL SelectParameters on SqlDataSource.

<asp:SqlDataSourceID="dsCourses"runat="server"ConnectionString="<%$ ConnectionStrings:xxx %>"
ProviderName="<%$ ConnectionStrings:xxx.ProviderName %>"
SelectCommand="SELECT c.CourseName FROM courses c, enrolments e
WHERE c.CourseID=e.CourseID AND e.Username=@.userName">
<SelectParameters>
<asp:ProfileParameter Name="userName" PropertyName="UserName" />
</SelectParameters>
</asp:SqlDataSource
where Name is the name of the parameter and PropertyName is the name of the profile property( current user)

Thanks