Wednesday, March 21, 2012

Reporting Services - Variables/Parameters - Is this a bug?

When creating a Reporting Services report and declaring local variables as part of your query in a dataset there is sometimes a problem. When you hit run in the Data section and the “Define Query Parameters” box pops up, all the variables are not there. Sometimes when you go to properties (…) of that dataset the parameters are gone. Is this a bug? This is happening both in RS2000 and 2005.

Thanks

?

|||Anyone?|||

Not an expert in this area of the product, but i tried it briefly on my computer - local variables are recognized when you use the generic query designer (the default). They do not appear in the parameters (as they shouldn't). Parameters that are not local variables are automatically detected and shown in the parameters.

I couldn't emulate the behavior you describe. No matter how many times I opened/closed the report the parameters were correctly recognized and the local variables were preserved.

If you're using the graphical query designer, you may be running into some problems - that component rewrites queries and sometimes makes mistakes with more complicated query structures. Unfortunately, it is a standard component that we do not control. Recommendation is to try the generic query designer and see if the problem persists. There is a button on the data tab that lets you switch from using the graphical to using the generic query designer.

Hope that helps,

-Lukasz

|||

this is possibly related, and everytime i encounter it i get closer to having a nervous break down.. its very very annoying to say the least..

here's what i'm getting:

i have a report that gets data from a WebService.. webservice takes 6 parameters, all are primative datatypes.

i have a set of report parameters, and a set of dataset parameters that come from the report params.

i hit the execute button, fill in my values, it chugs along and give's me my expected results in the results grid.. perfect..

i edit my dataset query and put in an <ElementPath> so i can specify a particular table, hit execute and again i get my expected results..

if i do anything ie, edit the query, change to the layout window, then go back to the data window and hit refresh, the query blows up.. i edit my dataset and on the parameters tab, there's nothing.. all gone! wow.. i put all the parameters back in again, viewed the report source, copy and paste the block of code contained in the <DataSets> node to the notepad so i dont have to continually waste time re-entering the parameters..

this seems to happen whenever i click the refresh button.. i've tried to put it in generic query designer, and do it, but the UI seems to revert back to the graphical designer..

i've been dealing with it because most of my reports only took a parameter or two..

any ideas?

EDIT:

actually, i think it might be a problem if there is an error when you type in the parameters.. ie if i have a string param called strGuid, and it craps out the webservice when i cast the string to a guid (missed a char).. it seems to wipe out the dataset parameters..

|||

I've seen this many times, codemare & ruckazz

It will happen for one of the following reasons:

1. Your Query does not get parsed correctly i.e type error and you hit the properties button to go to parameters

2. You use a parameter that is not defined or you spelled incorrectly and go to parameters in properties

Use the Undo button (Ctrl-Z or Edit>Undo) and your parameters WILL be restored, do not save, find your flaw, fix it, save it, run it.

No comments:

Post a Comment