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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering more than once with RAS/COM.

Status
Not open for further replies.

rabbit65

Programmer
Jan 31, 2004
15
US
I have a report that is rather large and I am trying to produce PDFs based on various record filters that affect more than one field.

I designed the report so that it returns all the records and open it using the ras/com models in an asp page. I can get the filter to apply for the first criteria but when I modify the filter again it returns with no records in the report, almost as if it *added* the filter to the exitsing one instead of replacing it.

Here is the filter code:

dim filter
Set filter = clientDoc.DataDefinition.RecordFilter.clone(true)

'loop through rs to get each PMs initials to filter the report
while not rs.eof
filter.FreeEditingText="trim({sp_Projects_w_Workelements_and_SpendPlans;1.PM})=""" & rs.fields("initials").value & """"
clientDoc.DataDefController.RecordFilterController.modify filter
call clientDoc.PrintOutputController.Export(5).Save("c:\mycustomer\projects\pm\" & rs.fields("initials").value & ".pdf", True)
rs.movenext
wend

Interestingly enough this same code works if I filter on the groups but I have report totals that still showed the entire report's totals when displaying just the one group's effected by the filter.

I've looked at clientDoc.DataDefinition.RecordFilter.FreeEditingText after modifying the filter and it still contains the text. The docs state that if the text is parsed into the filteritems collection correctly this property will be blank but again the first filter works :)

Since I am going to use this same code in the asp page to filter different fields I do not think using paramters will work for me.

I have also tried opening the report and logging in to the db for each criteria (the report has saved data) for each criteria which works but takes a very very long time to run.

any ideas?

Thanks in advance,

Jeff Becker
beckerj@bellatlantic.net
 
Jeff,

I can only confirm that at least with the RDC in versions 8.5 & 9 a similar process works perfectly.

I suggest you submit an issue to Crystal's tech support via e-mail.

Also, feel free to e-mail me the report with saved data and I'll run a similar process to see if I can replicate the problem with my code.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I tried to create a simpler example to send to you bc of the proprietary info in these reports but when I did it worked perfectly :)

Time to start elemenating things one by one

The simple example:
single table select
no grouping or formulas

The Problem Child:
Stored Proc
1 grouping with code to continue headers etc.
tons of formulas.

I'll get to the bottom eventually:)

Thanks for your help

JB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top