Showing posts with label combine. Show all posts
Showing posts with label combine. Show all posts

Sunday, March 11, 2012

Cascading Parameter Defaults

I've had good luck with driving reports with cascading parameters and
parameters with defaults. So far though, I've been unable to combine these
concepts.
Using the example mentioned in BOL, I'd like to have a division parameter
choice drive a department parameter dropdown. When the department dropdown
is populated, is there any way to specify a default value? So far, my
attempts to do so have failed - with no default being chosen and no errors
appearing.
Does anyone know how I might be able to accomplish this?I was able to use defaults with cascading parms. In my scenario, I wanted
the user to choose the division (I'm actually using something else), but then
have the option to choose the department. Basically, the report would show
data for the entire division if the department parm wasn't choosen.
The only way I could get this to work was to use a default for the
department parm. I set the default to "non-queried" and the formula equal to
="" (and empty string). Also, the department parm is checked off to allow
null and blank values.
At first this didn't work because the default value must be a valid value in
the department dataset that populates the dropdown. My fix was to union in
a select statement tothe dataset with the default empty string value. Here's
that sql:
SELECT '' DeptID, '' DeptName
UNION ALL
SELECT DeptID, DeptName FROM DeptTable
WHERE DivID = @.DivID
ORDER BY DeptName
Now, when the division dropdown is choosen, the cascade parm populates the
department dropdown. But since the default is set to "", and "" is a valid
choice in the recordset - RS is happy.
The only thing else I had to do was have the actual report dataset know how
to handle the department as an empty string. No biggie.
Mike, to apply this to your scenario, I think the key is making sure the
default value is always in the dataset for the dept dropdown.
Hope this helps, Frank

Wednesday, March 7, 2012

carraige return

This is an easy question, I have two address fields and I have combine them
together but I want address_2 to show up on the next line instead of have a
sapce between address1 and address2
Any Idea
Thank in Advance
=Fields!BILLING_ADDRESS.Value & " " Fields!BILLING_ADDRESS_2.Value=Fields!BILLING_ADDRESS.Value & ControlChars.CrLf &
Fields!BILLING_ADDRESS_2.Value
--
Med Bouchenafa
"superQ" <superQ@.discussions.microsoft.com> a écrit dans le message de news:
5E9BA72C-7B82-447F-BA54-4F8251A3E9A8@.microsoft.com...
> This is an easy question, I have two address fields and I have combine
> them
> together but I want address_2 to show up on the next line instead of have
> a
> sapce between address1 and address2
> Any Idea
> Thank in Advance
> =Fields!BILLING_ADDRESS.Value & " " Fields!BILLING_ADDRESS_2.Value