Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all 10045 articles
Browse latest View live

Results are giving me 5 rows instead of 1 row

$
0
0

Hi

I have created a query that is suppose to display the results of opportunities won during a time period the user selects.

When I run the report, I get 5 rows of the exact same result.

How come I am getting this?

How do I fix this please?

DECLARE @DateStart		DATE		  = '2011/02/25';
DECLARE @DateEnd		DATE		  = '2015/12/27';
DECLARE @User			VARCHAR(100)  = 'Linda Smith';


SELECT
OPP.customeridname		AS 'Customer Name',
OPP.contactidname       AS 'Contact Name',
OPP.actualclosedate		AS 'Actual Close Date',
OPP.actualvalue			AS 'Actual Value',
OPP.createdbyname		AS 'Created By Name',
OPP.createdby			AS 'Created By ID',

TBU.businessunitidname	AS 'Business Unit Name',
TBU.businessunitid		AS 'Business Unit ID'


FROM dbo.FilteredOpportunity AS OPP
INNER JOIN dbo.FilteredUserSettings AS TBU ON OPP.createdby = TBU.createdby


WHERE OPP.actualclosedate BETWEEN @DateStart AND @DateEnd

ORDER BY TBU.businessunitid ASC;



The variable name '@FirstDateofYear' has already been declared. Variable names must be unique within a query batch...

$
0
0

When trying to create an ssrs report with the sql below I get an error the reads: 

An Error occurred while the query design method was being saved. The variable name '@FirstDateofYear' has already been declared. Variable names must be unique within a query batch or stored procedure.

CREATE TABLE #MissingByProf ( Professionals VarChar( 50 ), MissingTimeDays Varchar(50), DaysList Varchar(50), ShortMissingDays Varchar(50))
CREATE TABLE #MissingProfessionalsDays ( Professionals Varchar( 50 ), MissingTimeDays DATETIME, DaysList Varchar(50))
CREATE TABLE #MissingTimeDays ( Professionals Varchar( 50 ), MissingTimeDays DATETIME, ShortMissingDays Varchar(50),DaysList Varchar(50))


       DECLARE @Year AS INT = 2015,
@FirstDateOfYear DATETIME = DATEADD(yyyy, 2015 - 1900, 0),
@LastDateOfYear DATETIME = DATEADD(yyyy, 2015 - 1900 + 1, 0)
;WITH cte AS (
SELECT 1 AS DayID,
@FirstDateOfYear AS FromDate,
DATENAME(dw, @FirstDateOfYear) AS Dayname
UNION ALL
SELECT cte.DayID + 1 AS DayID,
DATEADD(d, 1 ,cte.FromDate),
DATENAME(dw, DATEADD(d, 1 ,cte.FromDate)) AS Dayname
FROM cte
WHERE DATEADD(d,1,cte.FromDate) < @LastDateOfYear
)
       INSERT INTO #MissingTimeDays (MissingTimeDays) 

SELECT FromDate AS Date
FROM CTE
WHERE (DayName LIKE 'Monday' OR Dayname LIKE 'Tuesday' OR Dayname LIKE 'Wednesday' OR Dayname LIKE 'Thursday' OR Dayname LIKE 'Friday') AND (CTE.FromDate >= '2015-06-01' AND CTE.FromDate <= '2015-06-30') AND FromDate NOT IN (SELECT HoliDate FROM Holidays WHERE EventTypeRules IS 
    NULL)
ORDER BY Date asc

OPTION (MaxRecursion 370)


INSERT INTO #MissingProfessionalsDays (Professionals, 
    MissingTimeDays) SELECT Professionals.Professionals, MissingTimeDays FROM #MissingTimeDays, 
    Professionals WHERE IsActive = 'Y' AND MissingTimeDays >= 
    Cast(COALESCE(DateEmployed, '1899-12-31') as DateTime) AND MissingTimeDays <= 
    Cast(COALESCE(DateTerminated, '3000-12-31') as DateTime)  AND 
    ((PROFDEPT='CV-CFB' AND PROFTYPE IN ('PARALEGAL', 'ATTORNEY'))) GROUP BY 
    Professionals.Professionals, MissingTimeDays HAVING COALESCE((SELECT SUM(Units) FROM 
    Transactions, Components WHERE TransDate = MissingTimeDays AND 
    Transactions.Professionals = Professionals.Professionals AND 
    Transactions.Components = Components.Components AND CompType='F' AND IsFlatFee 
    <> 'Y'), 0)  < 7.5

       INSERT INTO #MissingByProf (Professionals) SELECT 
    Distinct Professionals FROM #MissingProfessionalsDays

       SELECT Professionals.ProfName, #MissingProfessionalsDays.Professionals, MissingTimeDays FROM 
    #MissingProfessionalsDays
       INNER JOIN Professionals ON #MissingProfessionalsDays.Professionals = Professionals.Professionals
       ORDER BY MissingTimeDays, #MissingProfessionalsDays.Professionals asc

       

