Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR dynamic output

Status
Not open for further replies.

flopo

Programmer
Nov 22, 2010
9
AT
Hi guys,

I have to output the results of a sproc that returns a variable number of cols depending on one param.
My initial thought was to develop a subreport for each value of the decisive param... and to suppress them as i need.
This is one unpleasent solution...
Is there another way? Can I access somehow the api that actually builds a report using wizard procedure (the one that builds your report automaticaly, you just have to specify the source/command)

10x
Florin POP
 
Can you explain a bit more about how the parameter is set up in the sproc? Does it return an array of fields? Can you give examples of the fields that might be returned depending upon the parm?

-LB
 
yes.
for instance
?reporttype='cardoverview' then the output is
UserID/CardType/CardNo/Balance
?reporttype='accountoverview' then the output is
UserID/AccountType/AccountNo/IBAN/Balance

so some columns are the same, other are equivalents and other are in plus... I have this situation for nine cases (reporttypes). My question is if I can display column in CR conditionaly (eg: IBAN should be between Balance and accountNo)

in the sproc is like :
case reporttype='...' then select...
and so on...(9 cases)
the output is always a recordset (but the fields are different in name and also the number of them, depending on report type parameter passed to the sproc)

Hope you understood what I mean
BR, Florin
 
I am hampered by not having experience with stored procedures. It seems like the problem is that the sproc ONLY returns selected fields. If there is a way to get the fields into an array, you could possibly adapt the solution in thread149-655589 (which doesn't use arrays, but could), but I'm not sure how you could even do that if the fields are not brought into the dataset to begin with.

If there was a way of eliminating the parameter in the sproc, you could recreate it within CR, and then you would be able to move forward with the dynamic column approach. Otherwise, you might be stuck with the subreport approach, although maybe someone else with sproc experience has another solution.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top