Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQLQueryString - where to find

Posted on 2004-09-02
6
Medium Priority
?
234 Views
Last Modified: 2008-01-09
Hi all

Have downloaded a trial copy of CR10 to use within .NET. I have a page which reads a session based xml document containing the report file and any parameters to pass in. One of the reports that will be loaded in the viewer is causing a bit of a headache. It takes 13 parameters, but needs to ignore any blanks and link in an additional table when one is set to a certain value (for a major speed boost). This can't be done 'normally' and the report takes a ridiculous amount of time to run. I have used a dataset in the past, which works very quickly as I can create a very efficient SQL statement based on the parameters in the xml. Unfortunately, I have just been informed that  our customers all have different criteria for what they want displayed (even though it is invoked from the same page). So I can no longer use a dataset. The plan now is to create the customers reports with no selection criteria and then manually change the where clause of the sql (all the query fields are in the same master table) at runtime. I have no problem with doing this, but I can't find the report class which contains the SQLQueryString - in the help file it gives no reference to the dll, namespace and class where the 'Report Object' can be found (their developer help is a pile of crap tbh). I've been using ReportDocument but it doesn't have this property anywhere. Can anyone advise me which class I should be using and what dll I need to reference in order to access it?

Thanks in advance.
0
Comment
Question by:Trotters
  • 3
  • 3
6 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 11962234
Why not just filter your dataset at runtime and pass it (or a subset of it) to the report as you've been doing?
0
 

Author Comment

by:Trotters
ID: 11962299
That would require code changes and a re-build every time it is deployed to a new customer or an existing client required output change. Reports can be easily updated, which is why I want to take this approach. It would be easy if the documentation was up to scratch.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 11963489
In that case I believe you want the recordselectionformula:

   Report.RecordSelectionFormula = "{Orders.ID} = 1"

This isn't a direct change of the SQL, but the record selection is converted into the SQL's "where" clause so it should work for you need.

0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 

Author Comment

by:Trotters
ID: 11963584
Thanks for trying, but I do need to edit the SQL. I have to reference another lookup table when a certain parameter is set, so the record selection cannot help with that. If it wasn't for that then yes I could just change the selection criteria. I just need to find the 'Report Object' class which this extract of the developer help is pointing at:

"A report corresponds to a print job in the Crystal Report Engine. When the report object is destroyed, or goes out of focus, it closes the print job. It holds on to Application Object. When a Report Object gets destroyed, it releases the application.

Access to the Report Object is dependent on the object variable you create. If the object variable goes out of scope, you will lose access to the Report Object and, therefore, the report. You may want to declare your Report Object variable as Global."
0
 
LVL 42

Accepted Solution

by:
frodoman earned 750 total points
ID: 11963659
As far as I know this just isn't possible.  I found that documented for CR9 ( http://support.businessobjects.com/library/kbase/articles/c2014702.asp ).  I haven't seen anything documented for 10 but since it wasn't supported in 9 and there's nothing to indicate otherwise I have to believe 10 can't handle it either.

I understand why you wanted this approach vs. recompiling for each client but unfortunately I believe that would be your only option to accomplish what you need.
0
 

Author Comment

by:Trotters
ID: 11963876
Cheers, since it has been present in reports since at least version 8.5 then as you say it's probably a limitation of their component. 'Advanced Developer Edition' my arse.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question