Drop Table #MissingByProf
Drop Table #MissingProfessionalsDays
Drop Table #MissingTimeDays

Access Denied Error when testing a data source connection in SSRS 2008.

$
0
0

We are running Reporting Services 2008 R2 on a Windows Server 2008 Standard 64-Bit server.  I have a user that has full access to Reporting Services at all folder levels but IS NOT a local administrator on the 2008 server.

This user can create data source connections but when he tries to test the connection by clicking on the 'Test Connection' button, he gets the following error "The permissions granted to user <username> are insufficient for performing this operation.

A user that has administrator priveleges on the server can test the connection fine. 

Any ideas?  I don't want to make this user an administrator on the server.  I have exhausted all google articles but nothing seems to have helped. 

This is an extract from the log file:

ibrary!ReportServer_0-24!3478!08/16/2011-13:45:37:: Call to TestConnectForDataSourceDefinitionAction().
library!ReportServer_0-24!3478!08/16/2011-13:45:37:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: , Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user <username> are insufficient for performing this operation.;
ui!ReportManager_0-23!32a0!08/16/2011-13:45:37:: e ERROR: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: The permissions granted to user 'HAD\skenne08' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user <username> are insufficient for performing this operation.
   at Microsoft.ReportingServices.WebServer.ReportingService2010Impl.TestConnectForDataSourceDefinition(DataSourceDefinition DataSourceDefinition, String UserName, String Password, String& ConnectError)
   at Microsoft.ReportingServices.WebServer.ReportingService2010.TestConnectForDataSourceDefinition(DataSourceDefinition DataSourceDefinition, String UserName, String Password, String& ConnectError)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.SqlServer.ReportingServices2010.ReportingService2010.TestConnectForDataSourceDefinition(DataSourceDefinition DataSourceDefinition, String UserName, String Password, String& ConnectError)
   at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.<>c__DisplayClass11b.<TestConnectForDataSourceDefinition>b__11a()
   at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SoapMethodWrapper`1.ExecuteMethod(Boolean setConnectionProtocol)
   at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.TestConnectForDataSourceDefinition(DataSourceDefinition dataSourceDefinition, String userName, String password, String& connectError)
   at Microsoft.ReportingServices.UI.DataSourceProperties.TestConnection(String& message)
   at Microsoft.Reporting.WebForms.TestConnectionControl.ValidateButton_Clicked(Object sender, EventArgs args)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--

 

Any suggestions are greatly appreciated.

Thanks


Formatting a parameter

$
0
0

Hi,

I use the following expression in a parameter =DateAdd("d",-1,Today())which give me yesterdays date, howver I do need the date to be displayed asdd/MM/yyyy. Is this possible to build into the expression?

Same applies to the =Today() parameter.

How to keep multiple data tables having fixed size data in the same page on runtime

$
0
0

I have a report where in I have a combination of matrix ,table data regions.

The problem what I am facing is that the data tables dont remain fixed in thier position and they tend to move down.

For e,g table 1 and table 2  are on the same page in design time side by side (right and left)however during the runtime the table1 is pushed down and table2 is at its position .

Now how can I keep them all fixed in thier same position. Most of the tables have fixed size rows  and some who have high size of rows have been put at the end .

What settings we can set?


Mudassar


Default Previous week sunday

$
0
0

Is it possible to show previous week Sunday date as default in Date Parameter in  Reports.

Thanks

V

Using Report Viewer 12 in Visual Studio

$
0
0

microsoft.reportviewer.design for Version 12 (2014)

The redistributable package is just that, and does not include this dll

So Visual Studio cannot create a V12 object.

The workaround is to use V11 and patch the inserted code.

Where can we download the design dll?


Ian Fry Fry Systems Pty Ltd Adelaide, Australia

IIF IsNothing Expression and check another condition?

$
0
0

Is it possible to use a IIF IsNothing expression and check another condition? For all the values that are blank, I want it to check another column if  "Disposition" = 2 then I want to show "Inactive"

=iif(isnothing(Fields!Value)," ","MS " & Fields!Value)


Expression to change All Caps to First letter uppercase and rest lowercase

$
0
0

Hi All,

The states in this report are all in caps TEXAS, CALIFORNIA, etc.. Is there a way to use expressions to only have the first letter in uppercase and rest in lowercase?

Oracle Database with Reporting Services

$
0
0

Dears,

we use a database oracle and store all stored procedures in packages. when using report services I can't deal with packages. if there is any way to open packages

Calling Oracle Stored Procedure

$
0
0

Hi all

        I am trying to call oracle stored procedure from SRSS 2005. I am using the syntax  { Call s_test_rcur()} .

I am getting following error.

Any suggestions???

Thanks in advance

Mvr

------------------------------

An error occurred while retrieving the parameters in the query.
ORA-00911: invalid character
ORA-06512: at "SYS.DBMS_UTILITY", line 68
ORA-06512: at line 1


------------------------------
ADDITIONAL INFORMATION:

ORA-00911: invalid character
ORA-06512: at "SYS.DBMS_UTILITY", line 68
ORA-06512: at line 1
 (System.Data.OracleClient)

Here is the Oracel stored proc.

TYPE rc_test ISREFCURSOR;

PROCEDURE s_test_rcur (
po_test_rc
OUT rc_test,-- returns a record set
po_error
OUTINTEGER
)
IS

BEGIN
g_err_level
:= 1;

OPEN po_test_rc FOR
SELECT a.ssn_id,
TO_CHAR
(a.acad_yr)|| TO_CHAR (a.acad_yr + 1) acad_yr,
RPAD
(NVL (last_name,' '), 30,' ') last_name,
RPAD
(NVL (first_name,' '), 30,' ') first_name,
NVL
(middle_initial,' ') middle_initial
from test_table
orderby last_name;

po_error
:= 0;
EXCEPTION
WHEN OTHERS
THEN
po_error
:=-1;
g_error_code
:=SQLCODE;
g_error_msg
:=
'Err level :'||
TO_CHAR
(g_err_level)||
' '||
SUBSTR
(SQLERRM, 1, 250);


END;

Trying to Connect 2 stores procedures in Report Builder

$
0
0

Hi

I have created two stored procedures.....

1) atmWonOpportunities_Users
2) atmWonOpportunities_Data (startdate and enddate parameters)

In (1) I created a filtered list of all user names associated with a certain business unit and saved it  to a temp table.

in (2) I create a filtered query listing all won opportunities during a period of time (date start and date end paramters)

In the report, I have 3 parameters, startdate, enddate and username (dropdown list).

When I run the report I select a startdate, enddate and username.
I click the View Report button and get the same results for any one of the usernames I pick which is wrong.

What could I have done wrong?


SSRS 2005 to SSRS 2012 - Error message displayed when report is exported to PDF or printed

$
0
0

We have existing SSRS 2005 report which has a sub-report with XML as the data source. The sub-report invokes a wcf web service and displays the result. In case the service is down, the sub-report displays an error at run-time as follows:

Error: Subreport could not be shown.

Since we want to publish this report, in SSRS 2005 we modified the colorproperty of the sub-report to white to hide the error message. This prevented the sub-report error message from appearing in the report and on PDF file when exported.

Now, we migrated this same report to SSRS2012. As expected, the error message is not appearing on screen in the report. But when we export the report to PDF, we can see the error message printed.

It looks like the sub-report Color property is not considered when exporting to PDF or printed.

Any suggestions?

SSRS Multi-Value Parameter Fed to Table Value Function

$
0
0

Hi, 

I have an SSRS report with several variables, some of which are multi-valued.  The main query that feeds the report uses some table value functions.  For example, the query looks something like this:

select tv1.a, tv1.b, tv2.x, tv2.y, tbl.m, tbl.n
from tableValueFunction1(@MultiValueParam) as tv1
inner join tableValueFunction2(@MultiValueParam) as tv2 on tv1.xxx = tv2.xxx
inner join regularTable as tbl on tv1.xxx = tbl.xxx
where tbl.abc in (@MultiValueParam)

When I try to run this, I get an error saying that I'm feeding the wrong number of parameters into the table value functions.  I've fed multi-valued parameters to stored procedures before and used a splitter function to split out the comma separated values, so I was planning to do the same thing in this scenario.  However, this is different.  When I look at the query in SQL Profiler, it shows discrete values for the multi value parameter.  For example, the same query above looks like this when viewed through the profiler (using 1,2,3 as my multi-value selection):

select tv1.a, tv1.b, tv2.x, tv3.y, tbl.m, tbl.n
from tableValueFunction1(1,2,3) as tv1
inner join tableValueFunction2(1,2,3) as tv2 on tv1.xxx = tv2.xxx
inner join regularTable as tbl on tv1.xxx = tbl.xxx
where tbl.abc in (1,2,3)

In other words, SSRS isn't converting the multi-value parameter to a comma separated string, like it normally does.  Any ideas on how to fix/work around this?

Thanks!
Chris


Users dropdown list

$
0
0

Hi

I have two stored procedures:

1) atmWonOpportunities_Users
2) atmWonOpportunities_Data (startdate, enddate, username parameters)

In (1) I created a filtered list of all user names associated with a certain business unit and saved it  to a temp table.
In (2) I create a filtered query listing all won opportunities during a period of time (date start and date end paramters)

When I run the report and select a user from the dropdown list, everything works just fine.

However I need to add an additional option to the dropdown box and configure it so that if the users clicks "All Users" from the dropdown all recs associated with all these users is displayed.

Can someone pls help me out with this?

I just don't know where to start.

Thanks





Position report in centre of browser AND export to A4 portrait PDF

$
0
0

Hi all

I know how to size my report to export successfully to A4 portrait PDF and I can position the report in the centre of the browser window BUT I can't do both! I would really like to be able to position it in the centre of my browser window AND be able to print to A4 portrait PDF. If I have the report in the centre (by adjusting the body to take up the whole screen and positioning the report in the centre), it is cut in half when exported to PDF. I can only get it to export to PDF correctly if the report is aligned to the left of my screen in the browser. Is there a way to move the body to the centre or any other tricks?

thanks again for help in this forum, Sally

Referencing SSRS variables set in Report Properties

$
0
0

I am modifying a report that sets this variable at the beginning of every dataset:

declare @current_minute int
set @current_minute = DATEPART(N, GETDATE()) % 3

My idea is to set this variable in the Report Properties instead.

When I do set this variable it in a Text Box or a Dataset, I get errors such as:

The expression used for the calculated field '=Variables!report_var.Value' includes a variable reference. Variable values cannot be used in calculated field expressions.
The Variable(report_var) expression for the report ‘body’ contains an error: [BC30451] Name 'N' is not declared.

What other strategies can I use to set a variable globally, instead of at the beginning of each dataset?

Thanks in advance


To err is human, to REALLY foul things up requires a computer

ReportViewer 10 and fixed column headers

$
0
0

My problem is specific to the ReportViewer control. The report displays correctly in every other way (ssrs server viewer, visual studio preview, visual studio 'Run', etc)

The aspx page hosting the control has two controls, the reportviewer control (assembly 10.0.0.0), and a scriptmanager control

asyncrendering = 'true' and processingmode = 'remote'

So the columns are not 'always visible' with the reportviewer but they are with every other renderer that i've tried.

The report i'm testing is just a simple table with a couple groupings (built using the wizard). To enable the fixed headers I went to the groupings view and changed the "FixedData" property of the first Static member to true per instructions I found here:

http://blogs.msdn.com/b/robertbruckner/archive/2008/10/13/repeat-header-and-visible-fixed-header-table.aspx

Tabular report but with vertical columns and values

$
0
0

Can we build a report like the one shown above .

Basically the columns will be on vertical columns and values of the columns will be next to it ?

I know there is matirx control but it is  for multiple columns .

In business objects we have separate control for this but in ssrs we have 1 table control and another matrix conrol.

I think i need to modify matrix control to achieve it


Mudassar

Matrix: percentage growth same period previous year

$
0
0

I'm trying to creating the following matrix in SSRS 2008R2 (with more product categories than shown here)

The matrix only shows the last two year per product.


                              

The matrix in the report builder looks like this:

For me it's unclear what the expression should be. (or perhaps I need to make a calculation in my TSQL?)

As Row Groups in the matrix I've got: Product; Year

As Column Groups i've got Month

I can't get it to work. Previous doesn't seem to work in this case (only when I got a total of each year (e.g. one column instead of 12))

Can someone please help me out?

I really need a solution for this, as I need to create this type of matrix more often.

Viewing all 10045 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>