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

Sequence Of Activities

$
0
0

Hi Guys

I have a table as shown by 1in the picture bellow, i want to write an SQL query that will summarize it as shown in number 2. But instead the last three colums are showing duplicates while they where supose to show different activities as shown by 3, please assist me to modify the query.

The query is:

CREATE TABLE #Rabelani_DATA
(
	person_id uniqueidentifier default newid(),
	Name varchar(160),
	Gender varchar(160),
	DoB datetime,
	ActivityDate datetime,
	purchased uniqueidentifier,
	installed uniqueidentifier,
	maintainance1 uniqueidentifier,
	maintainance2 uniqueidentifier,
	maintainance3 uniqueidentifier,
)

INSERT INTO #Rabelani_DATA
SELECT DISTINCT person_id,
	Name,
	Gender,
	DoB,
	ActivityDateetime,
	Null,
	Null,
	Null,
	Null,
	Null
FROM PesonActivities	
-- Check purchased
Update #Rabelani_DATA
Set 
    #Rabelani_DATA.purchased = Table_purchased.activity_id
From (
  Select Table_purchased.person_id,
  Table_purchased.activity_id,
  Table_purchased.Activity
From PersonActivities Table_purchased
Where Table_purchased.Activity = 'purchased') As Table_purchased
Where Table_purchased.person_id =  #Rabelani_DATA.person_id

-- Check installed
Update #Rabelani_DATA
Set 
    #Rabelani_DATA.installed = Table_installed.activity_id
From (
  Select Table_installed.person_id,
  Table_installed.activity_id,
  Table_installed.Activity
From PersonActivities Table_installed
Where Table_installed.Activity = 'installed') As Table_installed
Where Table_installed.person_id =  #Rabelani_DATA.person_id

-- Check maintainance1
Update #Rabelani_DATA
Set 
    #Rabelani_DATA.maintainance1 = Table_maintainance1.activity_id
From (
  Select Table_maintainance1.person_id,
  Table_maintainance1.activity_id,
  Table_maintainance1.Activity
From PersonActivities Table_maintainance1
Where Table_maintainance1.Activity = 'maintainance1') As Table_maintainance1
Where Table_maintainance1.beneficiary_id =  #Rabelani_DATA.beneficiary_id

-- Check maintainance2
Update #Rabelani_DATA
Set 
    #Rabelani_DATA.maintainance2 = Table_maintainance2.activity_id
From (
  Select Table_maintainance2.person_id,
  Table_maintainance2.activity_id,
  Table_maintainance2.Activity
From PersonActivities Table_maintainance2
Where Table_maintainance2.Activity = 'maintainance2') As Table_maintainance2
Where Table_maintainance2.beneficiary_id =  #Rabelani_DATA.beneficiary_id

-- Check maintainance3
Update #Rabelani_DATA
Set 
    #Rabelani_DATA.maintainance3 = Table_maintainance2.activity_id
From (
  Select Table_maintainance3.person_id,
  Table_maintainance3.activity_id,
  Table_maintainance3.Activity
From PersonActivities Table_maintainance3
Where Table_maintainance3.Activity = 'maintainance3') As Table_maintainance3
Where Table_maintainance3.beneficiary_id =  #Rabelani_DATA.beneficiary_id

-- Result
SELECT * FROM #Rabelani_DATA
DROP TABLE #Rabelani_DATA

Please help


Rabelani Netshifhire




Grouping Mess!!

$
0
0

I am having difficulty trying to get 5 levels down.  Every time I attempt to add a group it goes to the far left instead of showing under the groups like they should.

How to customise and SSRS report field

$
0
0

I have a field in an SSRS Report and when I view the expression for that field I can see the following formula:

=Fields!FieldX.Value

Is it possible to edit this so that it only displays this value if another field has a certain criteria?

ie 

=Fields!FieldX.Value   only if FieldY = xxxx

Not include last billing period's cancel date and register date

$
0
0

I would like to get all active members or cancel members who's firstRegDate and CancelDate NOT in the last billing period, which mean I want to get id 1,2,3,4,6.

