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 reports

Status
Not open for further replies.

rabbit65

Programmer
Jan 31, 2004
15
US
I have a somewhat large report (v10, +600k with data saved) that I would like to open using RAS (v10 embedded Enterprise) and produce PDFs by filtering on one of 4 different fields.

I have something that works but it takes a considerable amount of time to run (over 2 hrs.) but when I apply the filters (record not group) in the report designer they appear to run much quicker

To open the "whole" report and refresh the rowsetcontroller takes about 6 minutes. I have the report options set to save the data with the report and I have created bursting indexes on the four fields I want to filter by.

I open the ReportClientDocument and call the DatabaseController.logon method. I then have four parameters set up two of which are passed to a M$ SQL Server storedprocedure and the other two are only used to display a report title.

I then apply a filter:
Set filter = clientDoc.DataDefinition.GroupFilter.clone(true)
filter.FreeEditingText="trim({sp_Projects_w_Workelements_and_SpendPlans;1.DE}) like """ & v(0,i) & """"

Finally, I apply the filter and export to the PDF.
clientDoc.DataDefController.RecordFilterController.modify filter
call clientDoc.PrintOutputController.Export(5).Save("c:\inetpub\ & replace(v(0,i),"*","_") & ".pdf", True)

The two areas where I think the delays are occuring are as follows.

1.) I read that changing parameters causes the report to refresh. The only paramters that are changing are the report titles which are not used to retrieve any data but I did try removing them and it was still just as slow.

2.) I found that I have to close the document each time after I apply the filter in order to apply a new filter. This is most likely the cause of the problem but when I apply the filter a second time without closing the doc it acts as if it's adding the criteria to the existing instead of replacing it or when I export it is saving the data with the report in it's filtered state. In either case I never explicitly call the save method of the clientdoc.

Any help would be greatly appreciated!

Jeff Becker
BeckerJ@bellatlantic.net
 
thought I should post all of the filtering code.

for i= 0 to ubound(v,2)
sTitle2="Actuals as of the " & sRunDate & " FIS load to WorkElement Explorer (" & v(1,i) & ")"
Set filter = clientDoc.DataDefinition.GroupFilter.clone(true)
filter.FreeEditingText="trim({sp_Projects_w_Workelements_and_SpendPlans;1.DE}) like """ & v(0,i) & """"
response.write filter.FreeEditingText& ".<P>"
clientDoc.DataDefController.RecordFilterController.modify filter
call clientDoc.PrintOutputController.Export(5).Save("c:\some\path\" & replace(v(0,i),"*","_") & ".pdf", True)
response.write filter.FreeEditingText& ".<p>"
if i =3 then exit for
next
 
I filtered/exported the report twice and then saved the report (clientdoc.save). I then opened the report and the report was empty but when I removed the filter I got the first filter's data.

Could the export method be causing the report to save the data?

Closing the report and then re-opening it again before applying the next filter works correctly.
 
I finally found the way to do this.

clientDoc.DataDefController.ParameterFieldController.SetCurrentValue "","@" & sType, cstr(rs.fields(sType).value)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top