Showing posts with label query. Show all posts
Showing posts with label query. Show all posts

Monday, March 26, 2012

RS2k5: Sum(field,scope?) problem

Hello,

I have problem with aggregation methods in RS 2005. I have a query thar returns data set:

Department, Storage, Article, Invoice, Quantity, Value, ValueX
3,1,'Art A','Inv 1',2,30,5
3,1,'Art B','Inv 1',4,40,7

3,1,'Art A','Inv 2',1,15,5
3,1,'Art B','Inv 2',2,20,7

3,2,'Art A','Inv 3',1,18,3

3,2,'Art B','Inv 3',2,16,4

ValueX - this is value returned by UDF. It is unique for every "Article & Storage group".

In RS my report looks like this:

(grpDepartment) Department, Sum(Quantity), Sum(Value), Sum(ValueX, scope?)

(grpStorage)+Storage, Sum(Quantity), Sum(Value), Sum(ValueX, scope?)
(grpArticle)++Article, Sum(Quantity), Sum(Value), ValueX
(detInvoice)+++Invoice, Quantity, Value

And the data looks like this:

(grpDepartment) 3, 12, 139, 31(24+7) <- should be 19(12+7)

(grpStorage)1, 9, 105, 24(10+14) <- should be 12(5+7)
(grpArticle) ”Art A”, 3, 45, 10 <- should be 5
(detInvoice) ”Inv 1”, 2, 30

”Inv 2”, 1, 15

(grpArticle) ”Art B”, 6, 60, 14 <- should be 7

”Inv 1”, 4, 40

”Inv 2”, 2, 20

(grpStorage) 2, 3, 34, 7(3+4)

(grpArticle) ”Art A”, 1, 18, 3

”Inv 3”, 1, 18

(grpArticle) ”Art B”, 2, 16, 4

”Inv 3”, 2, 16

The Sum() error is because I sum ValueX from details, and I should sum it from "grpArticle". Unfortunately I cannot. I've tried using "scope" but without effect.

I've appreciate any help in this.

Maciej

There is an error:

Grpup "grpArticle" definition looks like this:

(grpArticle) ++Article, Sum(Quantity), Sum(Value), ValueX

So of course in this section I get correct values of "ValueX", but in other sections where I use Sum(), I get errors like this:

(grpStorage) 1, 9, 105, 24(10+14) <- should be 12(5+7), it sumarizes ValueX for every row in grpStorage...
(grpArticle) ”Art A”, 3, 45, 5
(detInvoice) ”Inv 1”, 2, 30

”Inv 2”, 1, 15

(grpArticle) ”Art B”, 6, 60, 7

”Inv 1”, 4, 40

”Inv 2”, 2, 20

I've tried to use Sum(ValueX,"grpArticle") but I can use it only in "details" and "grpArticles". In "upper" groups ("grpStorage" and "grpDepartment") it generates error.

Any help in here ? :|

|||It appears that this, rather simple task for i.e. Crystal Reports, is impossible for this release of Reporting Services... |||As a suggestion try =Sum(Distinct(ValueX))|||

If you are using SQL 2005 as your data source then I think I've found a pretty good solution. If you're not using 2005 then you'll have to find a different query to achieve what I propose.

Seeing as the ValueX column is dependant only on the storage and article columns, when multiple invoices appear within this combination ValueX is repeated and hence counted multiple times (twice in your example). So if you eliminate the duplicates and only return a value for the first occurance of each storage and article combination, the sum of the column will be correct.

I use the SQL 2005 ROW_NUMBER() aggregation function to number the rows within each group and use a CASE statement to return ValueX in where the row number is 1 and 0 otherwise i.e.

SELECT Department
, Storage
, Article
, Invoice
, Quantity
, Value
, ValueX
, ValueX2 = CASE ROW_NUMBER() OVER
( PARTITION BY Storage, Article
ORDER BY Storage, Article)
WHEN 1
THEN ValueX
ELSE 0
END
FROM articles

Then the result set looks like this

Department

Storage

Article

Invoice