Table set up:
CREATE TABLE [dbo].[temp](
[id] [int] NULL,
[firstRegDate] [date] NULL,
[CancelDate] [date] NULL,
[Status] [char](1) NULL
) ON [PRIMARY]

  insert into dbo.temp 

 values(1, '2018-09-23', '2018-10-23', 'A'),
 (2, '2018-08-23', '2018-10-23', 'C'),
 (3, '2018-10-20', '2018-10-23', 'A'),
 (4, '2018-09-23', '2018-10-23', 'C'),
 (5, '2018-10-22', '2018-10-23', 'C'),
 (6, '2018-09-15', '2018-09-23', 'C')

select * from dbo.temp  
where (Status = 'A'
  OR (Status = 'C'     
    and CancelDate not BETWEEN DATEADD(mm, DATEDIFF(mm, 0, GETDATE())-1 , 0)  AND DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) , 0)
AND FirstRegDate not BETWEEN DATEADD(mm, DATEDIFF(mm, 0, GETDATE())-1 , 0)  AND DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) , 0)
--AND FirstRegDate < DATEADD(mm, DATEDIFF(mm, 0, GETDATE())-1 , 0) 
))

My query only get 1,3,6 how to correct it?

Thanks

SSRS report subscriptions email addresses

$
0
0

How is it possible to get the list of To and CC email addresses in the SSRS report subscriptions please?

Export report to excel and send the same by mail automatically

$
0
0
Is it possible to automate exporting report in excel and send via mail ?

Aniruddha http://aniruddhathengadi.blogspot.com/

Formatting integers to dates issue!!

$
0
0

How do I convert this integer into a string to show as "Filters(s): Reservation Date: 2018-11-01 - 2018-11-04" instead of what is shown?

Upgrading to SSRS 2016/2017

$
0
0

We are planning to upgrade from SSRS 2008 to 2016/2017. Please help with few question:

I have been reading a lot of blogs while researching about it and in my opinion its better to upgrade to 2016 as this being used widely and can be proved more stable?

Also , we will be upgrading the report viewer control as well as all the RDLs. Do we have to upgrade the report viewer or we can live with older report viewer but later SSRS version?

Could there be any impact of upgrading RDLs from 2008 Schema to 2016 Schema?

Any other points to be taken care of.

Thanks a lot for your help!!


Best Regards, Pragati



Using Multi-Valued Paramters with Data-Driven Subscriptions

$
0
0

I have researched this question and so far have found very different opinions as to how or if it is possible.

I have created 2 Data-driven subscriptions in SSRS. 1 for our sales persons and another for our managers reports. For the salespersons report, the solution works brilliantly as expected and I can appreciated the increased simplicitly for having 1 subscription to drive reports to a sales staff of over 100 folks.

One the other hand, I can't seem to grasp the significance of this type of solution for the Sales managers when they have multiple salespersons that report to them. Apparently, SSRS 2008 has provided no practical solution for this scenario that would be easily implemented in a Data driven subscription.

Since I can't find a way to pass in muliple integer values that represent each of the salesreps for a single manager, I am stuck with potentially sending multiple reports for each of the Sales Reps residing under a single manager. Not very elegant or useful as I'd hoped for using Data driven subscriptions. I have even changed the parameter datatype to string and used something like:

paramSalesPeople =substring((SELECT(', '+CAST(territoryid ASVARCHAR(2000)))

 

FROM Reports..SalesForce t2

 

 

WHERE t1.SalesManagerID = t2.SalesManagerID

 

 

ORDERBY SalesManagerID

 

 

FORXMLPATH('')), 3, 1000 )

to create a comma-delimited list of values for the parameters in effort of generating 1 (ONE) record per Manager. But the Data Driven Subscription fails miserably.

So the question, Is it or is it not possible to have multiple values passed as a single parameter to a data driven subscription to consolidate the number of required reports into one. If not, it would seem that it should be possible since it can be done from the reports parameters drop-down menu.

I have read someones recommendation to script the multi-valued parameter which seems to defeat the intent of the term "Data Driven' Subscription if I have to hard-code this logic into a script.

Can someone please provide me with a cut and dried statement as to what the options are from a Data driven perspective. If it's not possible then it's simply is what it is and I can put this controversial topic (for me) to rest.

Thanks

 

 

DATEADD working days?

$
0
0

Hello, 

