Monday, March 26, 2012
Hide a sub report from view
instance report "A" contains subreport "B". I want the user to be able to
run report "A" that runs report "B", but I only want them to be able to see
report "A" in the report server folder.
Thanks,
--
JasonOn Mar 19, 7:38 am, JasonDWilson
<JasonDWil...@.discussions.microsoft.com> wrote:
> Is there any way to make a subreport hidden on the report server. For
> instance report "A" contains subreport "B". I want the user to be able to
> run report "A" that runs report "B", but I only want them to be able to see
> report "A" in the report server folder.
> Thanks,
> --
> Jason
You can try not letting the users have access to subreport B (via the
Report Manager permissions) and see if they can still access subreport
B via report A. If this does not work, then you will need to create
something custom that passes the User ID and another item/parameter to
the subreport to let it know that it is being called from report A:
The expression =User!UserID.ToString will get the current user and
then you would need to pass maybe a hidden parameter to subreport B
from report A (one that is not intuitive). That way, when subreport B
is called on it's own, the user will not know the parameter value it
needs. Hope this helps.
Regards,
Enrique Martinez
Sr. SQL Server Developer
Hidden subreport problem
+ Employee1 name
+ Employee2 name
+ Employee3 name
...
If I want to see the supervisors for a particular employee
(let's say Employee2), I can click the + and expand a
subreport below it like so:
+ Employee1 name Department
- Employee2 name Department
Employee2's Supervisor1 name
Employee2's Supervisor2 name
+ Employee3 name Department
My report has a table with 2 detail rows. The first row
has the employee names and the 2nd row has a subreport that
shows the supervisor names for that employee. I've got the
subreport's visibility set to Hidden and toggled by the
employee name. The report works except that the + next to
each employee name is offset down by one. So Employee1 has
no +, and when I click the + by Employee2, I see the
supervisors for Employee1. This obviously has something to
do with the subreport being on the 2nd detail row, because
if I move it up to be on the same row as the employee name,
it works correctly. But then it shows up between the
employee's name and department, shoving department off to
the right. I want it to display beneath the employee name
as illustrated above. Anyone know how to do this? Thanks.
-JerradI figured out the problem. I was only making the cell
holding the subreport hidden. When I make the entire
detail row hidden, it works as expected.
>--Original Message--
>I would like to create a report that looks like this:
> + Employee1 name
> + Employee2 name
> + Employee3 name
> ...
>If I want to see the supervisors for a particular employee
>(let's say Employee2), I can click the + and expand a
>subreport below it like so:
> + Employee1 name Department
> - Employee2 name Department
> Employee2's Supervisor1 name
> Employee2's Supervisor2 name
> + Employee3 name Department
>My report has a table with 2 detail rows. The first row
>has the employee names and the 2nd row has a subreport that
>shows the supervisor names for that employee. I've got the
>subreport's visibility set to Hidden and toggled by the
>employee name. The report works except that the + next to
>each employee name is offset down by one. So Employee1 has
>no +, and when I click the + by Employee2, I see the
>supervisors for Employee1. This obviously has something to
>do with the subreport being on the 2nd detail row, because
>if I move it up to be on the same row as the employee name,
>it works correctly. But then it shows up between the
>employee's name and department, shoving department off to
>the right. I want it to display beneath the employee name
>as illustrated above. Anyone know how to do this? Thanks.
>-Jerrad
>.
>
Hidden Subreport Executing Queries
drill-down type of interface that starts at a regional level to a
district level to a territory level and finally to the individual
customers within the territory. The drill-down interface was easy to
create by using Groups in conjunction with the ToggleItem and
Visibility.Hidden properties at the different Grouping levels.
The problem I have run into is that there are around 1 Million
customers across the country and the report was attempting to retrieve
all of the records at all levels at once. This turns out to be
unworkable from a performance standpoint.
To try to work around this I proposed using drill-through at the
territory level to open a new report with that territories customer
list. The customer was unwilling to accept that approach since they
wanted to keep the flexibility of navigating through the tree without
the disruption of opening a separate report.
Next I tried to work around the problem by implementing a subreport at
the customer level thinking that the subreport would only execute once
the user drilled down into the territory level. Following is a general
overview of this solution:
+ North East
- South East
- Georgia
- Atlanta
- subreport displays here with territory customer list
+ Savannah
+ Athens
+ Florida
+ Kentucky
- Midwest
+ Kansas
+ Iowa
+ Minnesota
+ West
By using SQL Profiler I found that the report was actually executing
the query for each individual territory's corresponding subreport
even though those levels were hidden. This was essentially the same
scenario that I had with my initial attempt.
To try to work around this I created a parameter within the subreport
called "show_subreport" and if that parameter is set to 1 the dataset
will return the customer list and if it is set to 0 the dataset will
not return any rows. By manually setting the parameter to 0 through
the parameter mapping in the parent report this worked well. However,
I have not been able to figure out how to dynamically change that
parameter by using an expression. I have been trying to set the
parameter expression to something like:
= IIf(Customer_DetailRow.Visible.Hidden = True, 0, 1)
However, I have not been able to get to that property or any other
property which would be relevant to the "show_subreport" parameter.
This seems like it would be a very common type of report request so I
assume there is a way to do this. Any help would be appreciated.I've got the same problem.
--
/Mattias
"fred_mumble@.yahoo.com" wrote:
> I'm currently developing a report in which the customer has requested a
> drill-down type of interface that starts at a regional level to a
> district level to a territory level and finally to the individual
> customers within the territory. The drill-down interface was easy to
> create by using Groups in conjunction with the ToggleItem and
> Visibility.Hidden properties at the different Grouping levels.
> The problem I have run into is that there are around 1 Million
> customers across the country and the report was attempting to retrieve
> all of the records at all levels at once. This turns out to be
> unworkable from a performance standpoint.
> To try to work around this I proposed using drill-through at the
> territory level to open a new report with that territories customer
> list. The customer was unwilling to accept that approach since they
> wanted to keep the flexibility of navigating through the tree without
> the disruption of opening a separate report.
> Next I tried to work around the problem by implementing a subreport at
> the customer level thinking that the subreport would only execute once
> the user drilled down into the territory level. Following is a general
> overview of this solution:
> + North East
> - South East
> - Georgia
> - Atlanta
> - subreport displays here with territory customer list
> + Savannah
> + Athens
> + Florida
> + Kentucky
> - Midwest
> + Kansas
> + Iowa
> + Minnesota
> + West
> By using SQL Profiler I found that the report was actually executing
> the query for each individual territory's corresponding subreport
> even though those levels were hidden. This was essentially the same
> scenario that I had with my initial attempt.
> To try to work around this I created a parameter within the subreport
> called "show_subreport" and if that parameter is set to 1 the dataset
> will return the customer list and if it is set to 0 the dataset will
> not return any rows. By manually setting the parameter to 0 through
> the parameter mapping in the parent report this worked well. However,
> I have not been able to figure out how to dynamically change that
> parameter by using an expression. I have been trying to set the
> parameter expression to something like:
> = IIf(Customer_DetailRow.Visible.Hidden = True, 0, 1)
> However, I have not been able to get to that property or any other
> property which would be relevant to the "show_subreport" parameter.
> This seems like it would be a very common type of report request so I
> assume there is a way to do this. Any help would be appreciated.
>sql
Hidden Subreport Executes Query
I have a subreport on my report that is only shown under certain conditions.
I have handled this successfully with the Hidden property.
I read somewhere that the hidden subreport would not execute, but if I
profile SQL server when I run the report the SQL is being executed.
Is there a way to suppress the SQL execution and speed up the report?I was unable to find an answer to this (could not find the original article
that set me down this path either). I devised a workaround that I will
post here in case anyone else is running into this.
For all the queries in my subreports, I add a NoExecute bit parameter. The
first thing I do in the query is then check to see If @.NoExectue = 1 I
SELECT a column list that is the same as my normal output, but all the
values are NULL and then return. This makes the query execute really fast
and minimizes the performance issue.
So for an example... If my query normally returns Name, Address, & Phone the
start of my query now looks like:
If @.NoExectue = 1
Begin
Select
NULL as Name,
NULL as Address,
NULL as Phone
Return
End
--Start the regular query here to return 'real' values.
"Joe L" <jjj@.lll.com> wrote in message
news:OW9f9ugdGHA.3484@.TK2MSFTNGP04.phx.gbl...
> Using SRS 2000.
> I have a subreport on my report that is only shown under certain
> conditions. I have handled this successfully with the Hidden property.
> I read somewhere that the hidden subreport would not execute, but if I
> profile SQL server when I run the report the SQL is being executed.
> Is there a way to suppress the SQL execution and speed up the report?
>
Friday, February 24, 2012
help: Passing values to formula fields of subreport from the code in vb.net
i'm new in CR, i made a subreports(ReCaisse) in a main report(rptCaisseAll) and i established many formula fields in it, i want to fill the formula fields from the code in vb.net.
this is the code:
***********************************************
Dim SoCaisse As New ClsCaisse() //object caisse
Dim Report As New rptCaisseAll //main report
Dim r1 As New ReCaisse //Subreport
//
SoCaisse.GetRecord("Exchrate,AmountUS,AmountFc,s.Notes,s.DbCr,AccName,s.AccNo", "EntryDate=convert(datetime,''" & Me.txtDate.Text & "'',103)", "s.DbCr") //GetRecord establish sql statement
SoCaisse.SelectspecialMethod() //stored procedure
Report.Database.Tables.Item(0).SetDataSource(SoCaisse.CaisseSet.Tables(0))
Report.DataDefinition.FormulaFields.Item("Date").Text = "totext('" & Me.txtDate.Text & "')" // Date is a formula fields in rptCaisseAll-main report
Report.DataDefinition.FormulaFields.Item("SoldeUS").Text = "totext('" & Me.txtCUs.Text & "')" //SoldeUS is a formula fields in ReCaisse-subreport
**********************************************************
it passed the value to "Date" formula coz "Date" is a formula in the main report, but it not passed the value to "SoldeUS" formula fields; It appears blank.
so i tried:
***********************************
r1.DataDefinition.FormulaFields.Item("SoldeUS").Text = "totext('" & Me.txtCUs.Text & "')"
***********************************
but also not passed.
any help plz...
thanks.If Me.txtCUs.Text is a date then, format it
r1.DataDefinition.FormulaFields.Item("SoldeUS").Text = "totext('" & format(Me.txtCUs.Text,"dd-mmm-yyyy") & "')"
Sunday, February 19, 2012
HELP: Alternates from a Subreport?
Hello, I'm sorta new to SSRS and had a question hopefully someone can answer. Right now I'm using a stored procedure in oracle to pass the first set of data to my report. My report is fairly simple in that it is a header a detail row and a footer for totals. There isnt any grouping or sorting of data, it just displays basically exactly what the stored procedure passes it. It's a list of customers and their information. Here is the tricky part where I am having trouble.
One of the columns is for Social Security Numbers(SSNs) and the stored procedure doesnt send the SSN. The SSN is passed from another query that is dependent on the customers ID number. So, as of right now in the details section under the SSN column I put a subreport for the SSNs. Also, some customers have more than one SSN so the subreport creates more rows according to the how many it needs to display all the SSNs. I like this because it doesnt repeat all the customers information for every SSN they have.
But where I work they dont want to have multiple files for every report and just want to keep 1 report with 1 report file. So, how can I accomplish this exact same report without using a subreport?
Hope someone can help me and thanks ahead of time.
-Evan
I put the same post on MSDN forums and this is what the solution was:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2466993&SiteID=1