Quantity

Value

ValueX

ValueX2

3

1

Art A

Inv 2

1

15

5

5

3

1

Art A

Inv 1

2

30

5

0

3

1

Art B

Inv 1

4

40

7

7

3

1

Art B

Inv 2

2

20

7

0

3

2

Art A

Inv 3

1

18

3

3

3

2

Art B

Inv 3

2

16

4

4

Then at the grpArticle level use =Max(Fileds!ValueX2.Value) as the expression and the result lokks like this:

Quantity

Value

Value X

Value X2

3

12

139

31

19

1

9

105

24

12

Art A

3

45

5

5

Inv 2

1

15

Inv 1

2

30

Art B

6

60

7

7

Inv 1

4

40

Inv 2

2

20

2

3

34

7

7

Art A

1

18

3

3

Inv 3

1

18

Art B

2

16

4

4

Inv 3

2

16

|||

Thanks for reply. I did it in different way. In my query I divide each ValueX by the number of invoices . (I've added UDF that count this). Your solution is better because there won't be any calculation errors with rounding and so...

Other thing is that RS can't do it by itself. In both cases I have to modify my query to solve the problem because my reporting solution can’t do stupid summarizing . I think Microsoft should quickly add some features to create some more advanced aggregation and global (for report instance) variables that can be accessed and modified from report code (like in Crystal Reports)...

Thanks anyway

Maciej

|||I agree, but in all honesty I don't see queries that generate datasets for reports as reusable queries hence I prefer to do a lot of the logic in the source query. I tend to wrap the report queries up in views that include sort order columns, even some formatting logic etc. then I set up my report to use the columns from my query rather than embedding lots of conditional logic in the various properties in the report. Once the report is deployed I can make a lot of minor changes just by updating the source view rather than having to modify and redeploy the report.

Tuesday, March 20, 2012

RS-2000 Report Manager time out(?)

I have a query that takes about 2 minutes to complete, but Report Manager displays the Web Page Cannot be Found message at precisely 1 minute after submitting. I'm assuming that this is a time limit that is set somewhere. Is there a setting I can change, either in IIS or in Reporting Services, to extend this time limit? I have looked and whatever I have changed doesn't seem to make any difference?

Thanks,

Al

There are settings on both individual reports and on the server as a whole.

You can get to the system wide settings by going to 'Site Settings' in Report Manager.

Individual reports can be changed by going to the report properties, then 'Execution' within Report Manager.

Regards

Paul

RS2000 dataset doubt

Hi,
I have 2 datasets. The query in the first dataset is executed and it gives the values to the report parameters. The 2nd dataset uses these parameters to execute the query and then get the data.

The problem is if the first query returns no data, then the report parameters are blank. When I see the preview of the report, it gives me an error saying
"One or more parameters required to run the report have not been specified".
What I want is, if the first query doesn't return any data, then the 2nd query should not be executed.

Can someone please guide me in achieving this?

Regards,
Asim.Rather than not executing the second query, perhaps you could try returning a default value if no rows are returned from the stored procedure?

RS.EXE parameters not working

Hi Everyone,

I am having a problem with the RS utility not recognizing my query parameters that I am passing to my timed subscription. I have set up my report with a "WorkOrder" parameter. I have created a trigger that causes my subscription to fire, and that trigger passes in the workorder number to the utility. The subscription fires successfully, but I am getting a blank report.

I set the parameter value to "can be blank" so that I could create my subscription w/o an error. I know that my subscription id is correct when I use the fire method, because I DO get the appropriate report.

I am also having the same problem when I actually log in to the report server and execute the utility from the command line. I believe my report is good. Once the report is generated, I am able to follow my URL, plug in the workorder id, and it works.

What would cause the variable not to be passed in/recognized? This is how I am calling it from the command line:

rs -i C:\ReportingServices\asbuilts.rss -v WorkOrder="10610" -s http://(servername)/ReportServer

Thanks!

Wanda

Wanda,

Here's an example of my command line:

rs -i BOPReportPublisher.rss -s http://myserver/reportserver -v reportFolder=Reports

I place my server first and pass parameter in without quotes.

I hope this helps.

Ham

|||

Thanks, Ham, for responding, but that did not work. I also tried it WITH the quotes in the order you specified, but no luck.

I'm really banging my head on this one...

Any more suggestions?

Wanda

|||Can you post your script code so we can take a look?|||

Wanda,

Also note, that the parameter variables are case sensitive, I just thought I would say that.

Ham

|||

Here is the trigger:

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

-- =============================================

-- Author: Wanda Wilburn

-- Create date: 12/15/2006

-- Description: Automatically generate SQL Reports based on completion dates entered

-- =============================================

ALTER TRIGGER [azteca].[tPostCompletionDates] ON [azteca].[WOTASK]

FOR UPDATE

AS

DECLARE @.command VARCHAR(100)

DECLARE @.task VARCHAR(20)

DECLARE @.wo VARCHAR(20)

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

--IF @.@.ROWCOUNT = 0 RETURN

IF UPDATE (actfinishdate)

Begin

SET @.task = (SELECT taskname FROM INSERTED)

SET @.wo = (SELECT workorderid FROM INSERTED)

IF @.task = 'AsBuilts Rec/Approve'

SET @.command = 'rs.exe -i C:\ReportingServices\asbuilts.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

--SET @.command = 'rs.exe -i C:\ReportingServices\asbuilts.rss -v Workorder=10610 -s http://myserver/ReportServer'

IF @.task = 'ManholeCoat Timeline'

SET @.command = 'rs.exe -i C:\ReportingServices\coatsys.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'CostConstrucTimeline'

SET @.command = 'rs.exe -i C:\ReportingServices\costcon.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'FireProtection Avail'

SET @.command = 'rs.exe -i C:\ReportingServices\firepro.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = '1-Yr Inspect Process'

SET @.command = 'rs.exe -i C:\ReportingServices\release.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'Sewer Complete'

SET @.command = 'rs.exe -i C:\ReportingServices\sewerap.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'VideoInspectTimeline'

SET @.command = 'rs.exe -i C:\ReportingServices\videoin.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

End

IF UPDATE(actstartdate)

Begin

SET @.task = (SELECT taskname FROM INSERTED)

SET @.wo = (SELECT workorderid FROM INSERTED)

IF @.task = 'Acceptance Letter'

SET @.command = 'rs.exe -i C:\ReportingServices\yr1war.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'Slug/Disinfect Line'

SET @.command = 'rs.exe -i C:\ReportingServices\slugln.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = '60 Days Confirmation'

SET @.command = 'rs.exe -i C:\ReportingServices\begin60.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = 'PreCon Meeting'

SET @.command = 'rs.exe -i C:\ReportingServices\precon.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

IF @.task = '1-Yr Correspondence'

SET @.command = 'rs.exe -i C:\ReportingServices\inspect.rss -v WorkOrder="' + @.wo + '" -s http://myserver/ReportServer'

End

EXEC [myserver].[master].[dbo].[xp_cmdshell] @.command

-- Insert statements for trigger here

END

(Note...once again...I have tried this from the command line of the actual report server/changing order of parameters & variables/single-double-no quotes)

The following is the code for the asbuilts.rss file...

Sub Main()

rs.Fireevent("TimedSubscription",baf15621-f564-4774-8e4e-76bd94af1f33")

End Sub

Yes, I am aware of the case-sensitivity, and I have double-triple checked this.

Thanks for all of your help...

Wanda

|||

Wanda,

I do not see the reference for the "workorder" variable in your example of "asbuilts.rss". Is this the complete code?

Ham.

|||

This is it. The subscription for the report contains the variable field. The command line that gets generated from the trigger should fire the subscription with the workorder variable. The rss file is only telling which subscription to fire. Am I missing something that should be included in the rss file (i.e. parameter)?

EXEC [reportservername].[master].[dbo].[xp_cmdshell] @.command

|||

Wanda,

I believe what you need is to setSubscriptionProperties

public void SetSubscriptionProperties (
string SubscriptionID,
ExtensionSettings ExtensionSettings,
string Description,
string EventType,
string MatchData,
ParameterValue[] Parameters
)

You can pass your WorkOrder value in the Parameter value and then use rs.fireevent to launch your subscription.

Ham

|||

Would this code be included in the RSS code, the trigger, or the report?

Wanda

|||

Wanda,

This will be in the RSS code. I have given you a link that should tell you what you need to move forward.

http://msdn2.microsoft.com/en-us/library/aa225857(SQL.80).aspx

Ham

|||Hammer2 is correct. When you run the subscription it is using the parameter values that have been stored previously. If you want to use new parameter values you would have to call SetSubscriptionProperties first. Of course this does not guarantee that somebody else will set the parameter values after you do. There is now way to say run a subscription with these parameters.|||

Ok, I will try this, and I will let you know the results. I guess I assumed that this was being done automatically by the rs.exe and that the code existed to do this if a -v switch/data was passed in.

Thanks. Wanda

|||

Can you give me an example of the call to this method?

I'm assuming you are saying that the "v" parameter that is used in the rs.exe passes the parameter to the .rss file, which, in turn, must call the SetSubscriptionProperties method using that data, correct?

I've tried to find examples but I can't find any.

Thanks! Wanda

|||

Wanda,

I do not have an example on hand, I can get you a reference to a very similar process and you can modified it to your needs. Let me know if this works for you.

http://msdn2.microsoft.com/ru-ru/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.listsubscriptions.aspx

Ham

Friday, March 9, 2012

RS PARAMETERS

I have a report with a Dataset that has a query string:
exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado, @.Agencia,@.Ruta
The report is working, but I want to delete the parameter @.Rute and the
follow error are displaying:
An error has occurred during report processing.
Query execution failed for dataset "resumen"
Must declare the variable @.Usuario.
Plese help me.
--
MauryqTwo things to try. Click on the refresh fields button (to the right of the
...). The other thing is to click on the ... and go to the parameters tab
and make sure all the expected parameters are there.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Mauryq" <mauryq@.hotmail.com> wrote in message
news:3F2DFA2A-C1B9-4219-8EB7-7C71487DF6EF@.microsoft.com...
> I have a report with a Dataset that has a query string:
> exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
@.Agencia,@.Ruta
> The report is working, but I want to delete the parameter @.Rute and the
> follow error are displaying:
> An error has occurred during report processing.
> Query execution failed for dataset "resumen"
> Must declare the variable @.Usuario.
> Plese help me.
> --
> Mauryq|||When you create a dataset with a SP with parameters, automatically the
parameters are created at the report, but in this case the parameters can't
be created automatically, and have that created it manually, and when I eject
the preview is like the parameter cant be recognized.
exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
@.Agencia,@.Ruta
"Bruce L-C [MVP]" escribió:
> Two things to try. Click on the refresh fields button (to the right of the
> ...). The other thing is to click on the ... and go to the parameters tab
> and make sure all the expected parameters are there.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Mauryq" <mauryq@.hotmail.com> wrote in message
> news:3F2DFA2A-C1B9-4219-8EB7-7C71487DF6EF@.microsoft.com...
> > I have a report with a Dataset that has a query string:
> >
> > exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
> @.Agencia,@.Ruta
> >
> > The report is working, but I want to delete the parameter @.Rute and the
> > follow error are displaying:
> >
> > An error has occurred during report processing.
> > Query execution failed for dataset "resumen"
> > Must declare the variable @.Usuario.
> >
> > Plese help me.
> >
> > --
> > Mauryq
>
>|||I have had mixed results with RS automatically creating the parameters.
Sometimes it messes up. Did you try either of the two things I mentioned?
What happens when you click on the ... and go to the parameters tab?
I have had some stored procedures in SQL Server (I work with both Sybase and
SQL Server) that worked flawlessly with RS creating the Report Parameter.
When you have an @.Paramname in your SQL what happens is that RS looks for a
matching Report Parameter. If it doesn't see it then it assumes that it is a
T-SQL variable. You can have a multi-line T-SQL code with declare
@.SOMEVARIABLE. So what is happening to you is that the wiring between your
query parameters and your report parameters has gotten messed up. It is
important to remember that they are two different things (which gets
confusing because RS is being helpful behind the scenes and creating Report
Parameters).
You need to do two things. You need to check the parameter mapping ( click
on the ... and go to the parameter tab and make sure the query parameters
you expect are all there and are mapped to the appropriate Report
Parameter). You can also from layout view go to the Report Menu, Parameters.
You should see
You say you want to get rid of @.Ruta query parameter. Then you should delete
it from your query calling code, make sure it is deleted from the query
parameter to report parameter mapping and finally that it is not still a
report parameter.
exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado, @.Agencia
Note that you can also be in generic query designer and leave off the exec:
sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado, @.Agencia
I never use the exec. See if that helps at all.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Mauryq" <mauryq@.hotmail.com> wrote in message
news:7DF27C6B-F720-46D7-A24F-54641DD96461@.microsoft.com...
> When you create a dataset with a SP with parameters, automatically the
> parameters are created at the report, but in this case the parameters
> can't
> be created automatically, and have that created it manually, and when I
> eject
> the preview is like the parameter cant be recognized.
> exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
> @.Agencia,@.Ruta
>
> "Bruce L-C [MVP]" escribió:
>> Two things to try. Click on the refresh fields button (to the right of
>> the
>> ...). The other thing is to click on the ... and go to the parameters
>> tab
>> and make sure all the expected parameters are there.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Mauryq" <mauryq@.hotmail.com> wrote in message
>> news:3F2DFA2A-C1B9-4219-8EB7-7C71487DF6EF@.microsoft.com...
>> > I have a report with a Dataset that has a query string:
>> >
>> > exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
>> @.Agencia,@.Ruta
>> >
>> > The report is working, but I want to delete the parameter @.Rute and the
>> > follow error are displaying:
>> >
>> > An error has occurred during report processing.
>> > Query execution failed for dataset "resumen"
>> > Must declare the variable @.Usuario.
>> >
>> > Plese help me.
>> >
>> > --
>> > Mauryq
>>|||Mauryq,
whenever get this type of error, I go back to the source and debug from
there.
You say you want to remove a param. Did you already do this on the SProc
itself? Try exec from QA on the SQL instance to ensure the problem isn't at
the source, and then work forwards onto the RS.
Tony
"Bruce L-C [MVP]" wrote:
> I have had mixed results with RS automatically creating the parameters.
> Sometimes it messes up. Did you try either of the two things I mentioned?
> What happens when you click on the ... and go to the parameters tab?
> I have had some stored procedures in SQL Server (I work with both Sybase and
> SQL Server) that worked flawlessly with RS creating the Report Parameter.
> When you have an @.Paramname in your SQL what happens is that RS looks for a
> matching Report Parameter. If it doesn't see it then it assumes that it is a
> T-SQL variable. You can have a multi-line T-SQL code with declare
> @.SOMEVARIABLE. So what is happening to you is that the wiring between your
> query parameters and your report parameters has gotten messed up. It is
> important to remember that they are two different things (which gets
> confusing because RS is being helpful behind the scenes and creating Report
> Parameters).
> You need to do two things. You need to check the parameter mapping ( click
> on the ... and go to the parameter tab and make sure the query parameters
> you expect are all there and are mapped to the appropriate Report
> Parameter). You can also from layout view go to the Report Menu, Parameters.
> You should see
> You say you want to get rid of @.Ruta query parameter. Then you should delete
> it from your query calling code, make sure it is deleted from the query
> parameter to report parameter mapping and finally that it is not still a
> report parameter.
> exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado, @.Agencia
> Note that you can also be in generic query designer and leave off the exec:
> sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado, @.Agencia
> I never use the exec. See if that helps at all.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Mauryq" <mauryq@.hotmail.com> wrote in message
> news:7DF27C6B-F720-46D7-A24F-54641DD96461@.microsoft.com...
> > When you create a dataset with a SP with parameters, automatically the
> > parameters are created at the report, but in this case the parameters
> > can't
> > be created automatically, and have that created it manually, and when I
> > eject
> > the preview is like the parameter cant be recognized.
> >
> > exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
> > @.Agencia,@.Ruta
> >
> >
> > "Bruce L-C [MVP]" escribió:
> >
> >> Two things to try. Click on the refresh fields button (to the right of
> >> the
> >> ...). The other thing is to click on the ... and go to the parameters
> >> tab
> >> and make sure all the expected parameters are there.
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "Mauryq" <mauryq@.hotmail.com> wrote in message
> >> news:3F2DFA2A-C1B9-4219-8EB7-7C71487DF6EF@.microsoft.com...
> >> > I have a report with a Dataset that has a query string:
> >> >
> >> > exec sp_ReporteFlashVentasXRutaYDiario @.Usuario, 1, @.Mercado,
> >> @.Agencia,@.Ruta
> >> >
> >> > The report is working, but I want to delete the parameter @.Rute and the
> >> > follow error are displaying:
> >> >
> >> > An error has occurred during report processing.
> >> > Query execution failed for dataset "resumen"
> >> > Must declare the variable @.Usuario.
> >> >
> >> > Plese help me.
> >> >
> >> > --
> >> > Mauryq
> >>
> >>
> >>
>
>

Wednesday, March 7, 2012

RS Integration with SharePoint 3.0 - Query with userid parameter

When integrating SQL Reporting Services 2005 with Sharepoint Services 3.0, and you have a SRS report that runs over a view with the UserID as a parameter (to filter the records the user has access to), will the SharePoint ReportViewer passover the UserID to RS and RS to SQL?

Sharepoint security with Reporting Services stops at Item level or does it impersontate down to SQL? Should authenticating be Integrated or SQL ? Should the userid in SQL be exact match with Sharepoint? Or are they mapped somewhere?

Thank You!!

Hi,

actually these are two different questions:

it depends how you implemented the authentication. If reports are called by Sharepoint, it is possible to use the information of the Windows Identity to authenticate against the SQL Server. As you are using a UserId approach and not the actual identity at the SQL Server level you could also use SQL Server authentication to run the query of the report. So the following options could be available:

[Report (UserId) -- IIS (Windows Integrated Authentication)] -- SQL Server (SQL Server Authentication with static credentials)


[Report (UserId) -- IIS (Windows Integrated Authentication)] -- SQL Server (Windows Authentication)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

RS Hidden parameter error

Hi,
We have a report with parameters which works fine but when we want to
recover a hidden parameter which comes from a query (doesn't appears as a
filter), an exception is thrown. In the report parameters properties, we left
in blank the property "Prompt" so that it is not showed as a filter. The
error is this: "An unexpected error occurred in Report Processing. Exception
of type Microsoft.ReportingServices.ReportProcessing.aw was thrown". [This
error is not given without the use of this parameter, of course].
Thanks in advance!I think you have to use a space instead of a blank.
--
Adrian M.
MCP
"Tomas Martinez" <TomasMartinez@.discussions.microsoft.com> wrote in message
news:D6E81616-1A0F-472C-8F6E-8F679BF2EB6A@.microsoft.com...
> Hi,
> We have a report with parameters which works fine but when we want to
> recover a hidden parameter which comes from a query (doesn't appears as a
> filter), an exception is thrown. In the report parameters properties, we
> left
> in blank the property "Prompt" so that it is not showed as a filter. The
> error is this: "An unexpected error occurred in Report Processing.
> Exception
> of type Microsoft.ReportingServices.ReportProcessing.aw was thrown". [This
> error is not given without the use of this parameter, of course].
> Thanks in advance!
>|||Thanks for your answer but it doesn't work. With a space the parameter
appears as a filter :(
Thanks anyway! :)|||Can you confirm that SP1 or SP2 of RS 2000 installed?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tomas Martinez" <TomasMartinez@.discussions.microsoft.com> wrote in message
news:E1365F37-81E9-4D48-9266-15D8DC4C0BA4@.microsoft.com...
> Thanks for your answer but it doesn't work. With a space the parameter
> appears as a filter :(
> Thanks anyway! :)
>|||Yes, SP1 of RS2000 is installed
"Robert Bruckner [MSFT]" wrote:
> Can you confirm that SP1 or SP2 of RS 2000 installed?
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Tomas Martinez" <TomasMartinez@.discussions.microsoft.com> wrote in message
> news:E1365F37-81E9-4D48-9266-15D8DC4C0BA4@.microsoft.com...
> >
> > Thanks for your answer but it doesn't work. With a space the parameter
> > appears as a filter :(
> >
> > Thanks anyway! :)
> >
>
>

