Parameters & Datasets
I am trying to integrate 4 reports into one... The report displays the same columns & data, The reason we have 4 reports is each report has a individual view as a Dataset.. the purpose is to get data quarterly like 3,6,9,12... My question is if there`s a way i can have these 4 views in one report and may be the user will select the view via a parameter?? Can someone help me?FM
October 13th, 2011 5:20pm

The answer is most probably yes there is a way to do it, depending on exactly what you intend to do. I cannot see the data, so it is difficult to see exactly what you mean. What exactly is the difference between each of the four reports? Is each one for a different quarter? Like one for month 3, another month 6 etc? You might want to consider two things: Using Parameters like selecting which year or quarter the user wants reported Creating new period coluns in the data like: SELECT etc, etc ,Year(DateField) AS Year CASE WHEN Month(DateField) BETWEEN 1 and 3 THEN 1 etc, etc END AS Qtr etc, ect http://msdn.microsoft.com/en-us/library/ms181765.aspx http://msdn.microsoft.com/en-US/library/ms178770(v=SQL.90).aspx A mixture of parameters and creating your own accounting periods should help. PG A bit of experimentation by trial and error often helps get round problems.
Free Windows Admin Tool Kit Click here and download it now
October 13th, 2011 6:13pm

Hi Patrick , So each dataset is a view which is select sales,territory,workorder,date from vw_quarterone... the quarter one(jan-march) and so on... Instead of may be have a stored procedure for the year round....I am not sure why the use of views... FM
October 13th, 2011 6:47pm

As far as I can see there is no facility to use a parameter to change the dataset for a table or chart. So you may need to stand back and address the issue another way. Why are there different views for each report? (That could the key to real problem here..) The date field - is that the date of a transaction ? e.g. 12/10/2011. Or does it represent a period like Q1 or Q1-2011 ? Do all reports use the same view? Or does each report have a separate view? A view is created for several reasons. Such as to simplify a complex query which may roll up and summarise underlying data - or to prevent people having access to some data for security reasons. Sometimes it may be better to use a stored procedure because it can be developed to use parameters. In some ways, a stored procedure is preferable to a view for a report. If the 4 reports need to be integrated - that is an easy thing to say but its not very clear what needs to be integrated. Such as: Do you want to integrate the four views into a single query? You could do this if you use UNION in the reports Query Design SQL. That would make the report much simpler in many ways. You could then use parameters to report whatever Years or Quarters you want. Do you want to integrate by reworking the whole thing into a brand new report which may mean changing the source data as well? It does look like you might be better off with a stored procedure than a view as a data source. It may better to have a stored procedure which uses a to and from date which returns the data items you report in all of the views. http://msdn.microsoft.com/en-us/library/ms190782.aspx http://msdn.microsoft.com/en-us/library/ms181765.aspx PG A bit of experimentation by trial and error often helps get round problems.
Free Windows Admin Tool Kit Click here and download it now
October 13th, 2011 8:17pm

Hi Patrick, I assumed having an individual view for each quarter would be the main prob however i have checked with DBA and other Analysts and they said thats how its been company wide.. I also found that the same view is used on all 3 reports just i think a date range parameter would resolve the prob. The date feild represent the date of transaction.FM
October 14th, 2011 12:14am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics