Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQLQueryString - where to find

Posted on 2004-09-02
6
230 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 250 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

766 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