Saturday, February 25, 2012

RS Does Not Recognize Temp Table Fields

I am using the generic query designer and have defined 2 temp tables as
follows:
DECLARE @.MainTable
DECLARE @.JoinTable
INSERT INTO @.MainTable
SELECT...
INSERT INTO @.JoinTable
SELECT...
SELECT FROM @.MainTable JOIN ON @.JoinTable...
My problem is the field list does not recognize all the fields; all the
original fields are in the @.MainTable but only the first 3 from the
@.JoinTable. I tried to add additional fields to the @.MainTable and they are
not recognized. I have tried the Field Refresh Button, manually adding
fields to the list and hacking the RDL field list. Each time I manually add,
I get an index out of bounds error when trying to run the report. If I then
hit the refresh button the fields I have manually added are removed'
Also, must the field names be unique among the temp tables? I assumed not
since they are in separate queries.
Many thanks for any helpFirst off, even if you get this to work it won't work for you. Let me
explain. What happens with using temp tables in the generic query designer
is the same thing that happens if you post the below code in query analyzer
and hit execute twice. The first time it will work, the second time it will
error out because the tables already exist. So even if this worked for you
in development when you deploy it the report would work the first time. If
the user click on refresh report it will die (I haven't done this in 2005
but I did try this out in 2000 and I doubt if this would have changed). The
reason is what is going on with connection pooling. Dropping the tables at
the end would probably not work either because it would probably do this
before RS is done with them.
I suggest creating a stored procedure. Do not drop the temp tables, just let
them fall out of scope. Have your select statement be the last statement.
I do this all the time (multiple temp tables, lots of inserts, updates, join
etc between them).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:uloHfFM7FHA.2692@.tk2msftngp13.phx.gbl...
>I am using the generic query designer and have defined 2 temp tables as
>follows:
> DECLARE @.MainTable
> DECLARE @.JoinTable
> INSERT INTO @.MainTable
> SELECT...
> INSERT INTO @.JoinTable
> SELECT...
> SELECT FROM @.MainTable JOIN ON @.JoinTable...
> My problem is the field list does not recognize all the fields; all the
> original fields are in the @.MainTable but only the first 3 from the
> @.JoinTable. I tried to add additional fields to the @.MainTable and they
> are not recognized. I have tried the Field Refresh Button, manually adding
> fields to the list and hacking the RDL field list. Each time I manually
> add, I get an index out of bounds error when trying to run the report. If
> I then hit the refresh button the fields I have manually added are
> removed'
> Also, must the field names be unique among the temp tables? I assumed not
> since they are in separate queries.
> Many thanks for any help
>|||Bruce
Many thanks for your prompt reply. I found my problem was a simple one where
I had not included all the new fields in all the select statements. Your
point is well taken though and the use of the temp tables was a last resort
because I could not get the original more straight-forward query to work. I
was getting redundant hits as a result of a subquery so had to use this
approach to get it working for a deadline.
Surprisingly this approach does work in the preview panel as well as
deployed to the web. However the query does not execute inside of the data
panel; it just dies without any errors. I assume this is what you are
referring to.
Many thanks for all your help up here!
Mike