I am trying to do a formula to add 2 working days to a date field. 

I don't even know where to start so does anyone have a suggestion of what I can try? 

I did try and look it up on the internet but cannot find anything that makes sense to me. 

Many thanks, 

SSRS Subreport

$
0
0

I have a main report that shows employees with their total billed time, and a sub report that shows the top3 clients for each employee, but I'm not sure where/how to place the sub report in the main so that it shows the top3 for each employee. Currently I have in in a row within the main grouping, but the sub report only shows after all employees, instead of after each employee

Thanks in advance

Bob

Error when setting multi-value parameters with like operator

$
0
0

Hello, below my parameter dataset is returning the current values in the drop down:

 ALL

 NULL

Closed

Open

This so far is correct. My report runs fine when filter by 1 value. However, when selecting more than 1 value I get an error that says something like: "Dataset failed, incorrect value near ",".

Below are my configurations. Any help would be greatly appreciated!

Main Dataset:

Select Activity_status,fromSP_HS_Lists_Activity_Trackerwhere(' All'IN(@Activity_status)ORIsNull(Activity_status,' NULL')in(@Activity_status) ORActivity_statuslike'%'+(@Activity_status)+'%')

Paramater Dataset:

Select DistinctActivity_StatusfromSP_HS_Lists_Activity_TrackerwhereActivity_Statusisnotnull

union

select ' ALL'asActivity_Status

union

Select top1IsNull(Activity_Status,' NULL')fromSP_HS_Lists_Activity_TrackerwhereActivity_StatusisnullOrderbyActivity_Status

Activity_status Parameter configuration:



SSL Redirect for SSRS 2012

Size Limit for Dataset Query in Report Designer

$
0
0
I was working on the SSRS Report Designer and was trying to copy and paste a huge SQL query from SQL Management Studio (like I always do) to the dataset window.

This method usually works, but for this extremely long SQL query with nested SELECTs and JOINs, it seems as though the Report Designer dataset query window limits the number of characters including carriage returns I can input in it.

When I paste my SQL query from
SQL Management Studio, it seems to paste only three quarters of the query, and thereafter I am not able to manually key in anything else or even make a line feed in the dataset query window.

Is there a limit to the number of characters I can key in here ? If so, is there any workarounds or configurations I can try ?

Kenny

Limit no of columns in SSRS matrix report

$
0
0

I have designed the matrix report(SSRS 2008) which has dynamic column, it grows based on the no of products in the table.

Database table structure looks like below.    

Productname AssetClass Marketvalue
Product1AEQ1000
Product1IEQ2000
Product1Prop3000
Product2AEQ1000
Product2IEQ2000
Product2Prop3000
Product3AEQ1000
Product3IEQ2000
Product3Prop3000
Product4AEQ1000
Product4IEQ2000
Product4Prop3000

    

The matrix report displays like below. Column grows based on no of products in the table.   I have applied column grouping for Products and row grouping for assetclass.

 Product1Product2Product3Product4
AEQ1000100010001000
IEQ2000200020002000
Prop3000300030003000

But I want to break the matrix columns to display 2 proudcts wise like below..

 

 Product1Product2
AEQ10001000
IEQ20002000
Prop30003000
   
 Product3Product4
AEQ10001000
IEQ20002000
Prop30003000

Is it  possible to apply column break in matrix report?

Thanks,
Ramesh



How to count columns in a single query?

$
0
0

Hello, I could use some help..

I have a table (from PBX) that shows the agent name and if they took an inbound or made an outbound phone call. In this case the column "Inbound" is simply a bit field:

Agent   inbound 

Bob          1 

Peter        0

Paul         1

Bob         0

Peter       0

I am looking to get a query that would show:

Agent    Inbound     Outbound

Bob          1              1

Peter        0              2

Paul         1              0

 Thanks for any help!


SSRS 2008 R2 - Cascading parameters not refreshed on changing parent parameter values.

$
0
0

I have three parameters. First is dropdown and other two are start date and end date. Start date and End date is depends on first parameter. And I also want to show date picker for date parameters. So i can't give available vaules to date parameters. Because if i give available values to date parameter then it will show dropdown instead of datepicker. So the problem is only first time date parameter value is changed. After that if i select another value from first parameter , it will not refresh other parameter (date parameter) values. I tried with creating datasets which is depend on first parameter then also it is not working. So please help in solving this issue.

I have SSRS 2008 R2 installed in my pc.

Report Builder - Date parameter

$
0
0

Hi,

I'm trying to set the date parameter (YMD) to a default value. I wan't the value to be the year and month i'm in.

This is what i have in my expression right now: [Date].[Date YMD].[Year].&[2018].

So when you open a report I want it to set the date parameter to the year and month I'm in right now. 

I'm using the SQL Service Report Builder 2016. 

Thanks in advance!


SSRS 2012 / Reports With Charts / Generic Error in GDI +

$
0
0

I'm running a Windows 2012 Server virtual machine with SSRS 2012 installed.  I develop SSRS reports which include charts in Visual Studio 2012 using BIDS 2012.  When previewing the reports locally, the charts appear without issue.  I then deployed my reports to my SSRS 2012 server and the charts do not appear and are replaced by the image placeholder (indicating a missing image).


After perusing the SSRS log files, I found this exception:


ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: , Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: A generic error occurred in GDI+. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
   at System.Drawing.Image.Save(Stream stream, ImageFormat format)
   at Microsoft.Reporting.Chart.WebForms.Chart.Save(Stream imageStream, ChartImageFormat format)
   at Microsoft.ReportingServices.OnDemandReportRendering.ChartMapper.GetImage(ImageType imageType)
   --- End of inner exception stack trace ---;


I've done some searching regarding the above exception and I haven't found a solution nor do I have a clear idea of why the exception is thrown.  I've found a handful of possibilities:

1. gdiplus.dll (Graphic Display Interface) needs to be updated

I've ensured that my server is up-to-date with the latest and greatest. gdiplus.dll on my server is currently version 6.2.9200.16518.  This doesn't seem to apply to my situation.

2. Ensure write permissions on the "folder to which SSRS caches the charts"

Well, firstly, I have not found a single article on the net as to where this folder is; however, I tested this locally on the server while logged in as Administrator with full privileges.  This doesn't seem to apply to my situation either.

3. SQL Server 2012 Cumulative Update Package 1

Apparently a similar issue was addressed in this package, and I've confirmed that my server was equipped with SQL Server 2012 Service Pack 1 (which is newer than Cumulative Update Package 1.  Again, this doesn't seem to apply to my situation.

I hypothesize that this issue is related to a display driver (or lack thereof) with regard to my server being a Virtual Machine.  Has anyone experienced this issue or can confirm that charts will not render when hosted on a Windows Server 2012 Virtual Machine running SSRS 2012?


Edit

In a last ditch effort, I stumbled upon an article which indicates that there is a newer version of gdiplus.dll.  My server is currently 6.2.9200.16518 and according to the NET, the latest version is 6.2.9200.20655.  MSDN article 2823372 contains a hotfix which seems to include this latest version.  I'll report back with my findings once installed.


Edit

Updated gdiplus.dll from version 6.2.9200.16518 to 6.2.9200.20655 by downloading hotfix from Microsoft Download Center (search for KB2823372) then restarted server and now charts are successfully rendering.

print in multiple columns in rdlc report

$
0
0

hello and sorry for my bad english :)
am trying to display and print a simple report , for example am requesting from my database this query
"Select Name from Customers"
in my report i have try 2 different cases to display the results.
Case #1 : am using table and then am accociating the column with the field name as describe above.
If i run the form my data are display very well in a series of pages BUT i would like to display that data in multiple columns ,for example now the results are display like shown below
STELIOS
GEORGE
JONNY
JENNY
..
..

the way i would to display them is like this but i could not found any sample or any post in internet.
STELIOS      JENNY            MARY        
GEORGE      MICHALIS       MARIOS
JONNY         ANDREAS       ect....
----------------------------------------------------------------------------------------------------------------------------------------
Case # 2 Instead of trying to use a table in the rdlc report i try also the List.. but again the results are display as a series in pages with only one column

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please can some one tell me if there is any way to do that? how to accomplish my scope?
Am appreciating your time to read it. any suggestions or solutions appreciated




stelios ----------

Viewing all 10045 articles
Browse latest View live


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